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

Method fetchConvertCurrencies

ts/src/woo.ts:4222–4274  ·  view source on GitHub ↗

* @method * @name woo#fetchConvertCurrencies * @description fetches all available currencies that can be converted * @see https://docs.woox.io/#get-quote-asset-info * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an assoc

(params = {})

Source from the content-addressed store, hash-verified

4220 * @returns {object} an associative dictionary of currencies
4221 */
4222 async fetchConvertCurrencies (params = {}): Promise<Currencies> {
4223 await this.loadMarkets ();
4224 const response = await this.v3PrivateGetConvertAssetInfo (params);
4225 //
4226 // {
4227 // "success": true,
4228 // "rows": [
4229 // {
4230 // "token": "BTC",
4231 // "tick": 0.0001,
4232 // "createdTime": "1575014248.99", // Unix epoch time in seconds
4233 // "updatedTime": "1575014248.99" // Unix epoch time in seconds
4234 // },
4235 // ]
4236 // }
4237 //
4238 const result: Dict = {};
4239 const data = this.safeList (response, 'rows', []);
4240 for (let i = 0; i < data.length; i++) {
4241 const entry = data[i];
4242 const id = this.safeString (entry, 'token');
4243 const code = this.safeCurrencyCode (id);
4244 result[code] = {
4245 'info': entry,
4246 'id': id,
4247 'code': code,
4248 'networks': undefined,
4249 'type': undefined,
4250 'name': undefined,
4251 'active': undefined,
4252 'deposit': undefined,
4253 'withdraw': undefined,
4254 'fee': undefined,
4255 'precision': this.safeNumber (entry, 'tick'),
4256 'limits': {
4257 'amount': {
4258 'min': undefined,
4259 'max': undefined,
4260 },
4261 'withdraw': {
4262 'min': undefined,
4263 'max': undefined,
4264 },
4265 'deposit': {
4266 'min': undefined,
4267 'max': undefined,
4268 },
4269 },
4270 'created': this.safeTimestamp (entry, 'createdTime'),
4271 };
4272 }
4273 return result;
4274 }
4275
4276 /**
4277 * @method

Callers

nothing calls this directly

Calls 7

loadMarketsMethod · 0.45
safeListMethod · 0.45
safeStringMethod · 0.45
safeCurrencyCodeMethod · 0.45
safeNumberMethod · 0.45
safeTimestampMethod · 0.45

Tested by

no test coverage detected