question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please add websockets.userFutureData

See original GitHub issue

Currently we have 2 two functions for user account using websocket such as userData and userMarginData . So could you please add more userFutureData so that we can track user future account easily?

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
jmit-moderncommented, May 29, 2020

Yes, I also need to receive the user data stream in future account, when is it planned to be updated? Thank you

0reactions
kanish-111commented, Sep 15, 2021

I tried with a fresh project and it works without issue. Binance futures testnet: https://testnet.binancefuture.com/en/futures/BTCUSDT

Code:

const Binance = require('node-binance-api')
const binance = new Binance().options({
  test: true,
  verbose: true,
  APIKEY: '',
  APISECRET: '',
})

binance.websockets.userFutureData(console.log, console.warn, console.log)

Bought 1 BTC and got this in the terminal:

node index.js 
[
  'futuresSubscribeSingle: Subscribed to bLbHn1p6qCEh4QwzuqQq1NwmmbY13vZzGkytBxrzxRx9Z4oimWvW2ucRLWFIBTG2'
]
{
  eventType: 'ORDER_TRADE_UPDATE',
  eventTime: 1631648682134,
  transaction: 1631648682132,
  order: {
    symbol: 'BTCUSDT',
    clientOrderId: 'web_Ce3YHcv88IrBMhhjm3ED',
    side: 'BUY',
    orderType: 'MARKET',
    timeInForce: 'GTC',
    originalQuantity: '1',
    originalPrice: '0',
    averagePrice: '0',
    stopPrice: '0',
    executionType: 'NEW',
    orderStatus: 'NEW',
    orderId: 2818031385,
    orderLastFilledQuantity: '0',
    orderFilledAccumulatedQuantity: '0',
    lastFilledPrice: '0',
    commissionAsset: undefined,
    commission: undefined,
    orderTradeTime: 1631648682132,
    tradeId: 0,
    bidsNotional: '0',
    askNotional: '0',
    isMakerSide: false,
    isReduceOnly: false,
    stopPriceWorkingType: 'CONTRACT_PRICE',
    originalOrderType: 'MARKET',
    positionSide: 'LONG',
    closeAll: false,
    activationPrice: undefined,
    callbackRate: undefined,
    realizedProfit: '0'
  }
}
{
  eventType: 'ACCOUNT_UPDATE',
  eventTime: 1631648682135,
  transaction: 1631648682132,
  updateData: {
    eventReasonType: 'ORDER',
    balances: [ [Object] ],
    positions: [ [Object], [Object], [Object] ]
  }
}
{
  eventType: 'ORDER_TRADE_UPDATE',
  eventTime: 1631648682135,
  transaction: 1631648682132,
  order: {
    symbol: 'BTCUSDT',
    clientOrderId: 'web_Ce3YHcv88IrBMhhjm3ED',
    side: 'BUY',
    orderType: 'MARKET',
    timeInForce: 'GTC',
    originalQuantity: '1',
    originalPrice: '0',
    averagePrice: '46514.94000',
    stopPrice: '0',
    executionType: 'TRADE',
    orderStatus: 'FILLED',
    orderId: 2818031385,
    orderLastFilledQuantity: '1',
    orderFilledAccumulatedQuantity: '1',
    lastFilledPrice: '46514.94',
    commissionAsset: 'USDT',
    commission: '18.60597599',
    orderTradeTime: 1631648682132,
    tradeId: 199202074,
    bidsNotional: '0',
    askNotional: '0',
    isMakerSide: false,
    isReduceOnly: false,
    stopPriceWorkingType: 'CONTRACT_PRICE',
    originalOrderType: 'MARKET',
    positionSide: 'LONG',
    closeAll: false,
    activationPrice: undefined,
    callbackRate: undefined,
    realizedProfit: '0'
  }
}

If this doesn’t work for you then I’m afraid I can’t help you short of asking you to double check the api keys you provide in code and the ones you see here https://testnet.binancefuture.com/en/futures/BTCUSDT

thank u so much, it worked on normal module but doesnt work on node-binance-api-testnet, idk y, but ok ill use the org module .

Read more comments on GitHub >

github_iconTop Results From Across the Web

The WebSocket API (WebSockets) - Web APIs - MDN Web Docs
desktop desktop Chrome Edge WebSocket Full support. Chrome4. Toggle history Full support. Edge12. Toggl... WebSocket() constructor Full support. Chrome4. Toggle history Full support. Edge12. Toggl...
Read more >
Using WebSockets - Quarkus
This guide explains how your Quarkus application can utilize web sockets to create interactive web applications. Because it's the canonical web socket ...
Read more >
Whats the proper way to transmit updating data to a client via ...
1 Answer 1 · On connection, you add the websocket to some named group · When the value of Timer changes, you send...
Read more >
How to use WebSockets on iOS using Swift - Fresh Beginning
To install SwiftWebSocket in your project, please add the following entry to your podfile and run pod install or pod update.
Read more >
How to write passive income: Writing a quality trade bot in JS (part 1)
yarn add node-binance-api ... (data) => this.log('accountConfigUpdateCallback', data) startListening() { this.api.websockets.userFutureData( this.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found