pub struct ApproveChecked<'a> {
pub source: &'a AccountView<'a>,
pub mint: &'a AccountView<'a>,
pub delegate: &'a AccountView<'a>,
pub authority: &'a AccountView<'a>,
pub amount: u64,
pub decimals: u8,
}Expand description
Builder for SPL Token ApproveChecked (instruction index 13).
Mint + decimals-verified approval. Same safety profile as the
other *Checked variants.
Fields§
§source: &'a AccountView<'a>§mint: &'a AccountView<'a>§delegate: &'a AccountView<'a>§amount: u64§decimals: u8Implementations§
Source§impl ApproveChecked<'_>
impl ApproveChecked<'_>
pub fn invoke(&self) -> ProgramResult
Sourcepub fn invoke_strict(&self) -> ProgramResult
pub fn invoke_strict(&self) -> ProgramResult
Strict invoke: signer pre-check plus source-account ownership
verification. Ensures the authority granting the approval is
actually allowed to do so. See TransferChecked::invoke_strict
for the full rationale.
pub fn invoke_signed(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
pub fn invoke_multisig( &self, multisig_signers: &[&AccountView<'_>], ) -> ProgramResult
pub fn invoke_signed_multisig( &self, multisig_signers: &[&AccountView<'_>], signers: &[Signer<'_, '_>], ) -> ProgramResult
Sourcepub fn invoke_signed_strict(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
pub fn invoke_signed_strict(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
Strict PDA-signed invoke. Pre-check the source-account owner before the CPI.
Source§impl ApproveChecked<'_>
impl ApproveChecked<'_>
Sourcepub fn invoke_on(
&self,
program: TokenProgram,
multisig_signers: &[&AccountView<'_>],
signers: &[Signer<'_, '_>],
) -> ProgramResult
pub fn invoke_on( &self, program: TokenProgram, multisig_signers: &[&AccountView<'_>], signers: &[Signer<'_, '_>], ) -> ProgramResult
Send this instruction to an explicit token program.
multisig_signers is empty for a single-key authority; when
signers is empty the authority (or every multisig signer)
must have signed the transaction directly.
Sourcepub fn invoke_for_owner(
&self,
multisig_signers: &[&AccountView<'_>],
signers: &[Signer<'_, '_>],
) -> ProgramResult
pub fn invoke_for_owner( &self, multisig_signers: &[&AccountView<'_>], signers: &[Signer<'_, '_>], ) -> ProgramResult
Send this instruction to whichever token program owns
source
(one 32-byte compare). Any other owner is refused with
IncorrectProgramId before the CPI.