Skip to main content

BeginSettle

Struct BeginSettle 

Source
pub struct BeginSettle<'a> {
    pub program_id: Pubkey,
    pub state_pda: Pubkey,
    pub finalize_ix_index: u16,
    pub auction_id: i64,
    pub order_pdas: &'a [Pubkey],
    pub sell_token_accounts: &'a [Pubkey],
    pub pulls: &'a [&'a [Pull]],
}
Expand description

Builder for a BeginSettle instruction settling the orders described by the parallel lists:

  • order_pdas[i] is the canonical order PDA (see crate::pda::order)
  • sell_token_accounts[i] is the order’s sell token account,
  • pulls[i] the list of Pulls to perform from that order’s sell token account, each sending an amount from the i-th order sell token account to a destination.

The slices are assumed to have the same length but this is not enforced in the builder.

Wire format (grouped, with n orders and T total transfers): [discriminator=0][finalize_ix_index: u16 LE][auction_id: i64 LE][n: u8] [transfer_count×n][amount: u64 LE ×T]. Required accounts: [instructions_sysvar (R), state_pda (R), token_program (R)] followed, per order, by [order_pda (W), sell_token_account (W), destination (W)...].

The program requires the order PDAs to be strictly increasing by address. This builder establishes that ordering for the caller: it sorts the orders by PDA address, carrying each order’s sell token account, transfer count, amounts, and destination metas before emitting them.

Fields§

§program_id: Pubkey§state_pda: Pubkey§finalize_ix_index: u16§auction_id: i64

The off-chain auction this settlement executes. Carried in the instruction data so the settlement can be tied back to its auction off-chain, unused on-chain.

§order_pdas: &'a [Pubkey]§sell_token_accounts: &'a [Pubkey]§pulls: &'a [&'a [Pull]]

Trait Implementations§

Source§

impl From<BeginSettle<'_>> for Instruction

Source§

fn from(builder: BeginSettle<'_>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for BeginSettle<'a>

§

impl<'a> RefUnwindSafe for BeginSettle<'a>

§

impl<'a> Send for BeginSettle<'a>

§

impl<'a> Sync for BeginSettle<'a>

§

impl<'a> Unpin for BeginSettle<'a>

§

impl<'a> UnsafeUnpin for BeginSettle<'a>

§

impl<'a> UnwindSafe for BeginSettle<'a>

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

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.