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

Method parse_balance

python/ccxt/bydfi.py:2421–2436  ·  view source on GitHub ↗
(self, response)

Source from the content-addressed store, hash-verified

2419 return self.parse_balance(data)
2420
2421 def parse_balance(self, response) -> Balances:
2422 timestamp = self.milliseconds()
2423 result = {
2424 'info': response,
2425 'timestamp': timestamp,
2426 'datetime': self.iso8601(timestamp),
2427 }
2428 for i in range(0, len(response)):
2429 balance = response[i]
2430 symbol = self.safe_string(balance, 'asset')
2431 code = self.safe_currency_code(symbol)
2432 account = self.account()
2433 account['total'] = self.safe_string_2(balance, 'total', 'balance')
2434 account['free'] = self.safe_string_2(balance, 'available', 'availableBalance')
2435 result[code] = account
2436 return self.safe_balance(result)
2437
2438 def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
2439 """

Callers 1

fetch_balanceMethod · 0.95

Calls 8

safe_stringMethod · 0.80
safe_string_2Method · 0.80
safe_balanceMethod · 0.80
rangeFunction · 0.50
millisecondsMethod · 0.45
iso8601Method · 0.45
safe_currency_codeMethod · 0.45
accountMethod · 0.45

Tested by

no test coverage detected