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

Function balanceData

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

Source from the content-addressed store, hash-verified

2380 * @return {object} - balances hel with available, onorder amounts
2381 */
2382 const balanceData = data => {
2383 let balances = {};
2384 if (typeof data === 'undefined') return {};
2385 if (typeof data.balances === 'undefined') {
2386 Binance.options.log('balanceData error', data);
2387 return {};
2388 }
2389 for (let obj of data.balances) {
2390 balances[obj.asset] = { available: obj.free, onOrder: obj.locked };
2391 }
2392 return balances;
2393 };
2394
2395 /**
2396 * Used by web sockets depth and populates OHLC and info

Callers 1

apiFunction · 0.85

Calls 1

logMethod · 0.80

Tested by

no test coverage detected