Constructors

Methods

  • Close intentionally. The instance is reusable afterwards: connect() opens a fresh session.

    Bookkeeping is cleared with the socket because after this call nothing is subscribed, and state that says otherwise is a lie a later reconnect would act on. Event callbacks survive: the caller holds their unsubscribe functions and never asked to drop them.

    Returns void

  • Open the socket. Also the deliberate way back from a refused key or an earlier close(): both are user-intent states, and only user intent clears them (design §5.2, FATAL -> CONNECTING on an explicit connect).

    Returns void

  • True once the handshake is acknowledged: the only time data frames go out.

    Returns boolean

  • Subscribe to socket lifecycle (connecting / open / closed / error).

    Parameters

    Returns () => void

  • Parameters

    • mode: WsMode
    • symbol: string
    • exchange: string
    • OptionaldepthLevel: number

    Returns void