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

Method network_code_to_id

python/ccxt/async_support/htx.py:3361–3375  ·  view source on GitHub ↗
(self, networkCode: str, currencyCode: Str = None)

Source from the content-addressed store, hash-verified

3359 return super(htx, self).network_id_to_code(networkTitle, currencyCode)
3360
3361 def network_code_to_id(self, networkCode: str, currencyCode: Str = None):
3362 if networkCode is None:
3363 return None
3364 if currencyCode is None:
3365 return super(htx, self).network_code_to_id(networkCode)
3366 keys = list(self.options['networkChainIdsByNames'].keys())
3367 keysLength = len(keys)
3368 if keysLength == 0:
3369 raise ExchangeError(self.id + ' networkCodeToId() - markets need to be loaded at first')
3370 uniqueNetworkIds = self.safe_value(self.options['networkChainIdsByNames'], currencyCode, {})
3371 if networkCode in uniqueNetworkIds:
3372 return uniqueNetworkIds[networkCode]
3373 else:
3374 networkTitle = super(htx, self).network_code_to_id(networkCode, currencyCode)
3375 return self.safe_value(uniqueNetworkIds, networkTitle, networkTitle)
3376
3377 async def fetch_balance(self, params={}) -> Balances:
3378 """

Callers 15

withdrawMethod · 0.95
parse_currencyMethod · 0.45
fetch_deposit_addressMethod · 0.45
withdrawMethod · 0.45
withdrawMethod · 0.45
fetch_deposit_addressMethod · 0.45
withdrawMethod · 0.45
fetch_transaction_feeMethod · 0.45
fetch_deposit_addressMethod · 0.45

Calls 2

ExchangeErrorClass · 0.90
safe_valueMethod · 0.80

Tested by 2

test_options_networksFunction · 0.36
test_options_networksFunction · 0.36