Skip to main content

CreateOrder

Struct CreateOrder 

Source
pub struct CreateOrder {
Show 16 fields pub program: StoreProgram, pub payer: StringPubkey, pub receiver: Option<StringPubkey>, pub nonce: Option<NonceBytes>, pub execution_lamports: u64, pub kind: CreateOrderKind, pub collateral_or_swap_out_token: StringPubkey, pub params: CreateOrderParams, pub pay_token: Option<StringPubkey>, pub pay_token_account: Option<StringPubkey>, pub receive_token: Option<StringPubkey>, pub swap_path: Vec<StringPubkey>, pub unwrap_native_on_receive: bool, pub callback: Option<Callback>, pub skip_position_creation: bool, pub force_position_creation: bool,
}
Expand description

Builder for the create_order instruction.

Fields§

§program: StoreProgram

Program.

§payer: StringPubkey

Payer (a.k.a. owner).

§receiver: Option<StringPubkey>

Reciever.

§nonce: Option<NonceBytes>

Nonce for the order.

§execution_lamports: u64

Execution fee paid to the keeper in lamports.

§kind: CreateOrderKind

Order Kind.

§collateral_or_swap_out_token: StringPubkey

Collateral or swap out token.

§params: CreateOrderParams

Order Parameters.

§pay_token: Option<StringPubkey>

Pay token.

§pay_token_account: Option<StringPubkey>

Pay token account.

§receive_token: Option<StringPubkey>

Receive token.

§swap_path: Vec<StringPubkey>

Swap path.

§unwrap_native_on_receive: bool

Whether to unwrap the native token when receiving (e.g., convert WSOL to SOL).

§callback: Option<Callback>

Callback.

§skip_position_creation: bool

Whether to skip position account creation.

§force_position_creation: bool

Whether to force position account creation.

Implementations§

Source§

impl CreateOrder

Source

pub fn builder() -> CreateOrderBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>

Create a builder for building CreateOrder. On the builder, call .program(...)(optional), .payer(...), .receiver(...)(optional), .nonce(...)(optional), .execution_lamports(...)(optional), .kind(...), .collateral_or_swap_out_token(...), .params(...), .pay_token(...)(optional), .pay_token_account(...)(optional), .receive_token(...)(optional), .swap_path(...)(optional), .unwrap_native_on_receive(...)(optional), .callback(...)(optional), .skip_position_creation(...)(optional), .force_position_creation(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of CreateOrder.

Trait Implementations§

Source§

impl Clone for CreateOrder

Source§

fn clone(&self) -> CreateOrder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CreateOrder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CreateOrder

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl FromRpcClientWith<CreateOrder> for CreateOrderHint

Source§

async fn from_rpc_client_with<'a>( builder: &'a CreateOrder, client: &'a impl RpcClient, ) -> Result<Self>

Create from RpcClient.
Source§

impl FromWasmAbi for CreateOrder
where Self: DeserializeOwned,

Source§

type Abi = <JsType as FromWasmAbi>::Abi

The Wasm ABI type that this converts from when coming back out from the ABI boundary.
Source§

unsafe fn from_abi(js: Self::Abi) -> Self

Recover a Self from Self::Abi. Read more
Source§

impl IntoAtomicGroup for CreateOrder

Source§

type Hint = CreateOrderHint

Hint.
Source§

fn into_atomic_group( self, hint: &Self::Hint, ) -> Result<AtomicGroup, SolanaUtilsError>

Convert into an AtomicGroup.
Source§

fn into_atomic_group_with_rpc_client( self, client: &impl RpcClient, ) -> impl Future<Output = Result<AtomicGroup, Error>>
where Self: Sized, Self::Hint: FromRpcClientWith<Self>,

Available on client_traits only.
Convert into an AtomicGroup with RPC client.
Source§

impl MarketTokenIxBuilder for CreateOrder

Source§

fn market_token(&self) -> &Pubkey

Returns market token.
Source§

impl OptionFromWasmAbi for CreateOrder
where Self: DeserializeOwned,

Source§

fn is_none(js: &Self::Abi) -> bool

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi.
Source§

impl RefFromWasmAbi for CreateOrder
where Self: DeserializeOwned,

Source§

type Abi = <JsType as RefFromWasmAbi>::Abi

The Wasm ABI type references to Self are recovered from.
Source§

type Anchor = SelfOwner<CreateOrder>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous.
Source§

unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

Recover a Self::Anchor from Self::Abi. Read more
Source§

impl Serialize for CreateOrder

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StoreProgramIxBuilder for CreateOrder

Source§

impl Tsify for CreateOrder

Source§

const DECL: &'static str = "/**\n * Builder for the `create_order` instruction.\n */\nexport interface CreateOrder {\n /**\n * Program.\n */\n program?: StoreProgram;\n /**\n * Payer (a.k.a. owner).\n */\n payer: StringPubkey;\n /**\n * Reciever.\n */\n receiver?: StringPubkey | undefined;\n /**\n * Nonce for the order.\n */\n nonce?: NonceBytes | undefined;\n /**\n * Execution fee paid to the keeper in lamports.\n */\n execution_lamports?: number;\n /**\n * Order Kind.\n */\n kind: CreateOrderKind;\n /**\n * Collateral or swap out token.\n */\n collateral_or_swap_out_token: StringPubkey;\n /**\n * Order Parameters.\n */\n params: CreateOrderParams;\n /**\n * Pay token.\n */\n pay_token?: StringPubkey | undefined;\n /**\n * Pay token account.\n */\n pay_token_account?: StringPubkey | undefined;\n /**\n * Receive token.\n */\n receive_token?: StringPubkey | undefined;\n /**\n * Swap path.\n */\n swap_path?: StringPubkey[];\n /**\n * Whether to unwrap the native token when receiving (e.g., convert WSOL to SOL).\n */\n unwrap_native_on_receive?: boolean;\n /**\n * Callback.\n */\n callback?: Callback | undefined;\n /**\n * Whether to skip position account creation.\n */\n skip_position_creation?: boolean;\n /**\n * Whether to force position account creation.\n */\n force_position_creation?: boolean;\n}"

Source§

const SERIALIZATION_CONFIG: SerializationConfig

Source§

type JsType = JsType

Available on crate feature wasm-bindgen only.
Source§

fn into_js(&self) -> Result<Self::JsType, Error>
where Self: Serialize,

Available on crate feature js only.
Source§

fn from_js<T>(js: T) -> Result<Self, Error>
where T: Into<JsValue>, Self: DeserializeOwned,

Available on crate feature js only.
Source§

impl VectorFromWasmAbi for CreateOrder
where Self: DeserializeOwned,

Source§

type Abi = <JsType as VectorFromWasmAbi>::Abi

Source§

unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>

Source§

impl WasmDescribe for CreateOrder

Source§

impl WasmDescribeVector for CreateOrder

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

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

Source§

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

Source§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

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

Source§

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,