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

Method fetchDepositAddress

ts/src/cryptocom.ts:2098–2107  ·  view source on GitHub ↗

* @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 = {})

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

safeStringUpperMethod · 0.45
omitMethod · 0.45

Tested by

no test coverage detected