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

Method parseCurrency

ts/src/luno.ts:340–392  ·  view source on GitHub ↗
(rawCurrency: Dict)

Source from the content-addressed store, hash-verified

338 }
339
340 parseCurrency (rawCurrency: Dict): Currency {
341 const id = this.safeString (rawCurrency[0], 'native_currency'); // first item is guaranteed
342 const code = this.safeCurrencyCode (id);
343 const networks = {};
344 for (let i = 0; i < rawCurrency.length; i++) {
345 const networkEntry = rawCurrency[i];
346 const networkId = this.safeString (networkEntry, 'name');
347 const networkCode = this.networkIdToCode (networkId, code);
348 networks[networkCode] = {
349 'id': networkId,
350 'network': networkCode,
351 'limits': {
352 'withdraw': {
353 'min': undefined,
354 'max': undefined,
355 },
356 'deposit': {
357 'min': undefined,
358 'max': undefined,
359 },
360 },
361 'active': undefined,
362 'deposit': undefined,
363 'withdraw': undefined,
364 'fee': undefined,
365 'precision': undefined,
366 'info': networkEntry,
367 };
368 }
369 return this.safeCurrencyStructure ({
370 'id': id,
371 'code': code,
372 'precision': undefined,
373 'type': undefined,
374 'name': undefined,
375 'active': undefined,
376 'deposit': undefined,
377 'withdraw': undefined,
378 'fee': undefined,
379 'limits': {
380 'withdraw': {
381 'min': undefined,
382 'max': undefined,
383 },
384 'deposit': {
385 'min': undefined,
386 'max': undefined,
387 },
388 },
389 'networks': networks,
390 'info': rawCurrency,
391 });
392 }
393
394 /**
395 * @method

Callers

nothing calls this directly

Calls 4

safeStringMethod · 0.45
safeCurrencyCodeMethod · 0.45
networkIdToCodeMethod · 0.45
safeCurrencyStructureMethod · 0.45

Tested by

no test coverage detected