pub struct TransferChecked<'a, 'b: 'a> {
pub token_program_id: &'a Pubkey,
pub source: &'b NoStdAccountInfo,
pub mint: &'b NoStdAccountInfo,
pub destination: &'b NoStdAccountInfo,
pub authority: CpiAuthority<'a, 'b>,
pub amount: u64,
pub decimals: u8,
pub additional_accounts: Option<&'a [NoStdAccountInfo]>,
}Expand description
Arguments for the transfer checked instruction on the specified Token program, which moves a specified amount of tokens from the source to destination token account only if the specified decimals agree with the decimals encoded in the mint account. Only the token account’s owner or delegated authority can invoke this instruction.
If the “alloc” feature is disabled, this method will error out if the number of additional accounts exceeds MAX_ADDITIONAL_ACCOUNTS_NOALLOC. Otherwise this method should be infallible.
Fields§
§token_program_id: &'a Pubkey§source: &'b NoStdAccountInfo§mint: &'b NoStdAccountInfo§destination: &'b NoStdAccountInfoEither the owner or delegated authority of the source token account.
amount: u64§decimals: u8§additional_accounts: Option<&'a [NoStdAccountInfo]>These additional accounts apply to the transfer checked instruction on the Token Extensions program. Examples of these accounts may include signers of the multisig extension or accounts needed for transfer hook CPI (which is performed by the Token Extensions program).
Implementations§
Source§impl<'a, 'b: 'a> TransferChecked<'a, 'b>
impl<'a, 'b: 'a> TransferChecked<'a, 'b>
Sourcepub fn try_into_invoke(self) -> ProgramResult
pub fn try_into_invoke(self) -> ProgramResult
Tries to consume arguments to perform CPI call.
Trait Implementations§
Source§impl<'a, 'b: 'a> Clone for TransferChecked<'a, 'b>
impl<'a, 'b: 'a> Clone for TransferChecked<'a, 'b>
impl<'a, 'b: 'a> Eq for TransferChecked<'a, 'b>
Source§impl<'a, 'b: 'a> PartialEq for TransferChecked<'a, 'b>
impl<'a, 'b: 'a> PartialEq for TransferChecked<'a, 'b>
impl<'a, 'b: 'a> StructuralPartialEq for TransferChecked<'a, 'b>
Auto Trait Implementations§
impl<'a, 'b> !Send for TransferChecked<'a, 'b>
impl<'a, 'b> !Sync for TransferChecked<'a, 'b>
impl<'a, 'b> Freeze for TransferChecked<'a, 'b>
impl<'a, 'b> RefUnwindSafe for TransferChecked<'a, 'b>
impl<'a, 'b> Unpin for TransferChecked<'a, 'b>
impl<'a, 'b> UnsafeUnpin for TransferChecked<'a, 'b>
impl<'a, 'b> UnwindSafe for TransferChecked<'a, 'b>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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