Interface: WebsocketClientOptions
Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
accounts? | APICredentials[] | - | - | WSClientConfigurableOptions.accounts |
authPrivateConnectionsOnConnect | boolean | - | - | - |
authPrivateRequests | boolean | - | - | - |
customSignMessageFn? | (message: string, secret: string) => Promise<string> | Provide a custom signing function. The SDK passes the serialized signing payload and API secret to this function and uses its returned signature. | - | WSClientConfigurableOptions.customSignMessageFn |
demoTrading? | boolean | Set to true to use OKX's demo trading functionality | - | WSClientConfigurableOptions.demoTrading |
disableHeartbeat? | boolean | - | - | WSClientConfigurableOptions.disableHeartbeat |
market | APIMarket | The API group this client should connect to: - market: 'prod' (default: connects to OKX global) https://www.okx.com/docs-v5/en/#overview-production-trading-services - market: 'OPENAPI_GLOBAL' // OKX Global REST at https://openapi.okx.com (WS same as GLOBAL) - market: 'EEA' // also known as "my.okx.com" https://my.okx.com/docs-v5/en/#overview-production-trading-services - market: 'US' // also known as "app.okx.com" https://app.okx.com/docs-v5/en/#overview-production-trading-services | WSClientConfigurableOptions.market | - |
pingInterval | number | How often to check if the connection is alive | WSClientConfigurableOptions.pingInterval | - |
pongTimeout | number | How long to wait for a pong (heartbeat reply) before assuming the connection is dead | WSClientConfigurableOptions.pongTimeout | - |
reconnectTimeout | number | Delay in milliseconds before respawning the connection | WSClientConfigurableOptions.reconnectTimeout | - |
requestOptions? | RestClientOptions | - | - | WSClientConfigurableOptions.requestOptions |
useNativeHeartbeats | boolean | Attach listeners for native WebSocket ping/pong events when supported. The SDK still sends text ping messages for its heartbeat timer; this option does not switch outgoing heartbeats to native frames. | - | - |
wsOptions? | { protocols?: string[] | undefined; agent?: any; } & (Omit<Partial<ClientOptions>, "agent"> | Omit<Partial<ClientRequestArgs>, "agent">) | - | - | WSClientConfigurableOptions.wsOptions |
wsUrl? | string | - | - | WSClientConfigurableOptions.wsUrl |