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

Method parse_balance

python/ccxt/delta.py:1635–1648  ·  view source on GitHub ↗
(self, response)

Source from the content-addressed store, hash-verified

1633 return self.parse_ohlcvs(result, market, timeframe, since, limit)
1634
1635 def parse_balance(self, response) -> Balances:
1636 balances = self.safe_list(response, 'result', [])
1637 result = {'info': response}
1638 currenciesByNumericId = self.safe_dict(self.options, 'currenciesByNumericId', {})
1639 for i in range(0, len(balances)):
1640 balance = balances[i]
1641 currencyId = self.safe_string(balance, 'asset_id')
1642 currency = self.safe_dict(currenciesByNumericId, currencyId)
1643 code = currencyId if (currency is None) else currency['code']
1644 account = self.account()
1645 account['total'] = self.safe_string(balance, 'balance')
1646 account['free'] = self.safe_string(balance, 'available_balance')
1647 result[code] = account
1648 return self.safe_balance(result)
1649
1650 def fetch_balance(self, params={}) -> Balances:
1651 """

Callers 1

fetch_balanceMethod · 0.95

Calls 6

safe_listMethod · 0.80
safe_dictMethod · 0.80
safe_stringMethod · 0.80
safe_balanceMethod · 0.80
rangeFunction · 0.50
accountMethod · 0.45

Tested by

no test coverage detected