Struct streamflow_sdk::Withdraw
source · pub struct Withdraw<'info> {
pub authority: Signer<'info>,
pub recipient: AccountInfo<'info>,
pub recipient_tokens: Account<'info, TokenAccount>,
pub metadata: AccountInfo<'info>,
pub escrow_tokens: Account<'info, TokenAccount>,
pub streamflow_treasury: AccountInfo<'info>,
pub streamflow_treasury_tokens: AccountInfo<'info>,
pub partner: AccountInfo<'info>,
pub partner_tokens: AccountInfo<'info>,
pub mint: Account<'info, Mint>,
pub token_program: Program<'info, Token>,
}Expand description
Accounts expected in withdraw instruction
Fields§
Wallet of the contract withdrawor.
recipient: AccountInfo<'info>Wallet address of the recipient.
recipient_tokens: Account<'info, TokenAccount>Associated token account address of recipient.
metadata: AccountInfo<'info>The account holding the contract parameters. Expects initialized account.
escrow_tokens: Account<'info, TokenAccount>The escrow account holding the funds. Expects initialized account.
streamflow_treasury: AccountInfo<'info>Streamflow treasury account.
streamflow_treasury_tokens: AccountInfo<'info>Associated token account address of streamflow_treasury.
partner: AccountInfo<'info>Partner treasury account. If no partner fees are expected on behalf of the program
integrating with streamflow, streamflow_treasury can be passed in here.
Must match partner account in contract metadata.
partner_tokens: AccountInfo<'info>Associated token account address of partner. If no partner fees are expected on behalf of the
program integrating with streamflow, streamflow_treasury_tokens can be passed in here.
Must match partner token account in contract metadata.
mint: Account<'info, Mint>The SPL token mint account.
token_program: Program<'info, Token>The SPL program needed in case an associated account for the new recipient is being created.
Trait Implementations§
source§impl<'info> Accounts<'info> for Withdraw<'info>where
'info: 'info,
impl<'info> Accounts<'info> for Withdraw<'info>where
'info: 'info,
source§fn try_accounts(
program_id: &Pubkey,
accounts: &mut &[AccountInfo<'info>],
ix_data: &[u8],
__bumps: &mut BTreeMap<String, u8>
) -> Result<Self>
fn try_accounts(
program_id: &Pubkey,
accounts: &mut &[AccountInfo<'info>],
ix_data: &[u8],
__bumps: &mut BTreeMap<String, u8>
) -> 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 Withdraw<'info>where
'info: 'info,
impl<'info> AccountsExit<'info> for Withdraw<'info>where
'info: 'info,
source§impl<'info> ToAccountInfos<'info> for Withdraw<'info>where
'info: 'info,
impl<'info> ToAccountInfos<'info> for Withdraw<'info>where
'info: 'info,
fn to_account_infos(&self) -> Vec<AccountInfo<'info>> ⓘ
source§impl<'info> ToAccountMetas for Withdraw<'info>
impl<'info> ToAccountMetas for Withdraw<'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.