Class WebSocketClient

Hierarchy

  • EventEmitter
    • WebSocketClient

Constructors

  • Parameters

    • baseURL: string
    • signRequest: ((setup: RequestSetup) => Promise<SignedRequest>)
        • (setup): Promise<SignedRequest>
        • Parameters

          • setup: RequestSetup

          Returns Promise<SignedRequest>

    Returns WebSocketClient

Properties

socket: undefined | ReconnectingWebSocket
CLOSE_EVENT_CODE: {
    GOING_AWAY: number;
    NORMAL_CLOSURE: number;
    PROTOCOL_ERROR: number;
    UNSUPPORTED_DATA: number;
} = ...

Accessors

  • get connected(): boolean
  • A simple function to determine if the websocket appears to be open.

    Returns boolean

    True if the websocket has been opened and has not closed.

Methods

  • The websocket feed is publicly available, but connections to it are rate-limited to 1 per 4 seconds per IP.

    Parameters

    • OptionalreconnectOptions: Options

      Reconnect options to be used with the "reconnecting-websocket" package. Note: Options will be merged with sensible default values.

    Returns ReconnectingWebSocket