pub struct CreateOrderBuilder<'a, C> { /* private fields */ }
Expand description
Create Order Builder.
Implementations§
Source§impl<'a, C, S> CreateOrderBuilder<'a, C>
impl<'a, C, S> CreateOrderBuilder<'a, C>
Sourcepub fn nonce(&mut self, nonce: NonceBytes) -> &mut Self
pub fn nonce(&mut self, nonce: NonceBytes) -> &mut Self
Set the nonce.
Sourcepub fn execution_fee(&mut self, amount: u64) -> &mut Self
pub fn execution_fee(&mut self, amount: u64) -> &mut Self
Set extra exectuion fee allowed to use.
Defaults to 0
means only allowed to use at most rent-exempt
amount of fee.
Sourcepub fn hint(&mut self, meta: &MarketMeta) -> &mut Self
pub fn hint(&mut self, meta: &MarketMeta) -> &mut Self
Setup hint with the given market meta.
Sourcepub fn decrease_position_swap_type(
&mut self,
ty: Option<DecreasePositionSwapType>,
) -> &mut Self
pub fn decrease_position_swap_type( &mut self, ty: Option<DecreasePositionSwapType>, ) -> &mut Self
Set decrease position swap type.
Sourcepub fn initial_collateral_token(
&mut self,
token: &Pubkey,
token_account: Option<&Pubkey>,
) -> &mut Self
pub fn initial_collateral_token( &mut self, token: &Pubkey, token_account: Option<&Pubkey>, ) -> &mut Self
Set initial collateral token (or swap-in token) params.
Sourcepub fn final_output_token(&mut self, token: &Pubkey) -> &mut Self
pub fn final_output_token(&mut self, token: &Pubkey) -> &mut Self
Set final output token params (position order only).
Sourcepub fn long_token_account(&mut self, account: &Pubkey) -> &mut Self
pub fn long_token_account(&mut self, account: &Pubkey) -> &mut Self
Set long token account.
Sourcepub fn short_token_account(&mut self, account: &Pubkey) -> &mut Self
pub fn short_token_account(&mut self, account: &Pubkey) -> &mut Self
Set short token account.
Sourcepub fn min_output_amount(&mut self, amount: u128) -> &mut Self
pub fn min_output_amount(&mut self, amount: u128) -> &mut Self
Set min output amount.
Sourcepub fn acceptable_price(&mut self, unit_price: u128) -> &mut Self
pub fn acceptable_price(&mut self, unit_price: u128) -> &mut Self
Set acceptable price.
Sourcepub fn valid_from_ts(&mut self, ts: i64) -> &mut Self
pub fn valid_from_ts(&mut self, ts: i64) -> &mut Self
Set valid from ts.
Sourcepub fn should_unwrap_native_token(&mut self, should_unwrap: bool) -> &mut Self
pub fn should_unwrap_native_token(&mut self, should_unwrap: bool) -> &mut Self
Set whether to unwrap native token. Defaults to should unwrap.
Sourcepub async fn build_with_address(
&mut self,
) -> Result<(TransactionBuilder<'a, C>, Pubkey)>
pub async fn build_with_address( &mut self, ) -> Result<(TransactionBuilder<'a, C>, Pubkey)>
Create TransactionBuilder
and return order address.
Sourcepub async fn build_with_addresses(
&mut self,
) -> Result<(TransactionBuilder<'a, C>, Pubkey, Option<Pubkey>)>
pub async fn build_with_addresses( &mut self, ) -> Result<(TransactionBuilder<'a, C>, Pubkey, Option<Pubkey>)>
Create TransactionBuilder
and return order address and optional position address.
Auto Trait Implementations§
impl<'a, C> Freeze for CreateOrderBuilder<'a, C>
impl<'a, C> !RefUnwindSafe for CreateOrderBuilder<'a, C>
impl<'a, C> Send for CreateOrderBuilder<'a, C>
impl<'a, C> Sync for CreateOrderBuilder<'a, C>
impl<'a, C> Unpin for CreateOrderBuilder<'a, C>
impl<'a, C> !UnwindSafe for CreateOrderBuilder<'a, C>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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