pub struct TransferChecked<'a> {
pub from: &'a AccountView<'a>,
pub mint: &'a AccountView<'a>,
pub to: &'a AccountView<'a>,
pub authority: &'a AccountView<'a>,
pub amount: u64,
pub decimals: u8,
}Expand description
Builder for classic SPL Token TransferChecked (instruction index 12).
The token program checks the supplied mint and decimals. This builder calls
TOKEN_PROGRAM_ID; it does not dispatch to Token-2022 or resolve transfer
hooks. Use hopper_solana::interface or hopper_token_2022 for those program
integrations, supplying hook accounts when required.
Fields§
§from: &'a AccountView<'a>§mint: &'a AccountView<'a>§to: &'a AccountView<'a>§amount: u64§decimals: u8Implementations§
Source§impl TransferChecked<'_>
impl TransferChecked<'_>
Sourcepub fn invoke(&self) -> ProgramResult
pub fn invoke(&self) -> ProgramResult
Invoke with a transaction-signed authority. Fails fast with
MissingRequiredSignature before the CPI if the authority
is not a signer.
Sourcepub fn invoke_strict(&self) -> ProgramResult
pub fn invoke_strict(&self) -> ProgramResult
Check transaction signer status and require the source’s token owner
to equal the authority before CPI. This stricter owner path excludes
delegated transfers; use invoke when the token program should validate
a delegate or invoke_multisig for an SPL multisig authority.
Verifies self.from’s owner field (SPL TokenAccount bytes
[32..64]) matches self.authority.address(). Returns
ProgramError::IncorrectAuthority on mismatch.
Sourcepub fn invoke_signed(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
pub fn invoke_signed(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
Invoke with explicit PDA signer seeds. The SPL token program validates mint + decimals regardless of the signer source.
Sourcepub fn invoke_multisig(
&self,
multisig_signers: &[&AccountView<'_>],
) -> ProgramResult
pub fn invoke_multisig( &self, multisig_signers: &[&AccountView<'_>], ) -> ProgramResult
Invoke with an SPL multisig owner account plus transaction-signed multisig signer accounts.
Sourcepub fn invoke_signed_multisig(
&self,
multisig_signers: &[&AccountView<'_>],
signers: &[Signer<'_, '_>],
) -> ProgramResult
pub fn invoke_signed_multisig( &self, multisig_signers: &[&AccountView<'_>], signers: &[Signer<'_, '_>], ) -> ProgramResult
Invoke with an SPL multisig owner account and explicit PDA signer seeds.
Sourcepub fn invoke_signed_strict(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
pub fn invoke_signed_strict(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
Strict PDA-signed invoke: ownership pre-check (the SPL token program revalidates, but Hopper surfaces a branded error first) then CPI with the supplied signer seeds.