(self, currency: dict)
| 2015 | return self.parse_currencies(currencies) |
| 2016 | |
| 2017 | def parse_currency(self, currency: dict) -> Currency: |
| 2018 | chains = currency |
| 2019 | # currencies are grouped by chain entries, so there is at least one entry |
| 2020 | firstChain = self.safe_dict(chains, 0, {}) |
| 2021 | currencyId = self.safe_string(firstChain, 'ccy') |
| 2022 | code = self.safe_currency_code(currencyId) |
| 2023 | networks = {} |
| 2024 | type = 'crypto' |
| 2025 | chainsLength = len(chains) |
| 2026 | for j in range(0, chainsLength): |
| 2027 | chain = chains[j] |
| 2028 | # allow empty string for rare fiat-currencies, e.g. TRY |
| 2029 | networkId = self.safe_string(chain, 'chain', '') # USDT-BEP20, USDT-Avalance-C, etc |
| 2030 | if networkId == '': |
| 2031 | # only happens for fiat 'TRY' currency |
| 2032 | type = 'fiat' |
| 2033 | idParts = networkId.split('-') |
| 2034 | parts = self.array_slice(idParts, 1) |
| 2035 | chainPart = '-'.join(parts) |
| 2036 | networkCode = self.network_id_to_code(chainPart, code) |
| 2037 | networks[networkCode] = { |
| 2038 | 'id': networkId, |
| 2039 | 'network': networkCode, |
| 2040 | 'active': None, |
| 2041 | 'deposit': self.safe_bool(chain, 'canDep'), |
| 2042 | 'withdraw': self.safe_bool(chain, 'canWd'), |
| 2043 | 'fee': self.safe_number(chain, 'fee'), |
| 2044 | 'precision': self.parse_number(self.parse_precision(self.safe_string(chain, 'wdTickSz'))), |
| 2045 | 'limits': { |
| 2046 | 'withdraw': { |
| 2047 | 'min': self.safe_number(chain, 'minWd'), |
| 2048 | 'max': self.safe_number(chain, 'maxWd'), |
| 2049 | }, |
| 2050 | }, |
| 2051 | 'info': chain, |
| 2052 | } |
| 2053 | return self.safe_currency_structure({ |
| 2054 | 'info': chains, |
| 2055 | 'code': code, |
| 2056 | 'id': currencyId, |
| 2057 | 'name': self.safe_string(firstChain, 'name'), |
| 2058 | 'active': None, |
| 2059 | 'deposit': None, |
| 2060 | 'withdraw': None, |
| 2061 | 'fee': None, |
| 2062 | 'precision': None, |
| 2063 | 'limits': { |
| 2064 | 'amount': { |
| 2065 | 'min': None, |
| 2066 | 'max': None, |
| 2067 | }, |
| 2068 | }, |
| 2069 | 'type': type, |
| 2070 | 'networks': networks, |
| 2071 | }) |
| 2072 | |
| 2073 | def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook: |
| 2074 | """ |
nothing calls this directly
no test coverage detected