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
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
api_key? | string | Your API key | - | WSClientConfigurableOptions.api_key |
api_secret? | string | Your API secret | - | WSClientConfigurableOptions.api_secret |
authPrivateConnectionsOnConnect | boolean | - | - | - |
authPrivateRequestsIndividually | boolean | - | - | - |
beautify? | boolean | - | - | WSClientConfigurableOptions.beautify |
beautifyWarnIfMissing? | boolean | If true, log a warning if the beautifier is missing anything for an event | - | WSClientConfigurableOptions.beautifyWarnIfMissing |
customParseJSONFn? | (raw: string) => object | Optional custom JSON parser used for incoming WS messages. Defaults to JSON.parse. | - | WSClientConfigurableOptions.customParseJSONFn |
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 |
demoTrading? | boolean | Set to true to use Binance's demo trading WebSocket endpoints. Demo trading uses real market data but simulated trading. More info: https://demo.binance.com/ Notes: - If demo trading, testnet should be set to false! - If testing a strategy, use demo trading instead. Testnet market data is very different from real market conditions. | - | WSClientConfigurableOptions.demoTrading |
disableHeartbeat? | boolean | - | - | WSClientConfigurableOptions.disableHeartbeat |
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 | - |
recvWindow | number | Define a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 seconds | WSClientConfigurableOptions.recvWindow | - |
requestOptions? | AxiosRequestConfig<any, any> | - | - | WSClientConfigurableOptions.requestOptions |
restOptions? | RestClientOptions | - | - | WSClientConfigurableOptions.restOptions |
testnet? | boolean | Set to true to connect to Binance's testnet environment. Notes: - Not all WebSocket categories support testnet. - If testing a strategy, this is not recommended. Testnet market data is very different from real market conditions. More guidance here: https://github.com/tiagosiebler/awesome-crypto-examples/wiki/CEX-Testnets | - | WSClientConfigurableOptions.testnet |
useMMSubdomain? | boolean | Default: false. If true, use market maker endpoints when available. Eligible for high-frequency trading users who have enrolled and qualified in at least one of the Futures Liquidity Provider Programs. More info: https://www.binance.com/en/support/faq/detail/7df7f3838c3b49e692d175374c3a3283 | - | WSClientConfigurableOptions.useMMSubdomain |
wsOptions? | { protocols?: string[] | undefined; agent?: any; } & (Omit<Partial<ClientOptions>, "agent"> | Omit<Partial<ClientRequestArgs>, "agent">) | - | - | WSClientConfigurableOptions.wsOptions |
wsUrl? | string | - | - | WSClientConfigurableOptions.wsUrl |