pub struct OrderCommandStream { /* private fields */ }Expand description
Cloneable handle to one authenticated persistent order-command socket. Commands from clones are sequenced by a single writer task, so concurrent strategies cannot produce sequence gaps on the wire.
Implementations§
Source§impl OrderCommandStream
impl OrderCommandStream
pub fn market_id(&self) -> &str
pub fn owner_wallet(&self) -> &str
pub fn session_public_key(&self) -> &str
Sourcepub fn subscribe(&self) -> Receiver<PlatformOrderCommandEvent>
pub fn subscribe(&self) -> Receiver<PlatformOrderCommandEvent>
Subscribe to heartbeats, correlated command results, and pushed chain
confirmations. Lag is explicit through broadcast::RecvError::Lagged.
pub async fn command( &self, command: PlatformOrderCommand, ) -> Result<PlatformOrderCommandEvent, SdkError>
Sourcepub async fn probe(&self, nonce: &str) -> Result<(), SdkError>
pub async fn probe(&self, nonce: &str) -> Result<(), SdkError>
Authenticated non-trading round trip for health and latency measurement.
pub async fn challenge( &self, request: PlatformOrderChallengeRequest, self_trade_prevention: PlatformSelfTradePrevention, ) -> Result<OrderChallengeResult, SdkError>
Sourcepub async fn prepare(
&self,
request: PlatformOrderPrepareRequest,
) -> Result<PlatformOrderPrepareResponse, SdkError>
pub async fn prepare( &self, request: PlatformOrderPrepareRequest, ) -> Result<PlatformOrderPrepareResponse, SdkError>
Prepare an order-control transaction over the socket. Authorized
hands back a challenge; because this socket already authenticated the
session and the challenge is bound to it, authorization_signature may
be None (one signature: the session signs only the transaction).
Direct sends the operation itself.
pub async fn submit( &self, request: PlatformOrderSubmitRequest, ) -> Result<PlatformOrderSubmitResponse, SdkError>
pub async fn status( &self, request: PlatformOrderStatusRequest, ) -> Result<PlatformOrderStatusResponse, SdkError>
pub async fn execute_order<S, V>( &self, operation: &OrderExecuteOperation, signer: &S, verifier: &V, idempotency_key: Option<&str>, self_trade_prevention: PlatformSelfTradePrevention, ) -> Result<PlatformOrderSubmitResponse, SdkError>
Sourcepub async fn arm_dead_man<S, V>(
&self,
timeout: Duration,
signer: &S,
verifier: &V,
idempotency_key: Option<&str>,
) -> Result<DeadManGuard, SdkError>
pub async fn arm_dead_man<S, V>( &self, timeout: Duration, signer: &S, verifier: &V, idempotency_key: Option<&str>, ) -> Result<DeadManGuard, SdkError>
Prepare and arm a fail-closed cancel-all, then maintain its heartbeat
for this transaction’s lifetime. For indefinite unattended exposure,
use Self::maintain_dead_man so the blockhash is refreshed too.
Sourcepub async fn maintain_dead_man<S, V>(
&self,
timeout: Duration,
signer: Arc<S>,
verifier: Arc<V>,
) -> Result<DeadManGuard, SdkError>where
S: SessionSigner + 'static,
V: OrderVerifier + 'static,
pub async fn maintain_dead_man<S, V>(
&self,
timeout: Duration,
signer: Arc<S>,
verifier: Arc<V>,
) -> Result<DeadManGuard, SdkError>where
S: SessionSigner + 'static,
V: OrderVerifier + 'static,
Maintain a dead-man indefinitely by heartbeating the current ticket and
externally signing a fresh exact cancel-all before its blockhash expires.
The caller supplies owner-controlled signer/verifier adapters in Arcs
solely because the maintenance task must outlive this method call.
pub async fn heartbeat_dead_man(&self) -> Result<PlatformDeadManState, SdkError>
pub async fn dead_man_status(&self) -> Result<PlatformDeadManState, SdkError>
pub async fn disarm_dead_man(&self) -> Result<PlatformDeadManState, SdkError>
Trait Implementations§
Source§impl Clone for OrderCommandStream
impl Clone for OrderCommandStream
Source§fn clone(&self) -> OrderCommandStream
fn clone(&self) -> OrderCommandStream
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more