Skip to content

Interface: WebsocketClientOptions ​

Extends ​

Properties ​

PropertyTypeDescriptionOverridesInherited from
accounts?APICredentials[]--WSClientConfigurableOptions.accounts
authPrivateConnectionsOnConnectboolean---
authPrivateRequestsboolean---
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?booleanSet to true to use OKX's demo trading functionality-WSClientConfigurableOptions.demoTrading
disableHeartbeat?boolean--WSClientConfigurableOptions.disableHeartbeat
marketAPIMarketThe 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-servicesWSClientConfigurableOptions.market-
pingIntervalnumberHow often to check if the connection is aliveWSClientConfigurableOptions.pingInterval-
pongTimeoutnumberHow long to wait for a pong (heartbeat reply) before assuming the connection is deadWSClientConfigurableOptions.pongTimeout-
reconnectTimeoutnumberDelay in milliseconds before respawning the connectionWSClientConfigurableOptions.reconnectTimeout-
requestOptions?RestClientOptions--WSClientConfigurableOptions.requestOptions
useNativeHeartbeatsbooleanAttach 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

Built by Siebly. Open source SDKs for exchange APIs.