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 prepare_order_path(
&self,
chain_id: u64,
token_id: impl Into<String>,
tick_size: Decimal,
neg_risk: bool,
builder_code: Option<&str>,
metadata: Option<&str>,
) -> Result<PreparedOrderPath>
pub fn prepare_order_path( &self, chain_id: u64, token_id: impl Into<String>, tick_size: Decimal, neg_risk: bool, builder_code: Option<&str>, metadata: Option<&str>, ) -> Result<PreparedOrderPath>
Prepare reusable order-path state for one market/token.
This caches tick-size rounding, exchange address parsing, token ID parsing, normalized bytes32 fields, and the EIP-712 domain. Use this for latency-sensitive repeated order creation on the same token.
Sourcepub fn calculate_market_price(
&self,
positions: &[BookLevel],
amount_to_match: Decimal,
side: Side,
order_type: OrderType,
) -> Result<Decimal>
pub fn calculate_market_price( &self, positions: &[BookLevel], amount_to_match: Decimal, side: Side, order_type: OrderType, ) -> Result<Decimal>
Calculate market price from order book levels
Sourcepub fn create_market_order(
&self,
chain_id: u64,
order_args: &MarketOrderArgs,
price: Decimal,
options: &CreateOrderOptions,
) -> Result<SignedOrderRequest>
pub fn create_market_order( &self, chain_id: u64, order_args: &MarketOrderArgs, price: Decimal, options: &CreateOrderOptions, ) -> Result<SignedOrderRequest>
Create a market order
Sourcepub fn create_order(
&self,
chain_id: u64,
order_args: &OrderArgs,
options: &CreateOrderOptions,
) -> Result<SignedOrderRequest>
pub fn create_order( &self, chain_id: u64, order_args: &OrderArgs, options: &CreateOrderOptions, ) -> Result<SignedOrderRequest>
Create a regular order
Trait Implementations§
Source§impl Clone for OrderBuilder
impl Clone for OrderBuilder
Source§fn clone(&self) -> OrderBuilder
fn clone(&self) -> OrderBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OrderBuilder
impl RefUnwindSafe for OrderBuilder
impl Send for OrderBuilder
impl Sync for OrderBuilder
impl Unpin for OrderBuilder
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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