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

Function depthData

deprecated/node-binance-api.js:2508–2522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2506 * @return {undefined}
2507 */
2508 const depthData = data => {
2509 if (!data) return { bids: [], asks: [] };
2510 let bids = {}, asks = {}, obj;
2511 if (typeof data.bids !== 'undefined') {
2512 for (obj of data.bids) {
2513 bids[obj[0]] = parseFloat(obj[1]);
2514 }
2515 }
2516 if (typeof data.asks !== 'undefined') {
2517 for (obj of data.asks) {
2518 asks[obj[0]] = parseFloat(obj[1]);
2519 }
2520 }
2521 return { lastUpdateId: data.lastUpdateId, bids: bids, asks: asks };
2522 }
2523
2524 /**
2525 * Used for /depth endpoint

Callers 2

apiFunction · 0.85
updateSymbolDepthCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected