pub fn parse_ws_order_report(
ws_order: &DydxWsOrderSubaccountMessageContents,
instrument_cache: &InstrumentCache,
order_contexts: &DashMap<u32, OrderContext>,
encoder: &ClientOrderIdEncoder,
account_id: AccountId,
ts_init: UnixNanos,
) -> Result<OrderStatusReport>Expand description
Parses a WebSocket order update into an OrderStatusReport.
Converts the WebSocket order format to the HTTP Order format, then delegates to the existing HTTP parser for consistency.
§Arguments
ws_order- The WebSocket order message to parseinstrument_cache- Cache for looking up instruments by clob_pair_idorder_contexts- Map of dYdX u32 client IDs to order contextsencoder- Bidirectional encoder for ClientOrderId ↔ u32 mappingaccount_id- Account ID for the reportts_init- Timestamp for initialization
§Errors
Returns an error if:
- clob_pair_id cannot be parsed from string.
- Instrument lookup fails for the clob_pair_id.
- Field parsing fails (price, size, etc.).
- HTTP parser fails.