binance-exchange / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subscribe to several user streams with one websocket connection

KonstantinLitvin opened this issue · comments

When I subscribe to several user data streams (get listenkey for each account data stream for futures) and get message from one of the stream I can't find out which data stream send me that update message (there's no field like account id... ). Do you have any ideas how to distinguish the updates?

{
  "e": "ACCOUNT_UPDATE",                // Event Type
  "E": 1564745798939,                   // Event Time
  "T": 1564745798938 ,                  // Transaction
  "a":                                  // Update Data
    {
      "m":"ORDER",                      // Event reason type
      "B":[                             // Balances
        {
          "a":"USDT",                   // Asset
          "wb":"122624.12345678",       // Wallet Balance
          "cw":"100.12345678"           // Cross Wallet Balance
        },
        {
          "a":"BNB",           
          "wb":"1.00000000",
          "cw":"0.00000000"         
        }
      ],