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§
source§impl BorshDeserialize for AssociatedTokenAccountInstruction
impl BorshDeserialize for AssociatedTokenAccountInstruction
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSchema for AssociatedTokenAccountInstruction
impl BorshSchema for AssociatedTokenAccountInstruction
source§fn declaration() -> Declaration
fn declaration() -> Declaration
source§fn add_definitions_recursively(
definitions: &mut BTreeMap<Declaration, Definition>,
)
fn add_definitions_recursively( definitions: &mut BTreeMap<Declaration, Definition>, )
source§impl Clone for AssociatedTokenAccountInstruction
impl Clone for AssociatedTokenAccountInstruction
source§fn clone(&self) -> AssociatedTokenAccountInstruction
fn clone(&self) -> AssociatedTokenAccountInstruction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl PartialEq for AssociatedTokenAccountInstruction
impl PartialEq for AssociatedTokenAccountInstruction
source§fn eq(&self, other: &AssociatedTokenAccountInstruction) -> bool
fn eq(&self, other: &AssociatedTokenAccountInstruction) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for AssociatedTokenAccountInstruction
Auto Trait Implementations§
impl Freeze for AssociatedTokenAccountInstruction
impl RefUnwindSafe for AssociatedTokenAccountInstruction
impl Send for AssociatedTokenAccountInstruction
impl Sync for AssociatedTokenAccountInstruction
impl Unpin for AssociatedTokenAccountInstruction
impl UnwindSafe for AssociatedTokenAccountInstruction
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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