pub enum AssociatedTokenAccountInstruction {
Create,
CreateIdempotent,
RecoverNested,
}
Expand description
Instructions supported by the AssociatedTokenAccount program
Variants
Create
Creates an associated token account for the given wallet address and token mint Returns an error if the account exists.
[writeable,signer]
Funding account (must be a system account)[writeable]
Associated token account address to be created[]
Wallet address for the new associated token account[]
The token mint for the new associated token account[]
System program[]
SPL Token program
CreateIdempotent
Creates an associated token account for the given wallet address and token mint, if it doesn’t already exist. Returns an error if the account exists, but with a different owner.
[writeable,signer]
Funding account (must be a system account)[writeable]
Associated token account address to be created[]
Wallet address for the new associated token account[]
The token mint for the new associated token account[]
System program[]
SPL Token program
RecoverNested
Transfers from and closes a nested associated token account: an associated token account owned by an associated token account.
The tokens are moved from the nested associated token account to the wallet’s associated token account, and the nested account lamports are moved to the wallet.
Note: Nested token accounts are an anti-pattern, and almost always created unintentionally, so this instruction should only be used to recover from errors.
[writeable]
Nested associated token account, must be owned by3
[]
Token mint for the nested associated token account[writeable]
Wallet’s associated token account[]
Owner associated token account address, must be owned by5
[]
Token mint for the owner associated token account[writeable, signer]
Wallet address for the owner associated token account[]
SPL Token program
Trait Implementations
sourceimpl BorshSchema for AssociatedTokenAccountInstruction
impl BorshSchema for AssociatedTokenAccountInstruction
sourcefn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
sourcefn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
Recursively, using DFS, add type definitions required for this type. For primitive types this is an empty map. Type definition explains how to serialize/deserialize a type. Read more
sourcefn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
Helper method to add a single type definition to the map.
fn schema_container() -> BorshSchemaContainer
sourceimpl Clone for AssociatedTokenAccountInstruction
impl Clone for AssociatedTokenAccountInstruction
sourcefn clone(&self) -> AssociatedTokenAccountInstruction
fn clone(&self) -> AssociatedTokenAccountInstruction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl StructuralPartialEq for AssociatedTokenAccountInstruction
Auto Trait Implementations
impl RefUnwindSafe for AssociatedTokenAccountInstruction
impl Send for AssociatedTokenAccountInstruction
impl Sync for AssociatedTokenAccountInstruction
impl Unpin for AssociatedTokenAccountInstruction
impl UnwindSafe for AssociatedTokenAccountInstruction
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more