ccxt 4.4.82 → 4.4.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +5 -7
  2. package/dist/ccxt.browser.min.js +7 -7
  3. package/dist/cjs/ccxt.js +1 -9
  4. package/dist/cjs/src/apex.js +2 -1
  5. package/dist/cjs/src/base/Exchange.js +15 -2
  6. package/dist/cjs/src/bitget.js +1 -3
  7. package/dist/cjs/src/bitrue.js +14 -35
  8. package/dist/cjs/src/bitso.js +33 -0
  9. package/dist/cjs/src/bitstamp.js +33 -0
  10. package/dist/cjs/src/blofin.js +154 -13
  11. package/dist/cjs/src/btcbox.js +25 -5
  12. package/dist/cjs/src/bybit.js +16 -40
  13. package/dist/cjs/src/cex.js +2 -4
  14. package/dist/cjs/src/coinbase.js +56 -40
  15. package/dist/cjs/src/coinbaseexchange.js +142 -32
  16. package/dist/cjs/src/coincatch.js +14 -67
  17. package/dist/cjs/src/coinex.js +29 -32
  18. package/dist/cjs/src/coinlist.js +16 -15
  19. package/dist/cjs/src/coinmetro.js +22 -11
  20. package/dist/cjs/src/coinone.js +8 -10
  21. package/dist/cjs/src/coinsph.js +126 -1
  22. package/dist/cjs/src/cryptocom.js +111 -1
  23. package/dist/cjs/src/cryptomus.js +43 -89
  24. package/dist/cjs/src/delta.js +76 -36
  25. package/dist/cjs/src/derive.js +46 -10
  26. package/dist/cjs/src/ellipx.js +175 -79
  27. package/dist/cjs/src/gate.js +1 -1
  28. package/dist/cjs/src/gemini.js +3 -5
  29. package/dist/cjs/src/hitbtc.js +56 -69
  30. package/dist/cjs/src/hyperliquid.js +2 -2
  31. package/dist/cjs/src/kraken.js +29 -24
  32. package/dist/cjs/src/kucoinfutures.js +6 -0
  33. package/dist/cjs/src/lbank.js +1 -1
  34. package/dist/cjs/src/paradex.js +119 -3
  35. package/dist/cjs/src/pro/binance.js +31 -33
  36. package/dist/cjs/src/pro/bithumb.js +5 -3
  37. package/dist/cjs/src/pro/kraken.js +289 -79
  38. package/dist/cjs/src/pro/mexc.js +302 -8
  39. package/dist/cjs/src/pro/poloniex.js +6 -2
  40. package/examples/js/cli.js +127 -13
  41. package/js/ccxt.d.ts +2 -11
  42. package/js/ccxt.js +2 -8
  43. package/js/src/abstract/blofin.d.ts +8 -0
  44. package/js/src/abstract/btcbox.d.ts +1 -0
  45. package/js/src/apex.js +2 -1
  46. package/js/src/base/Exchange.d.ts +15 -1
  47. package/js/src/base/Exchange.js +15 -2
  48. package/js/src/base/types.d.ts +3 -0
  49. package/js/src/bitget.js +1 -3
  50. package/js/src/bitrue.js +14 -35
  51. package/js/src/bitso.js +33 -0
  52. package/js/src/bitstamp.js +33 -0
  53. package/js/src/blofin.d.ts +42 -2
  54. package/js/src/blofin.js +154 -13
  55. package/js/src/btcbox.js +25 -5
  56. package/js/src/bybit.js +16 -40
  57. package/js/src/cex.js +2 -4
  58. package/js/src/coinbase.js +56 -40
  59. package/js/src/coinbaseexchange.js +142 -32
  60. package/js/src/coincatch.js +14 -67
  61. package/js/src/coinex.js +28 -29
  62. package/js/src/coinlist.js +16 -15
  63. package/js/src/coinmetro.js +22 -11
  64. package/js/src/coinone.js +8 -10
  65. package/js/src/coinsph.d.ts +10 -1
  66. package/js/src/coinsph.js +126 -1
  67. package/js/src/cryptocom.d.ts +10 -1
  68. package/js/src/cryptocom.js +111 -1
  69. package/js/src/cryptomus.js +43 -89
  70. package/js/src/delta.js +76 -36
  71. package/js/src/derive.js +46 -10
  72. package/js/src/ellipx.d.ts +2 -3
  73. package/js/src/ellipx.js +175 -80
  74. package/js/src/gate.js +1 -1
  75. package/js/src/gemini.js +3 -5
  76. package/js/src/hitbtc.js +56 -69
  77. package/js/src/hyperliquid.js +2 -2
  78. package/js/src/kraken.js +29 -24
  79. package/js/src/kucoinfutures.d.ts +1 -0
  80. package/js/src/kucoinfutures.js +6 -0
  81. package/js/src/lbank.js +1 -1
  82. package/js/src/paradex.d.ts +12 -1
  83. package/js/src/paradex.js +119 -3
  84. package/js/src/pro/binance.d.ts +26 -26
  85. package/js/src/pro/binance.js +31 -33
  86. package/js/src/pro/bithumb.js +5 -3
  87. package/js/src/pro/kraken.d.ts +7 -6
  88. package/js/src/pro/kraken.js +290 -80
  89. package/js/src/pro/mexc.d.ts +58 -0
  90. package/js/src/pro/mexc.js +302 -8
  91. package/js/src/pro/poloniex.d.ts +1 -1
  92. package/js/src/pro/poloniex.js +6 -2
  93. package/package.json +1 -1
  94. package/js/src/abstract/bl3p.d.ts +0 -22
  95. package/js/src/abstract/bl3p.js +0 -11
  96. package/js/src/abstract/idex.d.ts +0 -29
  97. package/js/src/abstract/idex.js +0 -11
  98. package/js/src/bl3p.d.ts +0 -116
  99. package/js/src/bl3p.js +0 -552
  100. package/js/src/idex.d.ts +0 -312
  101. package/js/src/idex.js +0 -1961
  102. package/js/src/pro/idex.d.ts +0 -81
  103. package/js/src/pro/idex.js +0 -720
