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

Method parse_currency

python/ccxt/async_support/bybit.py:1804–1860  ·  view source on GitHub ↗
(self, currency: dict)

Source from the content-addressed store, hash-verified

1802 return self.parse_currencies(rows)
1803
1804 def parse_currency(self, currency: dict) -> Currency:
1805 currencyId = self.safe_string(currency, 'coin')
1806 code = self.safe_currency_code(currencyId)
1807 name = self.safe_string(currency, 'name')
1808 chains = self.safe_list(currency, 'chains', [])
1809 networks = {}
1810 for j in range(0, len(chains)):
1811 chain = chains[j]
1812 networkId = self.safe_string(chain, 'chain')
1813 networkCode = self.network_id_to_code(networkId, code)
1814 networks[networkCode] = {
1815 'info': chain,
1816 'id': networkId,
1817 'network': networkCode,
1818 'active': None,
1819 'deposit': self.safe_integer(chain, 'chainDeposit') == 1,
1820 'withdraw': self.safe_integer(chain, 'chainWithdraw') == 1,
1821 'fee': self.safe_number(chain, 'withdrawFee'),
1822 'precision': self.parse_number(self.parse_precision(self.safe_string(chain, 'minAccuracy'))),
1823 'limits': {
1824 'withdraw': {
1825 'min': self.safe_number(chain, 'withdrawMin'),
1826 'max': None,
1827 },
1828 'deposit': {
1829 'min': self.safe_number(chain, 'depositMin'),
1830 'max': None,
1831 },
1832 },
1833 }
1834 return self.safe_currency_structure({
1835 'info': currency,
1836 'code': code,
1837 'id': currencyId,
1838 'name': name,
1839 'active': None,
1840 'deposit': None,
1841 'withdraw': None,
1842 'fee': None,
1843 'precision': None,
1844 'limits': {
1845 'amount': {
1846 'min': None,
1847 'max': None,
1848 },
1849 'withdraw': {
1850 'min': None,
1851 'max': None,
1852 },
1853 'deposit': {
1854 'min': None,
1855 'max': None,
1856 },
1857 },
1858 'networks': networks,
1859 'type': 'crypto', # atm exchange api provides only cryptos
1860 })
1861

Callers

nothing calls this directly

Calls 10

safe_stringMethod · 0.80
safe_listMethod · 0.80
safe_integerMethod · 0.80
safe_numberMethod · 0.80
parse_numberMethod · 0.80
parse_precisionMethod · 0.80
rangeFunction · 0.50
safe_currency_codeMethod · 0.45
network_id_to_codeMethod · 0.45

Tested by

no test coverage detected