pub struct TransferCpiBuilder<'a, 'b> { /* private fields */ }
Expand description
Instruction builder for Transfer
via CPI.
Accounts:
[writable]
token[]
token_owner[writable]
destination_token[]
destination_owner[]
mint[writable]
metadata[optional]
edition[writable, optional]
token_record[writable, optional]
destination_token_record[signer]
authority[writable, signer]
payer[]
system_program[]
sysvar_instructions[]
spl_token_program[]
spl_ata_program[optional]
authorization_rules_program[optional]
authorization_rules
Implementations§
source§impl<'a, 'b> TransferCpiBuilder<'a, 'b>
impl<'a, 'b> TransferCpiBuilder<'a, 'b>
pub fn new(program: &'b AccountInfo<'a>) -> Self
sourcepub fn token(&mut self, token: &'b AccountInfo<'a>) -> &mut Self
pub fn token(&mut self, token: &'b AccountInfo<'a>) -> &mut Self
Token account
sourcepub fn token_owner(&mut self, token_owner: &'b AccountInfo<'a>) -> &mut Self
pub fn token_owner(&mut self, token_owner: &'b AccountInfo<'a>) -> &mut Self
Token account owner
sourcepub fn destination_token(
&mut self,
destination_token: &'b AccountInfo<'a>
) -> &mut Self
pub fn destination_token( &mut self, destination_token: &'b AccountInfo<'a> ) -> &mut Self
Destination token account
sourcepub fn destination_owner(
&mut self,
destination_owner: &'b AccountInfo<'a>
) -> &mut Self
pub fn destination_owner( &mut self, destination_owner: &'b AccountInfo<'a> ) -> &mut Self
Destination token account owner
sourcepub fn mint(&mut self, mint: &'b AccountInfo<'a>) -> &mut Self
pub fn mint(&mut self, mint: &'b AccountInfo<'a>) -> &mut Self
Mint of token asset
sourcepub fn metadata(&mut self, metadata: &'b AccountInfo<'a>) -> &mut Self
pub fn metadata(&mut self, metadata: &'b AccountInfo<'a>) -> &mut Self
Metadata (pda of [‘metadata’, program id, mint id])
sourcepub fn edition(&mut self, edition: Option<&'b AccountInfo<'a>>) -> &mut Self
pub fn edition(&mut self, edition: Option<&'b AccountInfo<'a>>) -> &mut Self
[optional account]
Edition of token asset
sourcepub fn token_record(
&mut self,
token_record: Option<&'b AccountInfo<'a>>
) -> &mut Self
pub fn token_record( &mut self, token_record: Option<&'b AccountInfo<'a>> ) -> &mut Self
[optional account]
Owner token record account
sourcepub fn destination_token_record(
&mut self,
destination_token_record: Option<&'b AccountInfo<'a>>
) -> &mut Self
pub fn destination_token_record( &mut self, destination_token_record: Option<&'b AccountInfo<'a>> ) -> &mut Self
[optional account]
Destination token record account
Transfer authority (token owner or delegate)
sourcepub fn payer(&mut self, payer: &'b AccountInfo<'a>) -> &mut Self
pub fn payer(&mut self, payer: &'b AccountInfo<'a>) -> &mut Self
Payer
sourcepub fn system_program(
&mut self,
system_program: &'b AccountInfo<'a>
) -> &mut Self
pub fn system_program( &mut self, system_program: &'b AccountInfo<'a> ) -> &mut Self
System Program
sourcepub fn sysvar_instructions(
&mut self,
sysvar_instructions: &'b AccountInfo<'a>
) -> &mut Self
pub fn sysvar_instructions( &mut self, sysvar_instructions: &'b AccountInfo<'a> ) -> &mut Self
Instructions sysvar account
sourcepub fn spl_token_program(
&mut self,
spl_token_program: &'b AccountInfo<'a>
) -> &mut Self
pub fn spl_token_program( &mut self, spl_token_program: &'b AccountInfo<'a> ) -> &mut Self
SPL Token Program
sourcepub fn spl_ata_program(
&mut self,
spl_ata_program: &'b AccountInfo<'a>
) -> &mut Self
pub fn spl_ata_program( &mut self, spl_ata_program: &'b AccountInfo<'a> ) -> &mut Self
SPL Associated Token Account program
[optional account]
Token Authorization Rules Program
[optional account]
Token Authorization Rules account
pub fn transfer_args(&mut self, transfer_args: TransferArgs) -> &mut Self
sourcepub fn add_remaining_account(
&mut self,
account: &'b AccountInfo<'a>,
is_writable: bool,
is_signer: bool
) -> &mut Self
pub fn add_remaining_account( &mut self, account: &'b AccountInfo<'a>, is_writable: bool, is_signer: bool ) -> &mut Self
Add an additional account to the instruction.
sourcepub fn add_remaining_accounts(
&mut self,
accounts: &[(&'b AccountInfo<'a>, bool, bool)]
) -> &mut Self
pub fn add_remaining_accounts( &mut self, accounts: &[(&'b AccountInfo<'a>, bool, bool)] ) -> &mut Self
Add additional accounts to the instruction.
Each account is represented by a tuple of the AccountInfo
, a bool
indicating whether the account is writable or not,
and a bool
indicating whether the account is a signer or not.