Skip to content

Commit ab07c82

Browse files
authored
Update node-binance-api.js
If a request does not return an array, then this will cause an error. You need something like this.
1 parent 28e1162 commit ab07c82

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

node-binance-api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3903,7 +3903,7 @@ let api = function Binance( options = {} ) {
39033903

39043904
futuresPrices: async ( params = {} ) => {
39053905
let data = await promiseRequest( 'v1/ticker/price', params, { base:fapi } );
3906-
return data.reduce( ( out, i ) => ( ( out[i.symbol] = i.price ), out ), {} );
3906+
return Array.isArray(data) ? data.reduce( ( out, i ) => ( ( out[i.symbol] = i.price ), out ), {} ) : data;
39073907
},
39083908

39093909
futuresDaily: async ( symbol = false, params = {} ) => {

0 commit comments

Comments
 (0)