MCPcopy Create free account
hub / github.com/ccxt/node-binance-api / priceData

Method priceData

src/node-binance-api.ts:3264–3274  ·  view source on GitHub ↗

* Gets the price of a given symbol or symbols * @param {array} data - array of symbols * @return {array} - symbols with their current prices

(data: any)

Source from the content-addressed store, hash-verified

3262 * @return {array} - symbols with their current prices
3263 */
3264 priceData(data: any): { [key: string]: number } {
3265 const prices = {};
3266 if (Array.isArray(data)) {
3267 for (const obj of data) {
3268 prices[obj.symbol] = obj.price;
3269 }
3270 } else { // Single price returned
3271 prices[data.symbol] = parseFloat(data.price);
3272 }
3273 return prices;
3274 }
3275
3276 /**
3277 * Used by bookTickers to format the bids and asks given given symbols

Callers 2

pricesMethod · 0.95
futuresPricesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected