Skip to content

Interface: WebsocketClientOptions ​

WS configuration that's always defined, regardless of user configuration (usually comes from defaults if there's no user-provided values)

Extends ​

Properties ​

PropertyTypeDescriptionOverridesInherited from
apiKey?stringYour API key-WSClientConfigurableOptions.apiKey
apiPassphrase?stringYour API passphrase (can be anything) that you included when creating this API key-WSClientConfigurableOptions.apiPassphrase
apiRegion?APIRegionThe API region you would like to work with: - Global (default) - API Docs: https://www.kucoin.com/docs-new/introduction - EU: - API Docs: https://www.kucoin.com/en-eu/docs-new/introduction/eu - Behaves the same as global, but keep in mind that futures may not be available at this time for EU users. - AU: - API Docs: https://www.kucoin.com/en-au/docs-new/introduction/au - Ensures regional market data is retrieved (e.g. correct trading pairs, correct tickers, etc). - Also ensures requests for AU users include the required extra header (X-SITE-TYPE: australia).-WSClientConfigurableOptions.apiRegion
apiSecret?stringYour API secret-WSClientConfigurableOptions.apiSecret
authPrivateConnectionsOnConnectboolean---
authPrivateRequestsboolean---
customSignMessageFn?(message: string, secret: string) => Promise<string>Allows you to provide a custom "signMessage" function, e.g. to use node's much faster createHmac method Look in the examples folder for a demonstration on using node's createHmac instead.-WSClientConfigurableOptions.customSignMessageFn
dataMessageFilter?WsDataMessageFilterOptional filter applied to data pushes ("type":"message") before they are parsed, e.g. to drop symbols you do not track on an all-market topic such as /market/ticker:all. Parsing is the dominant per-message cost on busy topics. Control frames (welcome, ack, error, pong) never reach the filter, and if it throws the frame is processed as usual. - Return false to drop the message before any JSON parsing. - Return true to allow it through.-WSClientConfigurableOptions.dataMessageFilter
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-
reauthWSAPIOnReconnectbooleanIf you authenticated the WS API before, automatically try to re-authenticate the WS API if you're disconnected/reconnected for any reason.WSClientConfigurableOptions.reauthWSAPIOnReconnect-
reconnectTimeoutnumberDelay in milliseconds before respawning the connectionWSClientConfigurableOptions.reconnectTimeout-
recvWindownumberDefine a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 secondsWSClientConfigurableOptions.recvWindow-
requestOptions?AxiosRequestConfig<any, any>--WSClientConfigurableOptions.requestOptions
requireConnectionReadyConfirmationbooleanIf true, require a "receipt" that the connection is ready for use (e.g. a specific event type)--
restOptions?RestClientOptions--WSClientConfigurableOptions.restOptions
useNativeHeartbeatsbooleanWhether to use native WebSocket ping/pong frames for heartbeats--
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.