Struct switchboard_solana::attestation_program::instructions::request_init::FunctionRequestInit
source · pub struct FunctionRequestInit<'info> {
pub request: AccountInfo<'info>,
pub authority: AccountInfo<'info>,
pub function: AccountInfo<'info>,
pub function_authority: Option<AccountInfo<'info>>,
pub escrow: AccountInfo<'info>,
pub mint: AccountInfo<'info>,
pub state: AccountInfo<'info>,
pub attestation_queue: AccountInfo<'info>,
pub payer: AccountInfo<'info>,
pub system_program: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
pub associated_token_program: AccountInfo<'info>,
}
Fields§
§request: AccountInfo<'info>
CHECK: the authority of the request
function: AccountInfo<'info>
CHECK: function authority required to permit new requests
escrow: AccountInfo<'info>
§mint: AccountInfo<'info>
§state: AccountInfo<'info>
§attestation_queue: AccountInfo<'info>
§payer: AccountInfo<'info>
§system_program: AccountInfo<'info>
§token_program: AccountInfo<'info>
§associated_token_program: AccountInfo<'info>
Implementations§
source§impl<'info> FunctionRequestInit<'info>
impl<'info> FunctionRequestInit<'info>
pub fn get_instruction( &self, program_id: Pubkey, params: FunctionRequestInitParams ) -> Result<Instruction>
sourcepub fn invoke(
&self,
program: AccountInfo<'info>,
max_container_params_len: Option<u32>,
container_params: Option<Vec<u8>>,
garbage_collection_slot: Option<u64>
) -> ProgramResult
pub fn invoke( &self, program: AccountInfo<'info>, max_container_params_len: Option<u32>, container_params: Option<Vec<u8>>, garbage_collection_slot: Option<u64> ) -> ProgramResult
Invokes the instruction using a signed authority.
§Arguments
-
program
: The Switchboard Attestation program AccountInfo. -
max_container_params_len
: The maximum length of the vector containing the container parameters.- Default: 256 bytes.
- Example:
Some(512)
.
-
container_params
: The parameters for the container.- Default: Empty vector.
- Example:
Some(request_params.into_bytes())
.
-
garbage_collection_slot
: The slot when the request can be closed by anyone and is considered expired.- Default: None, meaning only the authority can close the request.
§Returns
ProgramResult
: Indicates the result of the instruction execution.
sourcepub fn invoke_signed(
&self,
program: AccountInfo<'info>,
max_container_params_len: Option<u32>,
container_params: Option<Vec<u8>>,
garbage_collection_slot: Option<u64>,
signer_seeds: &[&[&[u8]]]
) -> ProgramResult
pub fn invoke_signed( &self, program: AccountInfo<'info>, max_container_params_len: Option<u32>, container_params: Option<Vec<u8>>, garbage_collection_slot: Option<u64>, signer_seeds: &[&[&[u8]]] ) -> ProgramResult
Invokes the instruction using a signed authority.
§Arguments
-
program
: The Switchboard Attestation program AccountInfo. -
max_container_params_len
: The maximum length of the vector containing the container parameters.- Default: 256 bytes.
- Example:
Some(512)
.
-
container_params
: The parameters for the container.- Default: Empty vector.
- Example:
Some(request_params.into_bytes())
.
-
garbage_collection_slot
: The slot when the request can be closed by anyone and is considered expired.- Default: None, meaning only the authority can close the request.
-
signer_seeds
: Seeds used for signing.
§Returns
ProgramResult
: Indicates the result of the instruction execution.
Trait Implementations§
source§impl<'info> Accounts<'info, FunctionRequestInitBumps> for FunctionRequestInit<'info>where
'info: 'info,
impl<'info> Accounts<'info, FunctionRequestInitBumps> for FunctionRequestInit<'info>where
'info: 'info,
source§fn try_accounts(
__program_id: &Pubkey,
__accounts: &mut &'info [AccountInfo<'info>],
__ix_data: &[u8],
__bumps: &mut FunctionRequestInitBumps,
__reallocs: &mut BTreeSet<Pubkey>
) -> Result<Self>
fn try_accounts( __program_id: &Pubkey, __accounts: &mut &'info [AccountInfo<'info>], __ix_data: &[u8], __bumps: &mut FunctionRequestInitBumps, __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 FunctionRequestInit<'info>where
'info: 'info,
impl<'info> AccountsExit<'info> for FunctionRequestInit<'info>where
'info: 'info,
source§impl<'info> Bumps for FunctionRequestInit<'info>where
'info: 'info,
impl<'info> Bumps for FunctionRequestInit<'info>where
'info: 'info,
§type Bumps = FunctionRequestInitBumps
type Bumps = FunctionRequestInitBumps
source§impl Discriminator for FunctionRequestInit<'_>
impl Discriminator for FunctionRequestInit<'_>
const DISCRIMINATOR: [u8; 8] = _
fn discriminator() -> [u8; 8]
source§impl<'info> ToAccountInfos<'info> for FunctionRequestInit<'info>where
'info: 'info,
impl<'info> ToAccountInfos<'info> for FunctionRequestInit<'info>where
'info: 'info,
fn to_account_infos(&self) -> Vec<AccountInfo<'info>>
source§impl<'info> ToAccountMetas for FunctionRequestInit<'info>
impl<'info> ToAccountMetas for FunctionRequestInit<'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.