Expand description
Provides the WebSocket client integration for the OKX WebSocket API.
The OKXWebSocketClient ties together several recurring patterns:
- Heartbeats use text
ping/pong, responding to both text and control-frame pings. - Authentication re-runs on reconnect before resubscribing and skips private channels when credentials are unavailable.
- Subscriptions cache instrument type/family/ID groupings so reconnects rebuild the same set of channels while respecting the authentication guard described above.
Structs§
- OKXWeb
Socket Client - Provides a WebSocket client for connecting to OKX.
Statics§
- OKX_
RATE_ LIMIT_ KEY_ ALGO_ CANCEL - Pre-interned rate limit key for algo cancel operations.
- OKX_
RATE_ LIMIT_ KEY_ ALGO_ ORDER - Pre-interned rate limit key for algo order operations.
- OKX_
RATE_ LIMIT_ KEY_ AMEND - Pre-interned rate limit key for amend operations (amend orders).
- OKX_
RATE_ LIMIT_ KEY_ BATCH_ AMEND - Pre-interned rate limit key for batch amend operations.
- OKX_
RATE_ LIMIT_ KEY_ BATCH_ CANCEL - Pre-interned rate limit key for batch cancel operations.
- OKX_
RATE_ LIMIT_ KEY_ BATCH_ ORDER - Pre-interned rate limit key for batch order operations.
- OKX_
RATE_ LIMIT_ KEY_ CANCEL - Pre-interned rate limit key for single regular cancel operations.
- OKX_
RATE_ LIMIT_ KEY_ MASS_ CANCEL - Pre-interned rate limit key for mass cancel operations.
- OKX_
RATE_ LIMIT_ KEY_ ORDER - Pre-interned rate limit key for single regular order operations.
- OKX_
RATE_ LIMIT_ KEY_ SUBSCRIPTION - Pre-interned rate limit key for subscription operations (subscribe/unsubscribe/login).
- OKX_
WS_ ALGO_ CANCEL_ QUOTA - Rate limit for algo cancel WebSocket operations: 1 request per second.
- OKX_
WS_ ALGO_ ORDER_ QUOTA - Rate limit for algo order WebSocket operations: 10 requests per second.
- OKX_
WS_ BATCH_ ORDER_ QUOTA - Rate limit for batch order, cancel, and amend WebSocket operations: 7 requests per second.
- OKX_
WS_ CONNECTION_ QUOTA - Default OKX WebSocket connection rate limit: 3 requests per second.
- OKX_
WS_ MASS_ CANCEL_ QUOTA - Rate limit for mass cancel WebSocket operations: 2 requests per second.
- OKX_
WS_ ORDER_ QUOTA - Rate limit for single order, cancel, and amend WebSocket operations: 30 requests per second.
- OKX_
WS_ SUBSCRIPTION_ QUOTA - OKX WebSocket subscription rate limit: 480 requests per hour per connection.