Struct switchboard_solana::attestation_program::instructions::request_init_and_trigger::FunctionRequestInitAndTrigger
source · pub struct FunctionRequestInitAndTrigger<'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>
§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> FunctionRequestInitAndTrigger<'info>
impl<'info> FunctionRequestInitAndTrigger<'info>
pub fn get_instruction( &self, program_id: Pubkey, params: FunctionRequestInitAndTriggerParams ) -> Result<Instruction>
sourcepub fn invoke(
&self,
program: AccountInfo<'info>,
bounty: Option<u64>,
slots_until_expiration: Option<u64>,
max_container_params_len: Option<u32>,
container_params: Option<Vec<u8>>,
garbage_collection_slot: Option<u64>,
valid_after_slot: Option<u64>
) -> ProgramResult
pub fn invoke( &self, program: AccountInfo<'info>, bounty: Option<u64>, slots_until_expiration: Option<u64>, max_container_params_len: Option<u32>, container_params: Option<Vec<u8>>, garbage_collection_slot: Option<u64>, valid_after_slot: Option<u64> ) -> ProgramResult
Invokes the instruction.
§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.
-
bounty
: An optional fee to reward oracles for priority processing.- Default: 0 lamports.
-
slots_until_expiration
: An optional specification for the max number of slots the request can be processed in.- Default: 2250 slots (roughly 15 minutes at 400 ms/slot).
- Minimum: 150 slots (approximately 1 minute at 400 ms/slot).
-
valid_after_slot
: Schedule when the request should be valid for processing.- Default: 0 slots, meaning the request is valid immediately for oracles to process.
§Returns
ProgramResult
: Indicates the result of the instruction execution.
sourcepub fn invoke_signed(
&self,
program: AccountInfo<'info>,
bounty: Option<u64>,
slots_until_expiration: Option<u64>,
max_container_params_len: Option<u32>,
container_params: Option<Vec<u8>>,
garbage_collection_slot: Option<u64>,
valid_after_slot: Option<u64>,
signer_seeds: &[&[&[u8]]]
) -> ProgramResult
pub fn invoke_signed( &self, program: AccountInfo<'info>, bounty: Option<u64>, slots_until_expiration: Option<u64>, max_container_params_len: Option<u32>, container_params: Option<Vec<u8>>, garbage_collection_slot: Option<u64>, valid_after_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.
-
bounty
: An optional fee to reward oracles for priority processing.- Default: 0 lamports.
-
slots_until_expiration
: An optional specification for the max number of slots the request can be processed in.- Default: 2250 slots (roughly 15 minutes at 400 ms/slot).
- Minimum: 150 slots (approximately 1 minute at 400 ms/slot).
-
valid_after_slot
: Schedule when the request should be valid for processing.- Default: 0 slots, meaning the request is valid immediately for oracles to process.
-
signer_seeds
: Seeds used for signing.
§Returns
ProgramResult
: Indicates the result of the instruction execution.
pub fn build_ix( accounts: &FunctionRequestInitAndTriggerAccounts, params: &FunctionRequestInitAndTriggerParams ) -> Result<Instruction, SbError>
Trait Implementations§
source§impl<'info> Accounts<'info, FunctionRequestInitAndTriggerBumps> for FunctionRequestInitAndTrigger<'info>where
'info: 'info,
impl<'info> Accounts<'info, FunctionRequestInitAndTriggerBumps> for FunctionRequestInitAndTrigger<'info>where
'info: 'info,
source§fn try_accounts(
__program_id: &Pubkey,
__accounts: &mut &'info [AccountInfo<'info>],
__ix_data: &[u8],
__bumps: &mut FunctionRequestInitAndTriggerBumps,
__reallocs: &mut BTreeSet<Pubkey>
) -> Result<Self>
fn try_accounts( __program_id: &Pubkey, __accounts: &mut &'info [AccountInfo<'info>], __ix_data: &[u8], __bumps: &mut FunctionRequestInitAndTriggerBumps, __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 FunctionRequestInitAndTrigger<'info>where
'info: 'info,
impl<'info> AccountsExit<'info> for FunctionRequestInitAndTrigger<'info>where
'info: 'info,
source§impl<'info> Bumps for FunctionRequestInitAndTrigger<'info>where
'info: 'info,
impl<'info> Bumps for FunctionRequestInitAndTrigger<'info>where
'info: 'info,
§type Bumps = FunctionRequestInitAndTriggerBumps
type Bumps = FunctionRequestInitAndTriggerBumps
source§impl Discriminator for FunctionRequestInitAndTrigger<'_>
impl Discriminator for FunctionRequestInitAndTrigger<'_>
const DISCRIMINATOR: [u8; 8] = _
fn discriminator() -> [u8; 8]
source§impl<'info> ToAccountInfos<'info> for FunctionRequestInitAndTrigger<'info>where
'info: 'info,
impl<'info> ToAccountInfos<'info> for FunctionRequestInitAndTrigger<'info>where
'info: 'info,
fn to_account_infos(&self) -> Vec<AccountInfo<'info>>
source§impl<'info> ToAccountMetas for FunctionRequestInitAndTrigger<'info>
impl<'info> ToAccountMetas for FunctionRequestInitAndTrigger<'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.