@@ -299,6 +299,78 @@ export default class coinbaseexchange extends Exchange {
299
299
  'inverse': undefined,
300
300
  },
301
301
  },
302
+ 'options': {
303
+ 'networks': {
304
+ 'BTC': 'bitcoin',
305
+ // LIGHTNING unsupported
306
+ 'ETH': 'ethereum',
307
+ // TRON unsupported
308
+ 'SOL': 'solana',
309
+ // BSC unsupported
310
+ 'ARBONE': 'arbitrum',
311
+ 'AVAXC': 'avacchain',
312
+ 'MATIC': 'polygon',
313
+ 'BASE': 'base',
314
+ 'SUI': 'sui',
315
+ 'OP': 'optimism',
316
+ 'NEAR': 'near',
317
+ // CRONOS unsupported
318
+ // GNO unsupported
319
+ 'APT': 'aptos',
320
+ // SCROLL unsupported
321
+ 'KAVA': 'kava',
322
+ // TAIKO unsupported
323
+ // BOB unsupported
324
+ // LINEA unsupported
325
+ 'BLAST': 'blast',
326
+ 'XLM': 'stellar',
327
+ // RSK unsupported
328
+ 'SEI': 'sei',
329
+ // TON unsupported
330
+ // MANTLE unsupported
331
+ 'ADA': 'cardano',
332
+ // HYPE unsupported
333
+ 'CORE': 'coredao',
334
+ 'ALGO': 'algorand',
335
+ // RUNE unsupported
336
+ 'OSMO': 'osmosis',
337
+ // XIN unsupported
338
+ 'CELO': 'celo',
339
+ 'HBAR': 'hedera',
340
+ // FTM unsupported
341
+ // WEMIX unsupported
342
+ 'ZKSYNC': 'zksync',
343
+ // KLAY unsupported
344
+ // HT unsupported
345
+ // FSN unsupported
346
+ // EOS unsupported, eosio?
347
+ // ACA unsupported
348
+ 'STX': 'stacks',
349
+ 'XTZ': 'tezos',
350
+ // NEO unsupported
351
+ // METIS unsupported
352
+ // TLOS unsupported
353
+ 'EGLD': 'elrond',
354
+ // ASTR unsupported
355
+ // CFX unsupported
356
+ // GLMR unsupported
357
+ // CANTO unsupported
358
+ // SCRT unsupported
359
+ 'LTC': 'litecoin',
360
+ // AURORA unsupported
361
+ // ONG unsupported
362
+ 'ATOM': 'cosmos',
363
+ // CHZ unsupported
364
+ 'FIL': 'filecoin',
365
+ 'DOT': 'polkadot',
366
+ 'DOGE': 'dogecoin',
367
+ // BRC20 unsupported
368
+ 'XRP': 'ripple',
369
+ // XMR unsupported
370
+ 'DASH': 'dash',
371
+ // akash, aleo, axelar, bitcoincash, berachain, deso, ethereumclassic, unichain, flow, flare, dfinity, story,kusama, mina, ronin, oasis, bittensor, celestia, noble, vara, vechain, zcash, horizen, zetachain
372
+ },
373
+ },
302
374
  'exceptions': {
303
375
  'exact': {
304
376
  'Insufficient funds': InsufficientFunds,
@@ -334,30 +406,45 @@ export default class coinbaseexchange extends Exchange {
334
406
  async fetchCurrencies(params = {}) {
335
407
  const response = await this.publicGetCurrencies(params);
336
408
  //
337
- // [
338
- // {
339
- // "id": "XTZ",
340
- // "name": "Tezos",
341
- // "min_size": "0.000001",
342
- // "status": "online",
343
- // "message": '',
344
- // "max_precision": "0.000001",
345
- // "convertible_to": [],
346
- // "details": {
347
- // "type": "crypto",
348
- // "symbol": "Τ",
349
- // "network_confirmations": 60,
350
- // "sort_order": 53,
351
- // "crypto_address_link": "https://tzstats.com/{{address}}",
352
- // "crypto_transaction_link": "https://tzstats.com/{{txId}}",
353
- // "push_payment_methods": [ "crypto" ],
354
- // "group_types": [],
355
- // "display_name": '',
356
- // "processing_time_seconds": 0,
357
- // "min_withdrawal_amount": 1
358
- // }
359
- // }
360
- // ]
409
+ // {
410
+ // "id": "USDT",
411
+ // "name": "Tether",
412
+ // "min_size": "0.000001",
413
+ // "status": "online",
414
+ // "message": "",
415
+ // "max_precision": "0.000001",
416
+ // "convertible_to": [],
417
+ // "details": {
418
+ // "type": "crypto",
419
+ // "symbol": null,
420
+ // "network_confirmations": 14,
421
+ // "sort_order": 0,
422
+ // "crypto_address_link": "https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7?a={{address}}",
423
+ // "crypto_transaction_link": "https://etherscan.io/tx/0x{{txId}}",
424
+ // "push_payment_methods": [],
425
+ // "group_types": [],
426
+ // "display_name": null,
427
+ // "processing_time_seconds": null,
428
+ // "min_withdrawal_amount": 0.000001,
429
+ // "max_withdrawal_amount": 20000000
430
+ // },
431
+ // "default_network": "ethereum",
432
+ // "supported_networks": [
433
+ // {
434
+ // "id": "ethereum",
435
+ // "name": "Ethereum",
436
+ // "status": "online",
437
+ // "contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
438
+ // "crypto_address_link": "https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7?a={{address}}",
439
+ // "crypto_transaction_link": "https://etherscan.io/tx/0x{{txId}}",
440
+ // "min_withdrawal_amount": 0.000001,
441
+ // "max_withdrawal_amount": 20000000,
442
+ // "network_confirmations": 14,
443
+ // "processing_time_seconds": null
444
+ // }
445
+ // ],
446
+ // "display_name": "USDT"
447
+ // }
361
448
  //
362
449
  const result = {};
363
450
  for (let i = 0; i < response.length; i++) {
@@ -365,16 +452,39 @@ export default class coinbaseexchange extends Exchange {
365
452
  const id = this.safeString(currency, 'id');
366
453
  const name = this.safeString(currency, 'name');
367
454
  const code = this.safeCurrencyCode(id);
368
- const details = this.safeValue(currency, 'details', {});
369
- const status = this.safeString(currency, 'status');
370
- const active = (status === 'online');
371
- result[code] = {
455
+ const details = this.safeDict(currency, 'details', {});
456
+ const networks = {};
457
+ const supportedNetworks = this.safeList(currency, 'supported_networks', []);
458
+ for (let j = 0; j < supportedNetworks.length; j++) {
459
+ const network = supportedNetworks[j];
460
+ const networkId = this.safeString(network, 'id');
461
+ const networkCode = this.networkIdToCode(networkId);
462
+ networks[networkCode] = {
463
+ 'id': networkId,
464
+ 'name': this.safeString(network, 'name'),
465
+ 'network': networkCode,
466
+ 'active': this.safeString(network, 'status') === 'online',
467
+ 'withdraw': undefined,
468
+ 'deposit': undefined,
469
+ 'fee': undefined,
470
+ 'precision': undefined,
471
+ 'limits': {
472
+ 'withdraw': {
473
+ 'min': this.safeNumber(network, 'min_withdrawal_amount'),
474
+ 'max': this.safeNumber(network, 'max_withdrawal_amount'),
475
+ },
476
+ },
477
+ 'contract': this.safeString(network, 'contract_address'),
478
+ 'info': network,
479
+ };
480
+ }
481
+ result[code] = this.safeCurrencyStructure({
372
482
  'id': id,
373
483
  'code': code,
374
484
  'info': currency,
375
485
  'type': this.safeString(details, 'type'),
376
486
  'name': name,
377
- 'active': active,
487
+ 'active': this.safeString(currency, 'status') === 'online',
378
488
  'deposit': undefined,
379
489
  'withdraw': undefined,
380
490
  'fee': undefined,
@@ -386,11 +496,11 @@ export default class coinbaseexchange extends Exchange {
386
496
  },
387
497
  'withdraw': {
388
498
  'min': this.safeNumber(details, 'min_withdrawal_amount'),
389
- 'max': undefined,
499
+ 'max': this.safeNumber(details, 'max_withdrawal_amount'),
390
500
  },
391
501
  },
392
- 'networks': {},
393
- };
502
+ 'networks': networks,
503
+ });
394
504
  }
395
505
  return result;
396
506
  }
@@ -361,56 +361,18 @@ export default class coincatch extends Exchange {
361
361
  'CRO': 'CronosChain',
362
362
  },
363
363
  'networksById': {
364
- 'BITCOIN': 'BTC',
365
- 'ERC20': 'ERC20',
366
364
  'TRC20': 'TRC20',
367
365
  'TRX(TRC20)': 'TRC20',
368
- 'BEP20': 'BEP20',
369
366
  'ArbitrumOne': 'ARB',
370
- 'Optimism': 'OPTIMISM',
371
- 'LTC': 'LTC',
372
- 'BCH': 'BCH',
373
- 'ETC': 'ETC',
374
- 'SOL': 'SOL',
375
- 'NEO3': 'NEO3',
376
- 'stacks': 'STX',
377
- 'Elrond': 'EGLD',
378
- 'NEARProtocol': 'NEAR',
379
- 'AcalaToken': 'ACA',
380
- 'Klaytn': 'KLAY',
381
- 'Fantom': 'FTM',
382
- 'Terra': 'TERRA',
383
- 'WAVES': 'WAVES',
384
- 'TAO': 'TAO',
385
- 'SUI': 'SUI',
386
- 'SEI': 'SEI',
387
367
  'THORChain': 'RUNE',
388
- 'ZIL': 'ZIL',
389
368
  'Solar': 'SXP',
390
- 'FET': 'FET',
391
369
  'C-Chain': 'AVAX',
392
- 'XRP': 'XRP',
393
- 'EOS': 'EOS',
394
- 'DOGECOIN': 'DOGE',
395
370
  'CAP20': 'CAP20',
396
- 'Polygon': 'MATIC',
397
- 'CSPR': 'CSPR',
398
- 'Moonbeam': 'GLMR',
399
- 'MINA': 'MINA',
400
371
  'CFXeSpace': 'CFX',
401
372
  'CFX': 'CFX',
402
373
  'StratisEVM': 'STRAT',
403
- 'Celestia': 'TIA',
404
374
  'ChilizChain': 'ChilizChain',
405
- 'Aptos': 'APT',
406
- 'Ontology': 'ONT',
407
- 'ICP': 'ICP',
408
- 'Cardano': 'ADA',
409
- 'FIL': 'FIL',
410
- 'CELO': 'CELO',
411
- 'DOT': 'DOT',
412
375
  'StellarLumens': 'XLM',
413
- 'ATOM': 'ATOM',
414
376
  'CronosChain': 'CRO', // todo check
415
377
  },
416
378
  },
@@ -644,72 +606,57 @@ export default class coincatch extends Exchange {
644
606
  const currencyId = this.safeString(currecy, 'coinName');
645
607
  currenciesIds.push(currencyId);
646
608
  const code = this.safeCurrencyCode(currencyId);
647
- let allowDeposit = false;
648
- let allowWithdraw = false;
649
- let minDeposit = undefined;
650
- let minWithdraw = undefined;
651
609
  const networks = this.safeList(currecy, 'chains');
652
- const networksById = this.safeDict(this.options, 'networksById');
653
610
  const parsedNetworks = {};
654
611
  for (let j = 0; j < networks.length; j++) {
655
612
  const network = networks[j];
656
613
  const networkId = this.safeString(network, 'chain');
657
- const networkName = this.safeString(networksById, networkId, networkId);
658
- const networkDepositString = this.safeString(network, 'rechargeable');
659
- const networkDeposit = networkDepositString === 'true';
660
- const networkWithdrawString = this.safeString(network, 'withdrawable');
661
- const networkWithdraw = networkWithdrawString === 'true';
662
- const networkMinDeposit = this.safeString(network, 'minDepositAmount');
663
- const networkMinWithdraw = this.safeString(network, 'minWithdrawAmount');
614
+ const networkCode = this.networkCodeToId(networkId);
664
615
  parsedNetworks[networkId] = {
665
616
  'id': networkId,
666
- 'network': networkName,
617
+ 'network': networkCode,
667
618
  'limits': {
668
619
  'deposit': {
669
- 'min': this.parseNumber(networkMinDeposit),
620
+ 'min': this.safeNumber(network, 'minDepositAmount'),
670
621
  'max': undefined,
671
622
  },
672
623
  'withdraw': {
673
- 'min': this.parseNumber(networkMinWithdraw),
624
+ 'min': this.safeNumber(network, 'minWithdrawAmount'),
674
625
  'max': undefined,
675
626
  },
676
627
  },
677
- 'active': networkDeposit && networkWithdraw,
678
- 'deposit': networkDeposit,
679
- 'withdraw': networkWithdraw,
628
+ 'active': undefined,
629
+ 'deposit': this.safeString(network, 'rechargeable') === 'true',
630
+ 'withdraw': this.safeString(network, 'withdrawable') === 'true',
680
631
  'fee': this.safeNumber(network, 'withdrawFee'),
681
632
  'precision': undefined,
682
633
  'info': network,
683
634
  };
684
- allowDeposit = allowDeposit ? allowDeposit : networkDeposit;
685
- allowWithdraw = allowWithdraw ? allowWithdraw : networkWithdraw;
686
- minDeposit = minDeposit ? Precise.stringMin(networkMinDeposit, minDeposit) : networkMinDeposit;
687
- minWithdraw = minWithdraw ? Precise.stringMin(networkMinWithdraw, minWithdraw) : networkMinWithdraw;
688
635
  }
689
- result[code] = {
636
+ result[code] = this.safeCurrencyStructure({
690
637
  'id': currencyId,
691
638
  'numericId': this.safeInteger(currecy, 'coinId'),
692
639
  'code': code,
693
640
  'precision': undefined,
694
641
  'type': undefined,
695
642
  'name': undefined,
696
- 'active': allowWithdraw && allowDeposit,
697
- 'deposit': allowDeposit,
698
- 'withdraw': allowWithdraw,
643
+ 'active': undefined,
644
+ 'deposit': undefined,
645
+ 'withdraw': undefined,
699
646
  'fee': undefined,
700
647
  'limits': {
701
648
  'deposit': {
702
- 'min': this.parseNumber(minDeposit),
649
+ 'min': undefined,
703
650
  'max': undefined,
704
651
  },
705
652
  'withdraw': {
706
- 'min': this.parseNumber(minWithdraw),
653
+ 'min': undefined,
707
654
  'max': undefined,
708
655
  },
709
656
  },
710
657
  'networks': parsedNetworks,
711
658
  'info': currecy,
712
- };
659
+ });
713
660
  }
714
661
  if (this.safeList(this.options, 'currencyIdsListForParseMarket') === undefined) {
715
662
  this.options['currencyIdsListForParseMarket'] = currenciesIds;
package/js/src/coinex.js CHANGED
@@ -724,33 +724,7 @@ export default class coinex extends Exchange {
724
724
  const canWithdraw = this.safeBool(asset, 'withdraw_enabled');
725
725
  const firstChain = this.safeDict(chains, 0, {});
726
726
  const firstPrecisionString = this.parsePrecision(this.safeString(firstChain, 'withdrawal_precision'));
727
- result[code] = {
728
- 'id': currencyId,
729
- 'code': code,
730
- 'name': undefined,
731
- 'active': canDeposit && canWithdraw,
732
- 'deposit': canDeposit,
733
- 'withdraw': canWithdraw,
734
- 'fee': undefined,
735
- 'precision': this.parseNumber(firstPrecisionString),
736
- 'limits': {
737
- 'amount': {
738
- 'min': undefined,
739
- 'max': undefined,
740
- },
741
- 'deposit': {
742
- 'min': undefined,
743
- 'max': undefined,
744
- },
745
- 'withdraw': {
746
- 'min': undefined,
747
- 'max': undefined,
748
- },
749
- },
750
- 'networks': {},
751
- 'type': 'crypto',
752
- 'info': coin,
753
- };
727
+ const networks = {};
754
728
  for (let j = 0; j < chains.length; j++) {
755
729
  const chain = chains[j];
756
730
  const networkId = this.safeString(chain, 'chain');
@@ -788,10 +762,35 @@ export default class coinex extends Exchange {
788
762
  },
789
763
  'info': chain,
790
764
  };
791
- const networks = this.safeDict(result[code], 'networks', {});
792
765
  networks[networkId] = network;
793
- result[code]['networks'] = networks;
794
766
  }
767
+ result[code] = this.safeCurrencyStructure({
768
+ 'id': currencyId,
769
+ 'code': code,
770
+ 'name': undefined,
771
+ 'active': canDeposit && canWithdraw,
772
+ 'deposit': canDeposit,
773
+ 'withdraw': canWithdraw,
774
+ 'fee': undefined,
775
+ 'precision': this.parseNumber(firstPrecisionString),
776
+ 'limits': {
777
+ 'amount': {
778
+ 'min': undefined,
779
+ 'max': undefined,
780
+ },
781
+ 'deposit': {
782
+ 'min': undefined,
783
+ 'max': undefined,
784
+ },
785
+ 'withdraw': {
786
+ 'min': undefined,
787
+ 'max': undefined,
788
+ },
789
+ },
790
+ 'networks': {},
791
+ 'type': 'crypto',
792
+ 'info': coin,
793
+ });
795
794
  }
796
795
  return result;
797
796
  }
@@ -455,30 +455,31 @@ export default class coinlist extends Exchange {
455
455
  const currency = currencies[i];
456
456
  const id = this.safeString(currency, 'asset');
457
457
  const code = this.safeCurrencyCode(id);
458
+ const isFiat = code === 'USD';
458
459
  const isTransferable = this.safeBool(currency, 'is_transferable', false);
459
- const withdrawEnabled = isTransferable;
460
- const depositEnabled = isTransferable;
461
- const active = isTransferable;
462
- const decimalPlaces = this.safeString(currency, 'decimal_places');
463
- const precision = this.parseNumber(this.parsePrecision(decimalPlaces));
464
- const minWithdrawal = this.safeString(currency, 'min_withdrawal');
465
- result[code] = {
460
+ result[code] = this.safeCurrencyStructure({
466
461
  'id': id,
467
462
  'code': code,
468
463
  'name': code,
469
464
  'info': currency,
470
- 'active': active,
471
- 'deposit': depositEnabled,
472
- 'withdraw': withdrawEnabled,
465
+ 'active': undefined,
466
+ 'deposit': isTransferable,
467
+ 'withdraw': isTransferable,
473
468
  'fee': undefined,
474
- 'precision': precision,
469
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimal_places'))),
475
470
  'limits': {
476
- 'amount': { 'min': undefined, 'max': undefined },
477
- 'withdraw': { 'min': minWithdrawal, 'max': undefined },
471
+ 'amount': {
472
+ 'min': undefined,
473
+ 'max': undefined,
474
+ },
475
+ 'withdraw': {
476
+ 'min': this.safeNumber(currency, 'min_withdrawal'),
477
+ 'max': undefined,
478
+ },
478
479
  },
479
480
  'networks': {},
480
- 'type': 'crypto',
481
- };
481
+ 'type': isFiat ? 'fiat' : 'crypto',
482
+ });
482
483
  }
483
484
  return result;
484
485
  }
