pub struct SpendingLimitUse<'info> {
pub multisig: Box<Account<'info, Multisig>>,
pub member: Signer<'info>,
pub spending_limit: Account<'info, SpendingLimit>,
pub vault: AccountInfo<'info>,
pub destination: AccountInfo<'info>,
pub system_program: Option<Program<'info, System>>,
pub mint: Option<InterfaceAccount<'info, Mint>>,
pub vault_token_account: Option<InterfaceAccount<'info, TokenAccount>>,
pub destination_token_account: Option<InterfaceAccount<'info, TokenAccount>>,
pub token_program: Option<Interface<'info, TokenInterface>>,
}Fields§
§multisig: Box<Account<'info, Multisig>>The multisig account the spending_limit is for.
member: Signer<'info>§spending_limit: Account<'info, SpendingLimit>The SpendingLimit account to use.
vault: AccountInfo<'info>Multisig vault account to transfer tokens from. CHECK: All the required checks are done by checking the seeds.
destination: AccountInfo<'info>Destination account to transfer tokens to.
CHECK: We do the checks in SpendingLimitUse::validate.
system_program: Option<Program<'info, System>>In case spending_limit.mint is SOL.
mint: Option<InterfaceAccount<'info, Mint>>The mint of the tokens to transfer in case spending_limit.mint is an SPL token.
CHECK: We do the checks in SpendingLimitUse::validate.
vault_token_account: Option<InterfaceAccount<'info, TokenAccount>>Multisig vault token account to transfer tokens from in case spending_limit.mint is an SPL token.
destination_token_account: Option<InterfaceAccount<'info, TokenAccount>>Destination token account in case spending_limit.mint is an SPL token.
token_program: Option<Interface<'info, TokenInterface>>In case spending_limit.mint is an SPL token.
Implementations§
source§impl SpendingLimitUse<'_>
impl SpendingLimitUse<'_>
sourcepub fn spending_limit_use(
ctx: Context<'_, '_, '_, '_, Self>,
args: SpendingLimitUseArgs
) -> Result<()>
pub fn spending_limit_use( ctx: Context<'_, '_, '_, '_, Self>, args: SpendingLimitUseArgs ) -> Result<()>
Use a spending limit to transfer tokens from a multisig vault to a destination account.
Trait Implementations§
source§impl<'info> Accounts<'info> for SpendingLimitUse<'info>where
'info: 'info,
impl<'info> Accounts<'info> for SpendingLimitUse<'info>where 'info: 'info,
source§fn try_accounts(
program_id: &Pubkey,
accounts: &mut &[AccountInfo<'info>],
ix_data: &[u8],
__bumps: &mut BTreeMap<String, u8>,
__reallocs: &mut BTreeSet<Pubkey>
) -> Result<Self>
fn try_accounts( program_id: &Pubkey, accounts: &mut &[AccountInfo<'info>], ix_data: &[u8], __bumps: &mut BTreeMap<String, u8>, __reallocs: &mut BTreeSet<Pubkey> ) -> Result<Self>
Mint account from the SPL token program in a particular
field, then it should be impossible for this method to return Ok if
any other account type is given–from the SPL token program or elsewhere. Read moresource§impl<'info> AccountsExit<'info> for SpendingLimitUse<'info>where
'info: 'info,
impl<'info> AccountsExit<'info> for SpendingLimitUse<'info>where 'info: 'info,
source§impl<'info> ToAccountInfos<'info> for SpendingLimitUse<'info>where
'info: 'info,
impl<'info> ToAccountInfos<'info> for SpendingLimitUse<'info>where 'info: 'info,
fn to_account_infos(&self) -> Vec<AccountInfo<'info>>
source§impl<'info> ToAccountMetas for SpendingLimitUse<'info>
impl<'info> ToAccountMetas for SpendingLimitUse<'info>
source§fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>
fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>
is_signer is given as an optional override for the signer meta field.
This covers the edge case when a program-derived-address needs to relay
a transaction from a client to another program but sign the transaction
before the relay. The client cannot mark the field as a signer, and so
we have to override the is_signer meta field given by the client.