Skip to main content

CreateSelfOrder

Struct CreateSelfOrder 

Source
pub struct CreateSelfOrder {
    pub program_id: Pubkey,
    pub authority: Pubkey,
    pub created_by: Pubkey,
    pub state_pda: Pubkey,
    pub order_pda: Pubkey,
    pub intent_bytes: [u8; 213],
}
Expand description

Builder for a CreateSelfOrder instruction.

Allocates an order PDA for an order owned by the settlement state PDA, so the fees that accumulate in the buffer accounts can be sold through a regular settlement.

Similar to CreateOrder, but the instruction is gated by the SelfOrderAuthority, and doesn’t need the owner’s signature. The program forces intent.owner to be the state PDA. The order this function created is a normal order and settles through the standard BeginSettle/FinalizeSettle flow.

The only enforced parameters are created_on_chain (should be true) and the owner (should be the state PDA).

created_by funds the new order PDA’s rent and will get the rent back when executing ReclaimOrder.

Wire format: [discriminator=10, ..intent bytes], 1 + EncodedOrderIntent::SIZE bytes. Required accounts: [authority (S), created_by (W,S), state_pda (R), order_pda (W), system_program (R)].

Fields§

§program_id: Pubkey§authority: Pubkey§created_by: Pubkey§state_pda: Pubkey§order_pda: Pubkey§intent_bytes: [u8; 213]

Trait Implementations§

Source§

impl From<CreateSelfOrder> for Instruction

Source§

fn from(builder: CreateSelfOrder) -> 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.