diff --git a/README.md b/README.md index a891b27a..1f192528 100644 --- a/README.md +++ b/README.md @@ -829,12 +829,16 @@ console.log(await client.futuresDailyStats({ symbol: 'ETHBTC' })) #### futures prices -Latest price for all symbols. +Latest price for symbol, not providing a symbol will return latest price for all symbols and is resource-expensive. ```js console.log(await client.futuresPrices()) ``` +| Param | Type | Required | +| ------ | ------ | -------- | +| symbol | String | false | +
Output diff --git a/index.d.ts b/index.d.ts index 8fd77435..c9ae20c1 100644 --- a/index.d.ts +++ b/index.d.ts @@ -591,7 +591,7 @@ declare module 'binance-api-node' { limit?: number }): Promise futuresDailyStats(options?: { symbol: string }): Promise - futuresPrices(): Promise<{ [index: string]: string }> + futuresPrices(options?: { symbol: string }): Promise<{ [index: string]: string }> futuresAllBookTickers(): Promise<{ [key: string]: Ticker }> futuresMarkPrice(): Promise futuresAllForceOrders(options?: { diff --git a/src/http-client.js b/src/http-client.js index b3960ecb..7156d6a1 100644 --- a/src/http-client.js +++ b/src/http-client.js @@ -469,8 +469,8 @@ export default opts => { futuresTrades: payload => checkParams('trades', payload, ['symbol']) && pubCall('/fapi/v1/trades', payload), futuresDailyStats: payload => pubCall('/fapi/v1/ticker/24hr', payload), - futuresPrices: () => - pubCall('/fapi/v1/ticker/price').then(r => + futuresPrices: payload => + pubCall('/fapi/v1/ticker/price', payload).then(r => (Array.isArray(r) ? r : [r]).reduce((out, cur) => ((out[cur.symbol] = cur.price), out), {}), ), futuresAllBookTickers: () =>