Expand description
Shared types for the Trading API WebSocket protocol.
This crate contains the message types used for WebSocket communication between clients and the trading API server.
Structs§
- AggTrade
Message - AggTrade message with DEX-specific fields.
- Book
Ticker Message - Binance-compatible bookTicker (BBO) message
- Cancel
Order Data - Order data for CANCELED orders
- Data
Message - Depth
Update - Binance-compatible depth update message
- Error
Message - Error message from the server
- Force
Order Details - Order details within a forceOrder message
- Force
Order Message - Binance-compatible forceOrder message for liquidation trades
- List
Subscriptions Message - Response to a
list_subscriptionsclient request. - Mark
Price Message - Binance-compatible markPrice message
- Method
Result - Generic success envelope returned for
subscribe,unsubscribe, etc. Wraps aresult: "success"value plus the request id (echoed back from the client message) and the server-side event time. - Order
Params - Parameters for a transaction submission.
- Order
Result Message - Result message for an order-submission RPC (
SUBMIT, or the deprecatedorder.*methods). Correlate to the originating request via [id]. - Order
Result Payload - Inner
resultspayload for a successful order RPC ack. - Order
Update Common - Common fields for all order update events
- Order
Update Message - User order update message (Binance ORDER_TRADE_UPDATE style)
- Place
Order Data - Order data for NEW order placement
- Pong
Message - Price
Level - Price level as [price, quantity]
- Request
Id - Request ID for matching responses to requests (Binance uses integers)
- Status
Message - Status message for connection lifecycle events
- Subscribe
Ok - Response to a
subscribeclient request. - Trade
Fill Data - Order data for TRADE fills.
- Unsubscribe
Ok - Response to an
unsubscribeclient request. - WSError
- WebSocket error for both internal handling and client responses.
Serializes as
{"param": "...", "code": N, "msg": "..."}for JSON responses.
Enums§
- Client
Message - Messages sent from client to server (Binance-style)
- Error
Code - Error codes aligned with Binance API
- Message
Type - Order
Update Data - Untagged enum - serializes directly as the variant’s fields
- TxStatus
- Transaction status returned by the sequencer in an order RPC ack. See https://tradingapi.bullet.xyz/docs/ws/index.html#request-response.
Type Aliases§
- Client
Order Id - client order id (u64 wrapper for type safety)