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

Method balanceData

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

* Used by balance to get the balance data * @param {array} data - account info object * @return {object} - balances hel with available, onorder amounts

(data: any)

Source from the content-addressed store, hash-verified

3295 * @return {object} - balances hel with available, onorder amounts
3296 */
3297 balanceData(data: any) {
3298 const balances = {};
3299 if (typeof data === 'undefined') return {};
3300 if (typeof data.balances === 'undefined') {
3301 this.Options.log('balanceData error', data);
3302 return {};
3303 }
3304 for (const obj of data.balances) {
3305 balances[obj.asset] = { available: obj.free, onOrder: obj.locked };
3306 }
3307 return balances;
3308 }
3309
3310 /**
3311 * Used by web sockets depth and populates OHLC and info

Callers 1

balanceMethod · 0.95

Calls 1

logMethod · 0.80

Tested by

no test coverage detected