@@ -380,24 +380,35 @@ export default class coinmetro extends Exchange {
380
380
  const currency = response[i];
381
381
  const id = this.safeString(currency, 'symbol');
382
382
  const code = this.safeCurrencyCode(id);
383
- const withdraw = this.safeValue(currency, 'canWithdraw');
384
- const deposit = this.safeValue(currency, 'canDeposit');
385
- const canTrade = this.safeValue(currency, 'canTrade');
386
- const active = canTrade ? withdraw : true;
387
- const minAmount = this.safeNumber(currency, 'minQty');
383
+ const typeRaw = this.safeString(currency, 'type');
384
+ let type = undefined;
385
+ if (typeRaw === 'coin' || typeRaw === 'token' || typeRaw === 'erc20') {
386
+ type = 'crypto';
387
+ }
388
+ else if (typeRaw === 'fiat') {
389
+ type = 'fiat';
390
+ }
391
+ const precisionDigits = this.safeString2(currency, 'digits', 'notabeneDecimals');
388
392
  result[code] = this.safeCurrencyStructure({
389
393
  'id': id,
390
394
  'code': code,
391
395
  'name': code,
396
+ 'type': type,
392
397
  'info': currency,
393
- 'active': active,
394
- 'deposit': deposit,
395
- 'withdraw': withdraw,
398
+ 'active': this.safeBool(currency, 'canTrade'),
399
+ 'deposit': this.safeBool(currency, 'canDeposit'),
400
+ 'withdraw': this.safeBool(currency, 'canWithdraw'),
396
401
  'fee': undefined,
397
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'digits'))),
402
+ 'precision': this.parseNumber(this.parsePrecision(precisionDigits)),
398
403
  'limits': {
399
- 'amount': { 'min': minAmount, 'max': undefined },
400
- 'withdraw': { 'min': undefined, 'max': undefined },
404
+ 'amount': {
405
+ 'min': this.safeNumber(currency, 'minQty'),
406
+ 'max': undefined,
407
+ },
408
+ 'withdraw': {
409
+ 'min': undefined,
410
+ 'max': undefined,
411
+ },
401
412
  },
