pub struct DeriveWsExecutionHandle { /* private fields */ }Expand description
Cloneable handle for issuing signed private/* trading requests over the
WebSocket transport.
Carries the same cmd_tx the owning DeriveWebSocketClient swaps on
connect/reconnect, so a handle obtained at construction stays valid for the
client’s lifetime. The handle is transport-only: it sends the pre-signed
body and surfaces the venue’s JSON-RPC outcome. Session authorization is the
client’s responsibility (via public/login).
Implementations§
Source§impl DeriveWsExecutionHandle
impl DeriveWsExecutionHandle
Sourcepub fn conn_id(&self) -> String
pub fn conn_id(&self) -> String
Returns the current WebSocket connection id used by trigger orders.
Sourcepub async fn submit_order(
&self,
params: &DeriveOrderParams,
) -> Result<DeriveOrder>
pub async fn submit_order( &self, params: &DeriveOrderParams, ) -> Result<DeriveOrder>
Submits a signed order via private/order.
params must be the fully-built signed body from
crate::http::query::order_to_derive_payload. Returns the accepted
order echoed by the venue.
§Errors
Returns DeriveWsError::JsonRpc for venue rejections and
DeriveWsError::Transport / DeriveWsError::Timeout when the
outcome is ambiguous.
Sourcepub async fn submit_trigger_order(
&self,
params: &DeriveTriggerOrderParams,
) -> Result<DeriveOrder>
pub async fn submit_trigger_order( &self, params: &DeriveTriggerOrderParams, ) -> Result<DeriveOrder>
Submits a signed trigger order via private/trigger_order.
§Errors
Returns DeriveWsError::JsonRpc for venue rejections and
DeriveWsError::Transport / DeriveWsError::Timeout when the
outcome is ambiguous.
Sourcepub async fn modify_order(
&self,
params: &DeriveReplaceParams,
) -> Result<DeriveOrder>
pub async fn modify_order( &self, params: &DeriveReplaceParams, ) -> Result<DeriveOrder>
Modifies a working order by atomically cancelling it and submitting a
replacement (the venue’s private/replace). Returns the new order
echoed by the venue.
§Errors
Returns DeriveWsError::JsonRpc for venue rejections and
DeriveWsError::Transport / DeriveWsError::Timeout when the
outcome is ambiguous.
Sourcepub async fn cancel_order(&self, params: &DeriveCancelParams) -> Result<()>
pub async fn cancel_order(&self, params: &DeriveCancelParams) -> Result<()>
Cancels a single order via private/cancel.
§Errors
Returns DeriveWsError::JsonRpc for venue rejections and
DeriveWsError::Transport / DeriveWsError::Timeout when the
outcome is ambiguous.
Sourcepub async fn cancel_trigger_order(
&self,
params: &DeriveCancelTriggerOrderParams,
) -> Result<DeriveOrder>
pub async fn cancel_trigger_order( &self, params: &DeriveCancelTriggerOrderParams, ) -> Result<DeriveOrder>
Cancels a single trigger order via private/cancel_trigger_order.
§Errors
Returns DeriveWsError::JsonRpc for venue rejections and
DeriveWsError::Transport / DeriveWsError::Timeout when the
outcome is ambiguous.
Sourcepub async fn get_trigger_orders(
&self,
params: &DeriveGetTriggerOrdersParams,
) -> Result<DeriveOpenOrdersResult>
pub async fn get_trigger_orders( &self, params: &DeriveGetTriggerOrdersParams, ) -> Result<DeriveOpenOrdersResult>
Returns currently untriggered trigger orders via
private/get_trigger_orders.
§Errors
Returns DeriveWsError::JsonRpc for venue rejections and
DeriveWsError::Transport / DeriveWsError::Timeout when the
outcome is ambiguous.
Sourcepub async fn cancel_all_orders(
&self,
params: &DeriveCancelAllParams,
) -> Result<()>
pub async fn cancel_all_orders( &self, params: &DeriveCancelAllParams, ) -> Result<()>
Cancels every open order on the subaccount (the venue’s
private/cancel_all), optionally scoped to an instrument.
§Errors
Returns DeriveWsError::JsonRpc for venue rejections and
DeriveWsError::Transport / DeriveWsError::Timeout when the
outcome is ambiguous.
Trait Implementations§
Source§impl Clone for DeriveWsExecutionHandle
impl Clone for DeriveWsExecutionHandle
Source§fn clone(&self) -> DeriveWsExecutionHandle
fn clone(&self) -> DeriveWsExecutionHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for DeriveWsExecutionHandle
impl !UnwindSafe for DeriveWsExecutionHandle
impl Freeze for DeriveWsExecutionHandle
impl Send for DeriveWsExecutionHandle
impl Sync for DeriveWsExecutionHandle
impl Unpin for DeriveWsExecutionHandle
impl UnsafeUnpin for DeriveWsExecutionHandle
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
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,
§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>
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>
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