Skip to main content

Initialize

Struct Initialize 

Source
pub struct Initialize {
    pub program_id: Pubkey,
    pub payer: Pubkey,
    pub state_pda: Pubkey,
    pub native_sol_buffer: Pubkey,
    pub manager: Pubkey,
    pub solver_authority: Pubkey,
    pub reclaim_authority: Pubkey,
    pub settlement_owned_order_authority: Pubkey,
}
Expand description

Builder for an Initialize instruction.

payer funds the new accounts’ rent and signs. It must be INITIALIZER. It is meant to be the transaction’s fee payer: the state is created once at deployment and never deallocated, so there’s no need for a dedicated funding account separate from whoever pays for the deployment transaction.

state_pda must be crate::pda::state::STATE_PDA and native_sol_buffer must be crate::pda::buffer::NATIVE_SOL_BUFFER_PDA; the program rejects any other address.

All data input accounts are recorded verbatim in the state PDA’s data: the account authorized to transfer any role, the account authorized to add and remove solvers, the account authorized to reclaim rent for buffers, and the account authorized to place settlement-owned orders. See crate::data::state::StateAccount.

Both accounts are owned by the settlement program; the native SOL buffer holds no data. This instruction succeeds only once: a second call fails because the accounts already exist.

Wire format: [discriminator=3, manager (32 bytes), solver_authority (32 bytes), reclaim_authority (32 bytes), settlement_owned_order_authority (32 bytes)], 129 bytes. Required accounts: [payer (W,S), state_pda (W), native_sol_buffer (W), system_program (R)]. The system program must be available for the CreateAccount CPI but doesn’t need to sit at that specific position.

Fields§

§program_id: Pubkey§payer: Pubkey§state_pda: Pubkey§native_sol_buffer: Pubkey§manager: Pubkey§solver_authority: Pubkey§reclaim_authority: Pubkey§settlement_owned_order_authority: Pubkey

Trait Implementations§

Source§

impl From<Initialize> for Instruction

Source§

fn from(builder: Initialize) -> Self

Converts to this type from the input type.

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.