pub enum SplTokenInstruction {
Show 25 variants
InitializeMint {
decimals: u8,
},
InitializeAccount,
InitializeMultisig {
m: u8,
},
Transfer {
amount: u64,
},
Approve {
amount: u64,
},
Revoke,
SetAuthority {
authority_type: u8,
},
MintTo {
amount: u64,
},
Burn {
amount: u64,
},
CloseAccount,
FreezeAccount,
ThawAccount,
TransferChecked {
amount: u64,
decimals: u8,
},
ApproveChecked {
amount: u64,
decimals: u8,
},
MintToChecked {
amount: u64,
decimals: u8,
},
BurnChecked {
amount: u64,
decimals: u8,
},
InitializeAccount2,
SyncNative,
InitializeAccount3,
InitializeMultisig2 {
m: u8,
},
InitializeMint2 {
decimals: u8,
},
GetAccountDataSize,
InitializeImmutableOwner,
AmountToUiAmount {
amount: u64,
},
UiAmountToAmount,
}Expand description
SPL Token program instructions.
The SPL Token program uses a 1-byte discriminator (variant index). Each variant’s discriminator is its position in this enum (0, 1, 2, …).
Note: Complex types (Pubkey, COption
Variants§
InitializeMint
Initialize a new mint (index 0)
Fields: decimals: u8, mint_authority: Pubkey, freeze_authority: COption
InitializeAccount
Initialize a new token account (index 1)
InitializeMultisig
Initialize a multisig account (index 2)
Transfer
Transfer tokens (index 3)
Approve
Approve a delegate (index 4)
Revoke
Revoke delegate authority (index 5)
SetAuthority
Set a new authority (index 6)
Fields: authority_type: u8, new_authority: COption
Fields
MintTo
Mint new tokens (index 7)
Burn
Burn tokens (index 8)
CloseAccount
Close a token account (index 9)
FreezeAccount
Freeze a token account (index 10)
ThawAccount
Thaw a frozen token account (index 11)
TransferChecked
Transfer tokens with decimals check (index 12)
ApproveChecked
Approve delegate with decimals check (index 13)
MintToChecked
Mint tokens with decimals check (index 14)
BurnChecked
Burn tokens with decimals check (index 15)
InitializeAccount2
Initialize account with owner in data (index 16) Fields: owner: Pubkey (32 bytes)
SyncNative
Sync native SOL balance (index 17)
InitializeAccount3
Initialize account without rent sysvar (index 18) Fields: owner: Pubkey (32 bytes)
InitializeMultisig2
Initialize multisig without rent sysvar (index 19)
InitializeMint2
Initialize mint without rent sysvar (index 20)
Fields: decimals: u8, mint_authority: Pubkey, freeze_authority: COption
GetAccountDataSize
Get required account size (index 21)
InitializeImmutableOwner
Initialize immutable owner extension (index 22)
AmountToUiAmount
Convert amount to UI amount string (index 23)
UiAmountToAmount
Convert UI amount string to amount (index 24) Fields: ui_amount: &str (variable length)
Auto Trait Implementations§
impl Freeze for SplTokenInstruction
impl RefUnwindSafe for SplTokenInstruction
impl Send for SplTokenInstruction
impl Sync for SplTokenInstruction
impl Unpin for SplTokenInstruction
impl UnwindSafe for SplTokenInstruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more