Binance Connector JS
    Preparing search index...
    Index

    Constructors

    Methods

    • 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.

      Returns Promise<void>

      A Promise that resolves when all connections have been closed.

      Error if the WebSocket client is not set.

    • Removes an event listener for the specified WebSocket event.

      Parameters

      • event: "open" | "message" | "error" | "close" | "ping" | "pong"

        The WebSocket event to stop listening for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.

      • listener: (...args: any[]) => void

        The callback function that was previously added as the event listener.

      Returns void

    • Adds an event listener for the specified WebSocket event.

      Parameters

      • event: "open" | "message" | "error" | "close" | "ping" | "pong"

        The WebSocket event to listen for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.

      • listener: (...args: any[]) => void

        The callback function to be executed when the event is triggered. The function can accept any number of arguments.

      Returns void

    • Trading session information for the underlying assets of TradFi Perpetual contracts, covering the U.S. equity market, Korean equity market, Hong Kong equity market, China equity market, and the commodity market, is updated every second. Trading session information for different underlying markets is pushed in separate messages.

      Event type:*

      • EquityUpdate: Session types for the U.S. equity market include "PRE_MARKET", "REGULAR", "AFTER_MARKET", "OVERNIGHT", and "NO_TRADING".
      • CommodityUpdate: Session types for the commodity market include "REGULAR" and "NO_TRADING".
      • KR_EquityUpdate: Session types for the Korean equity market include "REGULAR" and "NO_TRADING".
      • HK_EquityUpdate: Session types for the Hong Kong equity market include "REGULAR" and "NO_TRADING".
      • CN_EquityUpdate: Session types for the China equity market include "REGULAR" and "NO_TRADING".

      Update Speed: 1s

      Parameters

      Returns WebsocketStream<TradingSessionStreamResponse>