Struct switchboard_solana::attestation_program::instructions::request_close::FunctionRequestClose
source · pub struct FunctionRequestClose<'info> {
pub request: AccountInfo<'info>,
pub authority: AccountInfo<'info>,
pub escrow: AccountInfo<'info>,
pub function: AccountInfo<'info>,
pub sol_dest: AccountInfo<'info>,
pub escrow_dest: AccountInfo<'info>,
pub state: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
}
Fields§
§request: AccountInfo<'info>
#[account( mut, close = sol_dest, has_one = function, has_one = escrow @ SwitchboardError::InvalidEscrow, has_one = authority @ SwitchboardError::InvalidAuthority, )] pub request: Box<Account<’info, FunctionRequestAccountData>>,
CHECK: Only needs to sign if request.garbage_collection_slot has not elapsed
escrow: AccountInfo<'info>
#[account( mut, constraint = escrow.is_native() && escrow.owner == state.key() )] pub escrow: Box<Account<’info, TokenAccount>>,
function: AccountInfo<'info>
pub function: AccountLoader<’info, FunctionAccountData>, CHECK: we need to load_mut and remove_request
sol_dest: AccountInfo<'info>
§escrow_dest: AccountInfo<'info>
#[account( mut, constraint = escrow_dest.is_native() && escrow_dest.owner == request.authority // can only send funds to the account owner )] pub escrow_dest: Box<Account<’info, TokenAccount>>,
state: AccountInfo<'info>
#[account( seeds = STATE_SEED, bump = state.load()?.bump, )] pub state: AccountLoader<’info, AttestationProgramState>,
token_program: AccountInfo<'info>
pub token_program: Program<’info, Token>,
system_program: AccountInfo<'info>
pub system_program: Program<’info, System>,
Implementations§
source§impl<'info> FunctionRequestClose<'info>
impl<'info> FunctionRequestClose<'info>
pub fn get_instruction( &self, program_id: Pubkey, is_authority_signer: Option<bool> ) -> Result<Instruction>
pub fn invoke( &self, program: AccountInfo<'info>, is_authority_signer: Option<bool> ) -> ProgramResult
pub fn invoke_signed( &self, program: AccountInfo<'info>, is_authority_signer: Option<bool>, signer_seeds: &[&[&[u8]]] ) -> ProgramResult
Trait Implementations§
source§impl<'info> Accounts<'info, FunctionRequestCloseBumps> for FunctionRequestClose<'info>where
'info: 'info,
impl<'info> Accounts<'info, FunctionRequestCloseBumps> for FunctionRequestClose<'info>where
'info: 'info,
source§fn try_accounts(
__program_id: &Pubkey,
__accounts: &mut &'info [AccountInfo<'info>],
__ix_data: &[u8],
__bumps: &mut FunctionRequestCloseBumps,
__reallocs: &mut BTreeSet<Pubkey>
) -> Result<Self>
fn try_accounts( __program_id: &Pubkey, __accounts: &mut &'info [AccountInfo<'info>], __ix_data: &[u8], __bumps: &mut FunctionRequestCloseBumps, __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 FunctionRequestClose<'info>where
'info: 'info,
impl<'info> AccountsExit<'info> for FunctionRequestClose<'info>where
'info: 'info,
source§impl<'info> Bumps for FunctionRequestClose<'info>where
'info: 'info,
impl<'info> Bumps for FunctionRequestClose<'info>where
'info: 'info,
§type Bumps = FunctionRequestCloseBumps
type Bumps = FunctionRequestCloseBumps
source§impl Discriminator for FunctionRequestClose<'_>
impl Discriminator for FunctionRequestClose<'_>
const DISCRIMINATOR: [u8; 8] = _
fn discriminator() -> [u8; 8]
source§impl<'info> ToAccountInfos<'info> for FunctionRequestClose<'info>where
'info: 'info,
impl<'info> ToAccountInfos<'info> for FunctionRequestClose<'info>where
'info: 'info,
fn to_account_infos(&self) -> Vec<AccountInfo<'info>>
source§impl<'info> ToAccountMetas for FunctionRequestClose<'info>
impl<'info> ToAccountMetas for FunctionRequestClose<'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.