402
413
  'networks': {},
403
414
  });
package/js/src/coinone.js CHANGED
@@ -299,18 +299,16 @@ export default class coinone extends Exchange {
299
299
  for (let i = 0; i < currencies.length; i++) {
300
300
  const entry = currencies[i];
301
301
  const id = this.safeString(entry, 'symbol');
302
- const name = this.safeString(entry, 'name');
303
302
  const code = this.safeCurrencyCode(id);
304
- const withdrawStatus = this.safeString(entry, 'withdraw_status', '');
305
- const depositStatus = this.safeString(entry, 'deposit_status', '');
306
- const isWithdrawEnabled = withdrawStatus === 'normal';
307
- const isDepositEnabled = depositStatus === 'normal';
308
- result[code] = {
303
+ const isWithdrawEnabled = this.safeString(entry, 'withdraw_status', '') === 'normal';
304
+ const isDepositEnabled = this.safeString(entry, 'deposit_status', '') === 'normal';
305
+ const type = (code !== 'KRW') ? 'crypto' : 'fiat';
306
+ result[code] = this.safeCurrencyStructure({
309
307
  'id': id,
310
308
  'code': code,
311
309
  'info': entry,
312
- 'name': name,
313
- 'active': isWithdrawEnabled && isDepositEnabled,
310
+ 'name': this.safeString(entry, 'name'),
311
+ 'active': undefined,
314
312
  'deposit': isDepositEnabled,
315
313
  'withdraw': isWithdrawEnabled,
316
314
  'fee': this.safeNumber(entry, 'withdrawal_fee'),
@@ -326,8 +324,8 @@ export default class coinone extends Exchange {
326
324
  },
327
325
  },
328
326
  'networks': {},
329
- 'type': 'crypto',
330
- };
327
+ 'type': type,
328
+ });
331
329
  }
332
330
  return result;
333
331
  }
@@ -1,11 +1,20 @@
1
1
  import Exchange from './abstract/coinsph.js';
2
- import type { Balances, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, int, DepositAddress } from './base/types.js';
2
+ import type { Balances, Currency, Currencies, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, int, DepositAddress } from './base/types.js';
3
3
  /**
4
4
  * @class coinsph
5
5
  * @augments Exchange
6
6
  */
7
7
  export default class coinsph extends Exchange {
8
8
  describe(): any;
9
+ /**
10
+ * @method
11
+ * @name coinsph#fetchCurrencies
12
+ * @description fetches all available currencies on an exchange
13
+ * @see https://docs.coins.ph/rest-api/#all-coins-information-user_data
14
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
15
+ * @returns {object} an associative dictionary of currencies
16
+ */
17
+ fetchCurrencies(params?: {}): Promise<Currencies>;
9
18
  calculateRateLimiterCost(api: any, method: any, path: any, params: any, config?: {}): any;
10
19
  /**
11
20
  * @method