(networkCode: string, currencyCode: Str = undefined)
| 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 |
no test coverage detected