ccxt 4.4.85 → 4.4.86

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 (60) hide show
  1. package/README.md +6 -7
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +6 -9
  4. package/dist/cjs/src/abstract/bittrade.js +9 -0
  5. package/dist/cjs/src/ascendex.js +189 -155
  6. package/dist/cjs/src/bequant.js +1 -1
  7. package/dist/cjs/src/bitget.js +5 -4
  8. package/dist/cjs/src/bitmart.js +1 -1
  9. package/dist/cjs/src/bittrade.js +2049 -0
  10. package/dist/cjs/src/coinbase.js +2 -6
  11. package/dist/cjs/src/deribit.js +4 -5
  12. package/dist/cjs/src/hollaex.js +107 -49
  13. package/dist/cjs/src/htx.js +20 -44
  14. package/dist/cjs/src/hyperliquid.js +4 -4
  15. package/dist/cjs/src/mexc.js +2 -2
  16. package/dist/cjs/src/ndax.js +25 -24
  17. package/dist/cjs/src/okcoin.js +12 -31
  18. package/dist/cjs/src/okx.js +9 -0
  19. package/dist/cjs/src/onetrading.js +9 -6
  20. package/dist/cjs/src/oxfun.js +42 -114
  21. package/dist/cjs/src/paradex.js +5 -1
  22. package/dist/cjs/src/pro/binance.js +1 -0
  23. package/dist/cjs/src/pro/bittrade.js +605 -0
  24. package/dist/cjs/src/pro/luno.js +6 -5
  25. package/dist/cjs/src/pro/mexc.js +3 -0
  26. package/js/ccxt.d.ts +8 -11
  27. package/js/ccxt.js +6 -8
  28. package/js/src/abstract/myokx.d.ts +2 -0
  29. package/js/src/abstract/okx.d.ts +2 -0
  30. package/js/src/ascendex.d.ts +2 -0
  31. package/js/src/ascendex.js +189 -155
  32. package/js/src/bequant.js +1 -1
  33. package/js/src/bitget.js +5 -4
  34. package/js/src/bitmart.js +1 -1
  35. package/js/src/{huobijp.d.ts → bittrade.d.ts} +29 -29
  36. package/js/src/{huobijp.js → bittrade.js} +35 -35
  37. package/js/src/coinbase.js +2 -6
  38. package/js/src/deribit.js +4 -5
  39. package/js/src/hollaex.js +107 -49
  40. package/js/src/htx.js +20 -44
  41. package/js/src/hyperliquid.js +4 -4
  42. package/js/src/mexc.js +2 -2
  43. package/js/src/ndax.js +25 -24
  44. package/js/src/okcoin.js +12 -31
  45. package/js/src/okx.js +9 -0
  46. package/js/src/onetrading.js +9 -6
  47. package/js/src/oxfun.js +42 -114
  48. package/js/src/paradex.js +5 -1
  49. package/js/src/pro/binance.js +1 -0
  50. package/js/src/pro/{huobijp.d.ts → bittrade.d.ts} +6 -6
  51. package/js/src/pro/{huobijp.js → bittrade.js} +7 -7
  52. package/js/src/pro/luno.js +6 -5
  53. package/js/src/pro/mexc.js +3 -0
  54. package/package.json +1 -1
  55. package/js/src/abstract/kuna.d.ts +0 -185
  56. package/js/src/abstract/kuna.js +0 -11
  57. package/js/src/kuna.d.ts +0 -335
  58. package/js/src/kuna.js +0 -2006
  59. /package/js/src/abstract/{huobijp.d.ts → bittrade.d.ts} +0 -0
  60. /package/js/src/abstract/{huobijp.js → bittrade.js} +0 -0
@@ -392,9 +392,12 @@ class onetrading extends onetrading$1 {
392
392
  //
393
393
  // [
394
394
  // {
395
- // "code":"BEST",
396
- // "precision":8
397
- // }
395
+ // "code": "USDT",
396
+ // "precision": 6,
397
+ // "unified_cryptoasset_id": 825,
398
+ // "name": "Tether USDt",
399
+ // "collateral_percentage": 0
400
+ // },
398
401
  // ]
399
402
  //
400
403
  const result = {};
@@ -402,10 +405,10 @@ class onetrading extends onetrading$1 {
402
405
  const currency = response[i];
403
406
  const id = this.safeString(currency, 'code');
404
407
  const code = this.safeCurrencyCode(id);
405
- result[code] = {
408
+ result[code] = this.safeCurrencyStructure({
406
409
  'id': id,
407
410
  'code': code,
408
- 'name': undefined,
411
+ 'name': this.safeString(currency, 'name'),
409
412
  'info': currency,
410
413
  'active': undefined,
411
414
  'fee': undefined,
@@ -417,7 +420,7 @@ class onetrading extends onetrading$1 {
417
420
  'withdraw': { 'min': undefined, 'max': undefined },
418
421
  },
419
422
  'networks': {},
420
- };
423
+ });
421
424
  }
422
425
  return result;
423
426
  }
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var oxfun$1 = require('./abstract/oxfun.js');
4
- var Precise = require('./base/Precise.js');
5
4
  var errors = require('./base/errors.js');
