Skip to main content

CreateShift

Struct CreateShift 

Source
pub struct CreateShift {
    pub program: StoreProgram,
    pub payer: StringPubkey,
    pub receiver: Option<StringPubkey>,
    pub nonce: Option<NonceBytes>,
    pub from_market_token: StringPubkey,
    pub from_market_token_account: Option<StringPubkey>,
    pub to_market_token: StringPubkey,
    pub execution_lamports: u64,
    pub from_market_token_amount: u64,
    pub min_to_market_token_amount: u64,
    pub skip_to_market_token_ata_creation: bool,
}
Expand description

Builder for the create_shift instruction.

Fields§

§program: StoreProgram

Program.

§payer: StringPubkey

Payer (a.k.a. owner).

§receiver: Option<StringPubkey>

Reciever.

§nonce: Option<NonceBytes>

Nonce for the shift.

§from_market_token: StringPubkey

The from-market token.

§from_market_token_account: Option<StringPubkey>

From-market token account.

§to_market_token: StringPubkey

The to-market token.

§execution_lamports: u64

Execution fee paid to the keeper in lamports.

§from_market_token_amount: u64

From-market token amount to pay.

§min_to_market_token_amount: u64

Minimum to-market token amount to receive.

§skip_to_market_token_ata_creation: bool

Whether to skip the creation of to-market token ATA.

Implementations§

Source§

impl CreateShift

Source

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

Create a builder for building CreateShift. On the builder, call .program(...)(optional), .payer(...), .receiver(...)(optional), .nonce(...)(optional), .from_market_token(...), .from_market_token_account(...)(optional), .to_market_token(...), .execution_lamports(...)(optional), .from_market_token_amount(...)(optional), .min_to_market_token_amount(...)(optional), .skip_to_market_token_ata_creation(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of CreateShift.

Trait Implementations§

Source§

impl Clone for CreateShift

Source§

fn clone(&self) -> CreateShift

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 CreateShift

Source§

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

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

impl<'de> Deserialize<'de> for CreateShift

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 FromWasmAbi for CreateShift
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 CreateShift

Source§

type Hint = ()

Hint.
Source§

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

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 CreateShift

Source§

fn market_token(&self) -> &Pubkey

Returns market token.
Source§

impl OptionFromWasmAbi for CreateShift
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 CreateShift
where Self: DeserializeOwned,

Source§

type Abi = <JsType as RefFromWasmAbi>::Abi

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

type Anchor = SelfOwner<CreateShift>

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 CreateShift

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 CreateShift

Source§

impl Tsify for CreateShift

Source§

const DECL: &'static str = "/**\n * Builder for the `create_shift` instruction.\n */\nexport interface CreateShift {\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 shift.\n */\n nonce?: NonceBytes | undefined;\n /**\n * The from-market token.\n */\n from_market_token: StringPubkey;\n /**\n * From-market token account.\n */\n from_market_token_account?: StringPubkey | undefined;\n /**\n * The to-market token.\n */\n to_market_token: StringPubkey;\n /**\n * Execution fee paid to the keeper in lamports.\n */\n execution_lamports?: number;\n /**\n * From-market token amount to pay.\n */\n from_market_token_amount?: number;\n /**\n * Minimum to-market token amount to receive.\n */\n min_to_market_token_amount?: number;\n /**\n * Whether to skip the creation of to-market token ATA.\n */\n skip_to_market_token_ata_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 CreateShift
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 CreateShift

Source§

impl WasmDescribeVector for CreateShift

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,