pub struct OrdersService { /* private fields */ }Implementations§
Source§impl OrdersService
impl OrdersService
pub fn new(ctx: ServiceContext) -> Self
pub async fn list_open(&self, subaccount_id: Option<u64>) -> Result<OrdersList>
pub async fn list_open_with( &self, opts: ListOpenOrdersOpts, ) -> Result<OrdersList>
pub async fn list_history( &self, subaccount_id: Option<u64>, limit: Option<u32>, ) -> Result<OrdersList>
pub async fn list_history_with( &self, opts: ListOrderHistoryOpts, ) -> Result<OrdersList>
pub async fn get( &self, key: OrderKey, subaccount_id: Option<u64>, ) -> Result<GetOrderResult>
pub async fn get_with(&self, opts: GetOrderOpts) -> Result<GetOrderResult>
Sourcepub async fn wait_for_order_trades_complete(
&self,
key: OrderKey,
timeout: Duration,
) -> Result<GetOrderResult>
pub async fn wait_for_order_trades_complete( &self, key: OrderKey, timeout: Duration, ) -> Result<GetOrderResult>
Poll Self::get until the order is terminal and projected trade
quantities sum to order cum_qty.
GetOrder can report cum_qty before every fill is visible on the trades
list. Prefer this helper after fills
instead of treating a single get as final trade projection.
Sourcepub async fn create(
&self,
params: CreateOrderParams,
) -> Result<OrderMutationResult>
pub async fn create( &self, params: CreateOrderParams, ) -> Result<OrderMutationResult>
Place an order. Quantity and price must be Quantity / Price wrappers.
Sourcepub async fn preview(
&self,
params: PreviewOrderParams,
) -> Result<PreviewOrderResult>
pub async fn preview( &self, params: PreviewOrderParams, ) -> Result<PreviewOrderResult>
Check whether an order intent is currently admissible without submitting it.
Returns admission status, optional typed rejection detail, and any sizing / protected price-bound values resolved during evaluation. A preview is advisory; account, market, and policy inputs may change, and create always evaluates the intent again.
Sourcepub async fn batch_create(
&self,
items: Vec<CreateOrderParams>,
subaccount_id: Option<u64>,
request_id: Option<String>,
) -> Result<BatchCreateOrdersResult>
pub async fn batch_create( &self, items: Vec<CreateOrderParams>, subaccount_id: Option<u64>, request_id: Option<String>, ) -> Result<BatchCreateOrdersResult>
Batch-create orders.
A request_id is generated when omitted (TypeScript/Go/Python parity). Provide a stable
non-empty value when retrying the same logical batch — omitting it on retry mints a new id.
Sourcepub async fn batch_cancel(
&self,
items: Vec<BatchCancelItem>,
subaccount_id: Option<u64>,
request_id: Option<String>,
) -> Result<BatchCancelOrdersResult>
pub async fn batch_cancel( &self, items: Vec<BatchCancelItem>, subaccount_id: Option<u64>, request_id: Option<String>, ) -> Result<BatchCancelOrdersResult>
Batch-cancel orders.
A request_id is generated when omitted (TypeScript/Go/Python parity). Provide a stable
non-empty value when retrying the same logical batch — omitting it on retry mints a new id.
Sourcepub async fn batch_replace(
&self,
items: Vec<BatchReplaceItem>,
symbol: &str,
subaccount_id: Option<u64>,
request_id: Option<String>,
) -> Result<BatchReplaceOrdersResult>
pub async fn batch_replace( &self, items: Vec<BatchReplaceItem>, symbol: &str, subaccount_id: Option<u64>, request_id: Option<String>, ) -> Result<BatchReplaceOrdersResult>
Replace multiple same-symbol orders and return their admission receipt.
Poll Self::get_batch_replace_status using the returned
batch_request_id for recoverable execution finality.
Sourcepub async fn get_batch_replace_status(
&self,
batch_request_id: &str,
subaccount_id: Option<u64>,
) -> Result<BatchReplaceStatusResult>
pub async fn get_batch_replace_status( &self, batch_request_id: &str, subaccount_id: Option<u64>, ) -> Result<BatchReplaceStatusResult>
Get durable execution status for an admitted batch replacement.
Sourcepub async fn cancel_all_after(
&self,
timeout_sec: u32,
symbol: Option<&str>,
subaccount_id: Option<u64>,
request_id: Option<String>,
) -> Result<CancelAllAfterResult>
pub async fn cancel_all_after( &self, timeout_sec: u32, symbol: Option<&str>, subaccount_id: Option<u64>, request_id: Option<String>, ) -> Result<CancelAllAfterResult>
Schedules cancel-all-after for the account scope.
A request_id is generated when omitted (TypeScript/Go/Python parity). Provide a stable
non-empty value when retrying the same logical cancel-all-after.
pub async fn cancel( &self, req: CancelOrderRequest, ) -> Result<OrderMutationResult>
pub async fn cancel_with( &self, params: CancelOrderParams, ) -> Result<OrderMutationResult>
pub async fn cancel_by_client_order_id( &self, client_order_id: &str, symbol: Option<&str>, subaccount_id: Option<u64>, ) -> Result<OrderMutationResult>
pub async fn cancel_by_order_id( &self, order_id: &str, subaccount_id: Option<u64>, ) -> Result<OrderMutationResult>
Sourcepub async fn cancel_all(
&self,
symbol: Option<&str>,
dry_run: bool,
subaccount_id: Option<u64>,
) -> Result<CancelAllOrdersResult>
pub async fn cancel_all( &self, symbol: Option<&str>, dry_run: bool, subaccount_id: Option<u64>, ) -> Result<CancelAllOrdersResult>
Cancels all matching open orders for the account scope (optional symbol / dry-run).
A request_id is generated when omitted (TypeScript/Go/Python parity). Provide a stable
non-empty value via [cancel_all_with] when retrying the same logical bulk cancellation.
Sourcepub async fn cancel_all_with(
&self,
opts: CancelAllOpts,
) -> Result<CancelAllOrdersResult>
pub async fn cancel_all_with( &self, opts: CancelAllOpts, ) -> Result<CancelAllOrdersResult>
Cancels all matching open orders with full options.
A request_id is generated when omitted or blank. Provide a stable non-empty value when
retrying the same logical bulk cancellation.
Sourcepub async fn modify(
&self,
params: ModifyOrderParams,
) -> Result<ModifyOrderResult>
pub async fn modify( &self, params: ModifyOrderParams, ) -> Result<ModifyOrderResult>
Modify an order. new_price / new_qty must be Price / Quantity wrappers.
A request_id is generated when omitted (TypeScript/Go/Python parity). Provide a stable
non-empty value when retrying the same logical modification — omitting it on retry mints a
new id and is not an idempotent replay.
pub fn create_params( symbol: impl Into<String>, side: CreateSide, order_type: CreateOrderType, quantity: Quantity, price: Option<Price>, client_order_id: Option<&str>, ) -> CreateOrderParams
Trait Implementations§
Source§impl Clone for OrdersService
impl Clone for OrdersService
Source§fn clone(&self) -> OrdersService
fn clone(&self) -> OrdersService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more