* @method * @name cryptocom#fetchDepositAddress * @description fetch the deposit address for a currency associated with this account * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-deposit-address * @param {string} code unified currency code
(code: string, params = {})
| 2096 | * @returns {object} an [address structure]{@link https://docs.ccxt.com/?id=address-structure} |
| 2097 | */ |
| 2098 | async fetchDepositAddress (code: string, params = {}): Promise<DepositAddress> { |
| 2099 | const network = this.safeStringUpper (params, 'network'); |
| 2100 | params = this.omit (params, [ 'network' ]); |
| 2101 | const depositAddresses = await this.fetchDepositAddressesByNetwork (code, params); |
| 2102 | if ((network as string) in depositAddresses) { |
| 2103 | return depositAddresses[(network as string)]; |
| 2104 | } |
| 2105 | const keys = Object.keys (depositAddresses); |
| 2106 | return depositAddresses[keys[0]]; |
| 2107 | } |
| 2108 | |
| 2109 | /** |
| 2110 | * @method |
nothing calls this directly
no test coverage detected