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

Method networkCodeToId

ts/src/htx.ts:3484–3503  ·  view source on GitHub ↗
(networkCode: string, currencyCode: Str = undefined)

Source from the content-addressed store, hash-verified

3482 }
3483
3484 networkCodeToId (networkCode: string, currencyCode: Str = undefined) { // here network-id is provided as a pair of currency & chain (i.e. trc20usdt)
3485 if (networkCode === undefined) {
3486 return undefined;
3487 }
3488 if (currencyCode === undefined) {
3489 return super.networkCodeToId (networkCode);
3490 }
3491 const keys = Object.keys (this.options['networkChainIdsByNames']);
3492 const keysLength = keys.length;
3493 if (keysLength === 0) {
3494 throw new ExchangeError (this.id + ' networkCodeToId() - markets need to be loaded at first');
3495 }
3496 const uniqueNetworkIds = this.safeValue (this.options['networkChainIdsByNames'], currencyCode, {});
3497 if (networkCode in uniqueNetworkIds) {
3498 return uniqueNetworkIds[networkCode];
3499 } else {
3500 const networkTitle = super.networkCodeToId (networkCode, currencyCode);
3501 return this.safeValue (uniqueNetworkIds, networkTitle, networkTitle);
3502 }
3503 }
3504
3505 /**
3506 * @method

Callers 15

withdrawMethod · 0.95
withdrawMethod · 0.45
fetchDepositAddressMethod · 0.45
withdrawMethod · 0.45
withdrawMethod · 0.45
fetchDepositAddressMethod · 0.45
getAssetHistoryRowsMethod · 0.45
withdrawMethod · 0.45
parseCurrencyMethod · 0.45
fetchDepositAddressMethod · 0.45
withdrawMethod · 0.45
withdrawMethod · 0.45

Calls 1

safeValueMethod · 0.45

Tested by

no test coverage detected