jaggedsoft / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.
MIT License
1.57k stars 767 forks source link

How use correctly userFutureData stream function? #809

Closed dremarques closed 2 years ago

dremarques commented 2 years ago

Hi, i have tried to access information of my account via stream but whe i use the function binanceapi.websockets.userFuturesData() i get return undefined.

My code:

//clientFutures options module const binanceAccounts = { andreMarques: { APIKEY: '', APISECRET: '', useServerTime: true, recvWindow: 60000, } }

// account module async function futuresUserDataStream(cliOptions){ return await clientFutures.options(cliOptions).websockets.userFutureData() }

//execution file where i call futureUserDataStream with my account info account.futuresUserDataStream(binanceAccounts.andreMarques).then((response)=>{

console.log(response)

}).catch((err)=>{

console.log(err) })

dremarques commented 2 years ago

done, the issue is simple, when use this method we need to wait for a change like a open order or close position to see something in console.