Skip to main content

MintExtension

Enum MintExtension 

Source
#[non_exhaustive]
pub enum MintExtension<'a> {
Show 13 variants TransferFeeConfig { authority: Option<&'a Address>, withdraw_authority: Option<&'a Address>, basis_points: u16, maximum_fee: u64, }, MintCloseAuthority(Option<&'a Address>), NonTransferable, PermanentDelegate(&'a Address), TransferHook { authority: Option<&'a Address>, program_id: Option<&'a Address>, }, MetadataPointer { authority: Option<&'a Address>, metadata_address: Option<&'a Address>, }, DefaultAccountState(u8), InterestBearing { rate_authority: Option<&'a Address>, rate: i16, }, ScaledUiAmount { authority: Option<&'a Address>, multiplier: f64, }, Pausable(&'a Address), GroupPointer { authority: Option<&'a Address>, group_address: Option<&'a Address>, }, GroupMemberPointer { authority: Option<&'a Address>, member_address: Option<&'a Address>, }, PermissionedBurn(&'a Address),
}
Expand description

Fixed-size mint extensions supported by MintPlan.

Extension authorities and hook/metadata addresses use Token-2022’s nullable address encoding where applicable. Some(zero_address) is rejected for those fields, rather than silently being interpreted as None.

Token-2022 keeps adding extensions, and each one Hopper supports is a new variant, so a match outside this crate needs a wildcard arm.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

TransferFeeConfig

Fields

§authority: Option<&'a Address>
§withdraw_authority: Option<&'a Address>
§basis_points: u16
§maximum_fee: u64
§

MintCloseAuthority(Option<&'a Address>)

§

NonTransferable

§

PermanentDelegate(&'a Address)

§

TransferHook

Fields

§authority: Option<&'a Address>
§program_id: Option<&'a Address>
§

MetadataPointer

Fields

§authority: Option<&'a Address>
§metadata_address: Option<&'a Address>
§

DefaultAccountState(u8)

New token accounts start in this state: 1 initialized, 2 frozen.

§

InterestBearing

Balances display with continuously compounding interest at rate basis points; rate_authority may change the rate.

Fields

§rate_authority: Option<&'a Address>
§rate: i16
§

ScaledUiAmount

Balances display multiplied by multiplier (positive and finite); authority may schedule a new multiplier.

Fields

§authority: Option<&'a Address>
§multiplier: f64
§

Pausable(&'a Address)

The authority that may pause and resume the mint.

§

GroupPointer

Fields

§authority: Option<&'a Address>
§group_address: Option<&'a Address>
§

GroupMemberPointer

Fields

§authority: Option<&'a Address>
§member_address: Option<&'a Address>
§

PermissionedBurn(&'a Address)

Burns need this authority’s signature next to the holder’s.

Implementations§

Source§

impl MintExtension<'_>

Source

pub const fn extension_type(&self) -> u16

Token-2022’s TLV extension discriminator (not an instruction tag).

Source

pub const fn value_len(&self) -> usize

The extension’s TLV value length: the size of its on-chain state.

Source

pub fn instruction_data(&self) -> Result<MintInstructionData, ProgramError>

Canonical instruction bytes, also usable by off-chain instruction builders.

Trait Implementations§

Source§

impl<'a> Clone for MintExtension<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for MintExtension<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for MintExtension<'a>

§

impl<'a> RefUnwindSafe for MintExtension<'a>

§

impl<'a> Send for MintExtension<'a>

§

impl<'a> Sync for MintExtension<'a>

§

impl<'a> Unpin for MintExtension<'a>

§

impl<'a> UnsafeUnpin for MintExtension<'a>

§

impl<'a> UnwindSafe for MintExtension<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.