MCPcopy Create free account
hub / github.com/ccxt/ccxt / fetchBalance

Method fetchBalance

ts/src/luno.ts:550–564  ·  view source on GitHub ↗

* @method * @name luno#fetchBalance * @description query for balance and get the amount of funds available for trading or funds locked in orders * @see https://www.luno.com/en/developers/api#tag/Accounts/operation/getBalances * @param {object} [params] extra parameters specific t

(params = {})

Source from the content-addressed store, hash-verified

548 * @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
549 */
550 async fetchBalance (params = {}): Promise<Balances> {
551 await this.loadMarkets ();
552 const response = await this.privateGetBalance (params);
553 //
554 // {
555 // "balance": [
556 // {'account_id': '119...1336','asset': 'XBT','balance': '0.00','reserved': '0.00',"unconfirmed": "0.00"},
557 // {'account_id': '66...289','asset': 'XBT','balance': '0.00','reserved': '0.00',"unconfirmed": "0.00"},
558 // {'account_id': '718...5300','asset': 'ETH','balance': '0.00','reserved': '0.00',"unconfirmed": "0.00"},
559 // {'account_id': '818...7072','asset': 'ZAR','balance': '0.001417','reserved': '0.00',"unconfirmed": "0.00"}]}
560 // ]
561 // }
562 //
563 return this.parseBalance (response);
564 }
565
566 /**
567 * @method

Callers

nothing calls this directly

Calls 3

parseBalanceMethod · 0.95
privateGetBalanceMethod · 0.65
loadMarketsMethod · 0.45

Tested by

no test coverage detected