Checks if the WebSocket connection is currently open.
true
if the connection is open, false
otherwise.
Checks if the WebSocket connection is subscribed to the specified stream.
The name of the WebSocket stream to check.
true
if the connection is subscribed to the stream, false
otherwise.
Removes an event listener for the specified WebSocket event.
The WebSocket event to stop listening for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.
The callback function that was previously added as the event listener.
Adds an event listener for the specified WebSocket event.
The WebSocket event to listen for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.
The callback function to be executed when the event is triggered. The function can accept any number of arguments.
Subscribes to the risk data WebSocket stream using the provided listen key.
The listen key for the risk data WebSocket stream.
Optional
id: stringOptional risk data stream ID
A WebSocket stream handler for the risk data stream.
Subscribes to one or multiple WebSocket streams Handles both single and pool modes
Single stream name or array of stream names to subscribe to
Optional
id: stringOptional subscription ID
void
Subscribes to the trade data WebSocket stream using the provided listen key.
The listen key for the trade data WebSocket stream.
Optional
id: stringOptional trade data stream ID
A WebSocket stream handler for the trade data stream.
Unsubscribes from one or multiple WebSocket streams Handles both single and pool modes
Single stream name or array of stream names to unsubscribe from
Optional
id: stringOptional unsubscription ID
void
Disconnects from the WebSocket server. If there is no active connection, a warning is logged. Otherwise, all connections in the connection pool are closed gracefully, and a message is logged indicating that the connection has been disconnected.