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

Method parse_balance

python/ccxt/kraken.py:1541–1557  ·  view source on GitHub ↗
(self, response)

Source from the content-addressed store, hash-verified

1539 return self.parse_trades(trades, market, since, limit)
1540
1541 def parse_balance(self, response) -> Balances:
1542 balances = self.safe_value(response, 'result', {})
1543 result = {
1544 'info': response,
1545 'timestamp': None,
1546 'datetime': None,
1547 }
1548 currencyIds = list(balances.keys())
1549 for i in range(0, len(currencyIds)):
1550 currencyId = currencyIds[i]
1551 code = self.safe_currency_code(currencyId)
1552 balance = self.safe_value(balances, currencyId, {})
1553 account = self.account()
1554 account['used'] = self.safe_string(balance, 'hold_trade')
1555 account['total'] = self.safe_string(balance, 'balance')
1556 result[code] = account
1557 return self.safe_balance(result)
1558
1559 def fetch_balance(self, params={}) -> Balances:
1560 """

Callers 1

fetch_balanceMethod · 0.95

Calls 6

safe_currency_codeMethod · 0.95
safe_valueMethod · 0.80
safe_stringMethod · 0.80
safe_balanceMethod · 0.80
rangeFunction · 0.50
accountMethod · 0.45

Tested by

no test coverage detected