pub struct GetAccountDataSize<'a> {
pub mint: &'a AccountView<'a>,
pub extension_types: &'a [u16],
}Expand description
GetAccountDataSize (21): ask the token program how many bytes a
token account for mint needs, as a u64 in the return data. On
Token-2022 the mint’s required account extensions are included
automatically and extension_types adds more (for example
crate::token_2022_ext::EXT_IMMUTABLE_OWNER); SPL Token ignores
the list and answers 165.
Fields§
§mint: &'a AccountView<'a>§extension_types: &'a [u16]Implementations§
Source§impl GetAccountDataSize<'_>
impl GetAccountDataSize<'_>
pub fn invoke(&self) -> ProgramResult
Sourcepub fn query(&self, program: TokenProgram) -> Result<u64, ProgramError>
pub fn query(&self, program: TokenProgram) -> Result<u64, ProgramError>
Invoke on program and read the answer from the return data.
Sourcepub fn query_for_owner(&self) -> Result<u64, ProgramError>
pub fn query_for_owner(&self) -> Result<u64, ProgramError>
query on whichever token program owns mint.
Source§impl GetAccountDataSize<'_>
impl GetAccountDataSize<'_>
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
mint
(one 32-byte compare). Any other owner is refused with
IncorrectProgramId before the CPI.