pub struct OrderBuilder { /* private fields */ }Expand description
Order builder for creating and signing orders
Implementations§
Source§impl OrderBuilder
impl OrderBuilder
Sourcepub fn new(
signer: PrivateKeySigner,
sig_type: Option<SigType>,
funder: Option<Address>,
) -> Self
pub fn new( signer: PrivateKeySigner, sig_type: Option<SigType>, funder: Option<Address>, ) -> Self
Create a new order builder
Sourcepub fn get_sig_type(&self) -> u8
pub fn get_sig_type(&self) -> u8
Get signature type as u8
Sourcepub fn calculate_market_price(
&self,
positions: &[BookLevel],
amount_to_match: Decimal,
) -> Result<Decimal>
pub fn calculate_market_price( &self, positions: &[BookLevel], amount_to_match: Decimal, ) -> Result<Decimal>
Calculate market price from order book levels
Sourcepub fn create_market_order(
&self,
chain_id: u64,
order_args: &MarketOrderArgs,
price: Decimal,
extras: &ExtraOrderArgs,
options: &OrderOptions,
) -> Result<SignedOrderRequest>
pub fn create_market_order( &self, chain_id: u64, order_args: &MarketOrderArgs, price: Decimal, extras: &ExtraOrderArgs, options: &OrderOptions, ) -> Result<SignedOrderRequest>
Create a market order
Sourcepub fn create_order(
&self,
chain_id: u64,
order_args: &OrderArgs,
expiration: u64,
extras: &ExtraOrderArgs,
options: &OrderOptions,
) -> Result<SignedOrderRequest>
pub fn create_order( &self, chain_id: u64, order_args: &OrderArgs, expiration: u64, extras: &ExtraOrderArgs, options: &OrderOptions, ) -> Result<SignedOrderRequest>
Create a regular order
Auto Trait Implementations§
impl Freeze for OrderBuilder
impl RefUnwindSafe for OrderBuilder
impl Send for OrderBuilder
impl Sync for OrderBuilder
impl Unpin for OrderBuilder
impl UnwindSafe for OrderBuilder
Blanket Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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