6
5
  var number = require('./base/functions/number.js');
7
6
  var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
@@ -599,66 +598,7 @@ class oxfun extends oxfun$1 {
599
598
  // "minDeposit": "0.00010",
600
599
  // "minWithdrawal": "0.00010"
601
600
  // },
602
- // {
603
- // "network": "Arbitrum",
604
- // "tokenId": "0xba0Dda8762C24dA9487f5FA026a9B64b695A07Ea",
605
- // "transactionPrecision": "18",
606
- // "isWithdrawalFeeChargedToUser": true,
607
- // "canDeposit": true,
608
- // "canWithdraw": true,
609
- // "minDeposit": "0.00010",
610
- // "minWithdrawal": "0.00010"
611
- // },
612
- // {
613
- // "network": "Ethereum",
614
- // "tokenId": "0xba0Dda8762C24dA9487f5FA026a9B64b695A07Ea",
615
- // "transactionPrecision": "18",
616
- // "isWithdrawalFeeChargedToUser": true,
617
- // "canDeposit": true,
618
- // "canWithdraw": true,
619
- // "minDeposit": "0.00010",
620
- // "minWithdrawal": "0.00010"
621
- // },
622
- // {
623
- // "network": "Arbitrum",
624
- // "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
625
- // "transactionPrecision": "18",
626
- // "isWithdrawalFeeChargedToUser": true,
627
- // "canDeposit": true,
628
- // "canWithdraw": false,
629
- // "minDeposit": "0.00010",
630
- // "minWithdrawal": "0.00010"
631
- // },
632
- // {
633
- // "network": "Avalanche",
634
- // "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
635
- // "transactionPrecision": "18",
636
- // "isWithdrawalFeeChargedToUser": true,
637
- // "canDeposit": true,
638
- // "canWithdraw": false,
639
- // "minDeposit": "0.00010",
640
- // "minWithdrawal": "0.00010"
641
- // },
642
- // {
643
- // "network": "Solana",
644
- // "tokenId": "DV3845GEAVXfwpyVGGgWbqBVCtzHdCXNCGfcdboSEuZz",
645
- // "transactionPrecision": "8",
646
- // "isWithdrawalFeeChargedToUser": true,
647
- // "canDeposit": true,
648
- // "canWithdraw": true,
649
- // "minDeposit": "0.00010",
650
- // "minWithdrawal": "0.00010"
651
- // },
652
- // {
653
- // "network": "Ethereum",
654
- // "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
655
- // "transactionPrecision": "18",
656
- // "isWithdrawalFeeChargedToUser": true,
657
- // "canDeposit": true,
658
- // "canWithdraw": false,
659
- // "minDeposit": "0.00010",
660
- // "minWithdrawal": "0.00010"
661
- // }
601
+ // ...
662
602
  // ]
663
603
  // },
664
604
  // {
@@ -708,79 +648,67 @@ class oxfun extends oxfun$1 {
708
648
  const parts = fullId.split('.');
709
649
  const id = parts[0];
710
650
  const code = this.safeCurrencyCode(id);
711
- let networks = {};
651
+ if (!(code in result)) {
652
+ result[code] = {
653
+ 'id': id,
654
+ 'code': code,
655
+ 'precision': undefined,
656
+ 'type': undefined,
657
+ 'name': undefined,
658
+ 'active': undefined,
659
+ 'deposit': undefined,
660
+ 'withdraw': undefined,
661
+ 'fee': undefined,
662
+ 'limits': {
663
+ 'withdraw': {
664
+ 'min': undefined,
665
+ 'max': undefined,
666
+ },
667
+ 'deposit': {
668
+ 'min': undefined,
669
+ 'max': undefined,
670
+ },
671
+ },
672
+ 'networks': {},
673
+ 'info': [],
674
+ };
675
+ }
712
676
  const chains = this.safeList(currency, 'networkList', []);
713
- let currencyMaxPrecision = undefined;
714
- let currencyDepositEnabled = undefined;
715
- let currencyWithdrawEnabled = undefined;
716
677
  for (let j = 0; j < chains.length; j++) {
717
678
  const chain = chains[j];
718
679
  const networkId = this.safeString(chain, 'network');
719
680
  const networkCode = this.networkIdToCode(networkId);
720
- const deposit = this.safeBool(chain, 'canDeposit');
721
- const withdraw = this.safeBool(chain, 'canWithdraw');
722
- const active = (deposit && withdraw);
723
- const minDeposit = this.safeString(chain, 'minDeposit');
724
- const minWithdrawal = this.safeString(chain, 'minWithdrawal');
725
- const precision = this.parsePrecision(this.safeString(chain, 'transactionPrecision'));
726
- networks[networkCode] = {
681
+ result[code]['networks'][networkCode] = {
727
682
  'id': networkId,
728
683
  'network': networkCode,
729
684
  'margin': undefined,
730
- 'deposit': deposit,
731
- 'withdraw': withdraw,
732
- 'active': active,
685
+ 'deposit': this.safeBool(chain, 'canDeposit'),
686
+ 'withdraw': this.safeBool(chain, 'canWithdraw'),
687
+ 'active': undefined,
733
688
  'fee': undefined,
734
- 'precision': this.parseNumber(precision),
689
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'transactionPrecision'))),
735
690
  'limits': {
736
691
  'deposit': {
737
- 'min': minDeposit,
692
+ 'min': this.safeNumber(chain, 'minDeposit'),
738
693
  'max': undefined,
739
694
  },
740
695
  'withdraw': {
741
- 'min': minWithdrawal,
696
+ 'min': this.safeNumber(chain, 'minWithdrawal'),
742
697
  'max': undefined,
743
698
  },
744
699
  },
745
700
  'info': chain,
746
701
  };
747
- if ((currencyDepositEnabled === undefined) || deposit) {
748
- currencyDepositEnabled = deposit;
749
- }
750
- if ((currencyWithdrawEnabled === undefined) || withdraw) {
751
- currencyWithdrawEnabled = withdraw;
752
- }
753
- if ((currencyMaxPrecision === undefined) || Precise["default"].stringGt(currencyMaxPrecision, precision)) {
754
- currencyMaxPrecision = precision;
755
- }
756
- }
757
- if (code in result) {
758
- // checking for specific ids as USDC.ARB
759
- networks = this.extend(result[code]['networks'], networks);
760
702
  }
