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>§authority: AccountInfo<'info>§function: AccountInfo<'info>§function_authority: Option<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>

source

pub fn get_instruction( &self, program_id: Pubkey, params: FunctionRequestInitAndTriggerParams ) -> Result<Instruction>

source

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.
source

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.
source

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,

source§

fn try_accounts( __program_id: &Pubkey, __accounts: &mut &'info [AccountInfo<'info>], __ix_data: &[u8], __bumps: &mut FunctionRequestInitAndTriggerBumps, __reallocs: &mut BTreeSet<Pubkey> ) -> Result<Self>

Returns the validated accounts struct. What constitutes “valid” is program dependent. However, users of these types should never have to worry about account substitution attacks. For example, if a program expects a 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 more
source§

impl<'info> AccountsExit<'info> for FunctionRequestInitAndTrigger<'info>
where 'info: 'info,

source§

fn exit(&self, program_id: &Pubkey) -> Result<()>

program_id is the currently executing program.
source§

impl<'info> Bumps for FunctionRequestInitAndTrigger<'info>
where 'info: 'info,

§

type Bumps = FunctionRequestInitAndTriggerBumps

Struct to hold account bump seeds.
source§

impl Discriminator for FunctionRequestInitAndTrigger<'_>

source§

const DISCRIMINATOR: [u8; 8] = _

§

fn discriminator() -> [u8; 8]

source§

impl<'info> ToAccountInfos<'info> for FunctionRequestInitAndTrigger<'info>
where 'info: 'info,

source§

impl<'info> ToAccountMetas for FunctionRequestInitAndTrigger<'info>

source§

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.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more