pub struct OrdersClient<'a> { /* private fields */ }Expand description
Client for order operations on the OrderBook contract.
Implementations§
Source§impl<'a> OrdersClient<'a>
impl<'a> OrdersClient<'a>
Sourcepub async fn place(
&self,
market_id: u64,
params: &[OrderParam],
) -> Result<Vec<PlacedOrder>>
pub async fn place( &self, market_id: u64, params: &[OrderParam], ) -> Result<Vec<PlacedOrder>>
Place one or more orders on a market in a single transaction.
Uses placeOrders(marketId, OrderParam[]). Returns placed orders with
their assigned on-chain IDs (parsed from OrderPlaced events in the receipt).
Sourcepub async fn replace(
&self,
cancel_ids: &[U256],
market_id: u64,
params: &[OrderParam],
) -> Result<Vec<PlacedOrder>>
pub async fn replace( &self, cancel_ids: &[U256], market_id: u64, params: &[OrderParam], ) -> Result<Vec<PlacedOrder>>
Atomically cancel existing orders and place new ones via replaceOrders.
Single transaction: cancels happen first, then placements, with net USDT settlement. Zero empty-book time.
Sourcepub async fn cancel(&self, order_ids: &[U256]) -> Result<()>
pub async fn cancel(&self, order_ids: &[U256]) -> Result<()>
Cancel one or more orders in a single transaction via cancelOrders.
Skips already-cancelled orders on-chain (no revert).
Sourcepub async fn cancel_one(&self, order_id: U256) -> Result<()>
pub async fn cancel_one(&self, order_id: U256) -> Result<()>
Cancel a single order via cancelOrder.
Auto Trait Implementations§
impl<'a> Freeze for OrdersClient<'a>
impl<'a> !RefUnwindSafe for OrdersClient<'a>
impl<'a> Send for OrdersClient<'a>
impl<'a> Sync for OrdersClient<'a>
impl<'a> Unpin for OrdersClient<'a>
impl<'a> UnsafeUnpin for OrdersClient<'a>
impl<'a> !UnwindSafe for OrdersClient<'a>
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