761
- result[code] = {
762
- 'id': id,
763
- 'code': code,
764
- 'name': undefined,
765
- 'type': undefined,
766
- 'active': undefined,
767
- 'deposit': currencyDepositEnabled,
768
- 'withdraw': currencyWithdrawEnabled,
769
- 'fee': undefined,
770
- 'precision': this.parseNumber(currencyMaxPrecision),
771
- 'limits': {
772
- 'amount': {
773
- 'min': undefined,
774
- 'max': undefined,
775
- },
776
- 'withdraw': {
777
- 'min': undefined,
778
- 'max': undefined,
779
- },
780
- },
781
- 'networks': networks,
782
- 'info': currency,
783
- };
703
+ const infos = this.safeList(result[code], 'info', []);
704
+ infos.push(currency);
705
+ result[code]['info'] = infos;
706
+ }
707
+ // only after all entries are formed in currencies, restructure each entry
708
+ const allKeys = Object.keys(result);
709
+ for (let i = 0; i < allKeys.length; i++) {
710
+ const code = allKeys[i];
711
+ result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
784
712
  }
785
713
  return result;
786
714
  }
@@ -1257,7 +1257,11 @@ class paradex extends paradex$1 {
1257
1257
  const price = this.safeString(order, 'price');
1258
1258
  const amount = this.safeString(order, 'size');
1259
1259
  const orderType = this.safeString(order, 'type');
1260
- const status = this.safeString(order, 'status');
1260
+ const cancelReason = this.safeString(order, 'cancel_reason');
1261
+ let status = this.safeString(order, 'status');
1262
+ if (cancelReason !== undefined) {
1263
+ status = 'canceled';
1264
+ }
1261
1265
  const side = this.safeStringLower(order, 'side');
1262
1266
  const average = this.omitZero(this.safeString(order, 'avg_fill_price'));
1263
1267
  const remaining = this.omitZero(this.safeString(order, 'remaining_size'));
@@ -827,6 +827,7 @@ class binance extends binance$1 {
827
827
  orderbook.reset(snapshot);
828
828
  // unroll the accumulated deltas
829
829
  const messages = orderbook.cache;
830
+ orderbook.cache = [];
830
831
  for (let i = 0; i < messages.length; i++) {
831
832
  const messageItem = messages[i];
832
833
  const U = this.safeInteger(messageItem, 'U');