Creates a new WebSocketClient instance.
The client instance.
Whether the WebSocket client is connected.
OptionalheartbeatThe interval for sending heartbeats, in milliseconds.
OptionallastThe timestamp of the last ping sent, in milliseconds.
OptionallastWhether the last pong acknowledgment was received.
Whether the WebSocket client is ready.
A promise representing the reconnecting process, or null if not reconnecting.
The number of reconnection attempts made.
OptionalsocketThe WebSocket connection instance.
Gets the current ping (latency) of the WebSocket connection.
The ping in milliseconds, or -0 if the WebSocket is not connected.
Connects to the WebSocket server.
A promise that resolves when the connection is established.
Destroys the WebSocket connection and clears its state.
OptionalisUserInitiated: booleanA promise that resolves when the connection is destroyed.
Sends data through the WebSocket connection.
The data to send.
A promise that resolves when the data is sent.
Sends a heartbeat to the server to keep the connection alive.
Sets the heartbeat interval for the WebSocket connection.
The interval time in milliseconds. Use -1 to clear the interval.
Represents the WebSocket client used for real-time communication with the API.