Module client

Module client 

Source
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§

OKXWebSocketClient
Provides a WebSocket client for connecting to OKX.

Statics§

OKX_WS_ORDER_QUOTA
Rate limit for order-related WebSocket operations: 250 requests per second.
OKX_WS_QUOTA
Default OKX WebSocket rate limit: 3 requests per second.

Functions§

is_post_only_rejection
Returns true when an OKX error payload represents a post-only rejection.