ccxt 4.4.85 → 4.4.87

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 (115) hide show
  1. package/README.md +18 -7
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +16 -9
  4. package/dist/cjs/src/abstract/bittrade.js +9 -0
  5. package/dist/cjs/src/abstract/modetrade.js +9 -0
  6. package/dist/cjs/src/ascendex.js +189 -155
  7. package/dist/cjs/src/base/Exchange.js +10 -8
  8. package/dist/cjs/src/bequant.js +1 -1
  9. package/dist/cjs/src/binance.js +1 -1
  10. package/dist/cjs/src/bitget.js +5 -4
  11. package/dist/cjs/src/bitmart.js +1 -1
  12. package/dist/cjs/src/bitteam.js +31 -0
  13. package/dist/cjs/src/bittrade.js +2049 -0
  14. package/dist/cjs/src/coinbase.js +2 -6
  15. package/dist/cjs/src/coinmetro.js +5 -1
  16. package/dist/cjs/src/deribit.js +4 -5
  17. package/dist/cjs/src/derive.js +4 -5
  18. package/dist/cjs/src/ellipx.js +2 -3
  19. package/dist/cjs/src/gate.js +92 -76
  20. package/dist/cjs/src/hollaex.js +107 -49
  21. package/dist/cjs/src/htx.js +30 -52
  22. package/dist/cjs/src/hyperliquid.js +36 -20
  23. package/dist/cjs/src/kraken.js +5 -8
  24. package/dist/cjs/src/mexc.js +2 -2
  25. package/dist/cjs/src/modetrade.js +2839 -0
  26. package/dist/cjs/src/ndax.js +25 -24
  27. package/dist/cjs/src/okcoin.js +12 -31
  28. package/dist/cjs/src/okx.js +104 -2
  29. package/dist/cjs/src/okxus.js +53 -0
  30. package/dist/cjs/src/onetrading.js +9 -6
  31. package/dist/cjs/src/oxfun.js +42 -114
  32. package/dist/cjs/src/paradex.js +10 -1
  33. package/dist/cjs/src/phemex.js +4 -6
  34. package/dist/cjs/src/poloniex.js +181 -170
  35. package/dist/cjs/src/pro/binance.js +1 -0
  36. package/dist/cjs/src/pro/bittrade.js +605 -0
  37. package/dist/cjs/src/pro/luno.js +6 -5
  38. package/dist/cjs/src/pro/mexc.js +3 -0
  39. package/dist/cjs/src/pro/modetrade.js +1334 -0
  40. package/dist/cjs/src/pro/okxus.js +38 -0
  41. package/dist/cjs/src/probit.js +18 -51
  42. package/dist/cjs/src/timex.js +5 -10
  43. package/dist/cjs/src/vertex.js +3 -4
  44. package/dist/cjs/src/whitebit.js +41 -11
  45. package/dist/cjs/src/woo.js +101 -77
  46. package/dist/cjs/src/woofipro.js +24 -21
  47. package/dist/cjs/src/xt.js +36 -44
  48. package/js/ccxt.d.ts +20 -11
  49. package/js/ccxt.js +14 -8
  50. package/js/src/abstract/modetrade.d.ts +122 -0
  51. package/js/src/abstract/myokx.d.ts +2 -0
  52. package/js/src/abstract/okx.d.ts +2 -0
  53. package/js/src/abstract/okxus.d.ts +352 -0
  54. package/js/src/abstract/okxus.js +11 -0
  55. package/js/src/ascendex.d.ts +2 -0
  56. package/js/src/ascendex.js +189 -155
  57. package/js/src/base/Exchange.js +10 -8
  58. package/js/src/bequant.js +1 -1
  59. package/js/src/binance.js +1 -1
  60. package/js/src/bitget.js +5 -4
  61. package/js/src/bitmart.js +1 -1
  62. package/js/src/bitteam.js +31 -0
  63. package/js/src/{huobijp.d.ts → bittrade.d.ts} +29 -29
  64. package/js/src/{huobijp.js → bittrade.js} +35 -35
  65. package/js/src/coinbase.js +2 -6
  66. package/js/src/coinmetro.js +5 -1
  67. package/js/src/deribit.js +4 -5
  68. package/js/src/derive.js +4 -3
  69. package/js/src/ellipx.d.ts +1 -1
  70. package/js/src/ellipx.js +3 -5
  71. package/js/src/gate.js +92 -76
  72. package/js/src/hollaex.js +107 -49
  73. package/js/src/htx.js +30 -52
  74. package/js/src/hyperliquid.js +36 -20
  75. package/js/src/kraken.js +5 -8
  76. package/js/src/mexc.js +2 -2
  77. package/js/src/modetrade.d.ts +475 -0
  78. package/js/src/modetrade.js +2840 -0
  79. package/js/src/ndax.js +25 -24
  80. package/js/src/okcoin.js +12 -31
  81. package/js/src/okx.d.ts +24 -1
  82. package/js/src/okx.js +104 -2
  83. package/js/src/okxus.d.ts +4 -0
  84. package/js/src/okxus.js +54 -0
  85. package/js/src/onetrading.js +9 -6
  86. package/js/src/oxfun.js +42 -114
  87. package/js/src/paradex.js +10 -1
  88. package/js/src/phemex.js +4 -6
  89. package/js/src/poloniex.d.ts +2 -0
  90. package/js/src/poloniex.js +181 -170
  91. package/js/src/pro/binance.js +1 -0
  92. package/js/src/pro/{huobijp.d.ts → bittrade.d.ts} +6 -6
  93. package/js/src/pro/{huobijp.js → bittrade.js} +7 -7
  94. package/js/src/pro/luno.js +6 -5
  95. package/js/src/pro/mexc.js +3 -0
  96. package/js/src/pro/modetrade.d.ts +155 -0
  97. package/js/src/pro/modetrade.js +1335 -0
  98. package/js/src/pro/okxus.d.ts +4 -0
  99. package/js/src/pro/okxus.js +39 -0
  100. package/js/src/probit.js +18 -51
  101. package/js/src/timex.js +5 -10
  102. package/js/src/vertex.js +3 -4
  103. package/js/src/whitebit.js +42 -11
  104. package/js/src/woo.d.ts +2 -0
  105. package/js/src/woo.js +101 -77
  106. package/js/src/woofipro.d.ts +2 -1
  107. package/js/src/woofipro.js +24 -21
  108. package/js/src/xt.js +36 -44
  109. package/package.json +1 -1
  110. package/js/src/abstract/kuna.d.ts +0 -185
  111. package/js/src/kuna.d.ts +0 -335
  112. package/js/src/kuna.js +0 -2006
  113. /package/js/src/abstract/{huobijp.d.ts → bittrade.d.ts} +0 -0
  114. /package/js/src/abstract/{huobijp.js → bittrade.js} +0 -0
  115. /package/js/src/abstract/{kuna.js → modetrade.js} +0 -0
package/js/src/oxfun.js CHANGED
@@ -6,7 +6,6 @@
6
6
 
7
7
  // ---------------------------------------------------------------------------
8
8
  import Exchange from './abstract/oxfun.js';
9
- import { Precise } from './base/Precise.js';
10
9
  import { AccountNotEnabled, ArgumentsRequired, AuthenticationError, BadRequest, BadSymbol, ExchangeError, InvalidOrder, InsufficientFunds, OrderNotFound, MarketClosed, NetworkError, NotSupported, OperationFailed, RateLimitExceeded, RequestTimeout } from './base/errors.js';
11
10
  import { TICK_SIZE } from './base/functions/number.js';
12
11
  import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
@@ -602,66 +601,7 @@ export default class oxfun extends Exchange {
602
601
  // "minDeposit": "0.00010",
603
602
  // "minWithdrawal": "0.00010"
604
603
  // },
605
- // {
606
- // "network": "Arbitrum",
607
- // "tokenId": "0xba0Dda8762C24dA9487f5FA026a9B64b695A07Ea",
608
- // "transactionPrecision": "18",
609
- // "isWithdrawalFeeChargedToUser": true,
610
- // "canDeposit": true,
611
- // "canWithdraw": true,
612
- // "minDeposit": "0.00010",
613
- // "minWithdrawal": "0.00010"
614
- // },
615
- // {
616
- // "network": "Ethereum",
617
- // "tokenId": "0xba0Dda8762C24dA9487f5FA026a9B64b695A07Ea",
618
- // "transactionPrecision": "18",
619
- // "isWithdrawalFeeChargedToUser": true,
620
- // "canDeposit": true,
621
- // "canWithdraw": true,
622
- // "minDeposit": "0.00010",
623
- // "minWithdrawal": "0.00010"
624
- // },
625
- // {
626
- // "network": "Arbitrum",
627
- // "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
628
- // "transactionPrecision": "18",
629
- // "isWithdrawalFeeChargedToUser": true,
630
- // "canDeposit": true,
631
- // "canWithdraw": false,
632
- // "minDeposit": "0.00010",
633
- // "minWithdrawal": "0.00010"
634
- // },
635
- // {
636
- // "network": "Avalanche",
637
- // "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
638
- // "transactionPrecision": "18",
639
- // "isWithdrawalFeeChargedToUser": true,
640
- // "canDeposit": true,
641
- // "canWithdraw": false,
642
- // "minDeposit": "0.00010",
643
- // "minWithdrawal": "0.00010"
644
- // },
645
- // {
646
- // "network": "Solana",
647
- // "tokenId": "DV3845GEAVXfwpyVGGgWbqBVCtzHdCXNCGfcdboSEuZz",
648
- // "transactionPrecision": "8",
649
- // "isWithdrawalFeeChargedToUser": true,
650
- // "canDeposit": true,
651
- // "canWithdraw": true,
652
- // "minDeposit": "0.00010",
653
- // "minWithdrawal": "0.00010"
654
- // },
655
- // {
656
- // "network": "Ethereum",
657
- // "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
658
- // "transactionPrecision": "18",
659
- // "isWithdrawalFeeChargedToUser": true,
660
- // "canDeposit": true,
661
- // "canWithdraw": false,
662
- // "minDeposit": "0.00010",
663
- // "minWithdrawal": "0.00010"
664
- // }
604
+ // ...
665
605
  // ]
666
606
  // },
667
607
  // {
@@ -711,79 +651,67 @@ export default class oxfun extends Exchange {
711
651
  const parts = fullId.split('.');
712
652
  const id = parts[0];
713
653
  const code = this.safeCurrencyCode(id);
714
- let networks = {};
654
+ if (!(code in result)) {
655
+ result[code] = {
656
+ 'id': id,
657
+ 'code': code,
658
+ 'precision': undefined,
659
+ 'type': undefined,
660
+ 'name': undefined,
661
+ 'active': undefined,
662
+ 'deposit': undefined,
663
+ 'withdraw': undefined,
664
+ 'fee': undefined,
665
+ 'limits': {
666
+ 'withdraw': {
667
+ 'min': undefined,
668
+ 'max': undefined,
669
+ },
670
+ 'deposit': {
671
+ 'min': undefined,
672
+ 'max': undefined,
673
+ },
674
+ },
675
+ 'networks': {},
676
+ 'info': [],
677
+ };
678
+ }
715
679
  const chains = this.safeList(currency, 'networkList', []);
716
- let currencyMaxPrecision = undefined;
717
- let currencyDepositEnabled = undefined;
718
- let currencyWithdrawEnabled = undefined;
719
680
  for (let j = 0; j < chains.length; j++) {
720
681
  const chain = chains[j];
721
682
  const networkId = this.safeString(chain, 'network');
722
683
  const networkCode = this.networkIdToCode(networkId);
723
- const deposit = this.safeBool(chain, 'canDeposit');
724
- const withdraw = this.safeBool(chain, 'canWithdraw');
725
- const active = (deposit && withdraw);
726
- const minDeposit = this.safeString(chain, 'minDeposit');
727
- const minWithdrawal = this.safeString(chain, 'minWithdrawal');
728
- const precision = this.parsePrecision(this.safeString(chain, 'transactionPrecision'));
729
- networks[networkCode] = {
684
+ result[code]['networks'][networkCode] = {
730
685
  'id': networkId,
731
686
  'network': networkCode,
732
687
  'margin': undefined,
733
- 'deposit': deposit,
734
- 'withdraw': withdraw,
735
- 'active': active,
688
+ 'deposit': this.safeBool(chain, 'canDeposit'),
689
+ 'withdraw': this.safeBool(chain, 'canWithdraw'),
690
+ 'active': undefined,
736
691
  'fee': undefined,
737
- 'precision': this.parseNumber(precision),
692
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'transactionPrecision'))),
738
693
  'limits': {
739
694
  'deposit': {
740
- 'min': minDeposit,
695
+ 'min': this.safeNumber(chain, 'minDeposit'),
741
696
  'max': undefined,
742
697
  },
743
698
  'withdraw': {
744
- 'min': minWithdrawal,
699
+ 'min': this.safeNumber(chain, 'minWithdrawal'),
745
700
  'max': undefined,
746
701
  },
747
702
  },
748
703
  'info': chain,
749
704
  };
750
- if ((currencyDepositEnabled === undefined) || deposit) {
751
- currencyDepositEnabled = deposit;
752
- }
753
- if ((currencyWithdrawEnabled === undefined) || withdraw) {
754
- currencyWithdrawEnabled = withdraw;
755
- }
756
- if ((currencyMaxPrecision === undefined) || Precise.stringGt(currencyMaxPrecision, precision)) {
757
- currencyMaxPrecision = precision;
758
- }
759
- }
760
- if (code in result) {
761
- // checking for specific ids as USDC.ARB
762
- networks = this.extend(result[code]['networks'], networks);
763
705
  }
764
- result[code] = {
765
- 'id': id,
766
- 'code': code,
767
- 'name': undefined,
768
- 'type': undefined,
769
- 'active': undefined,
770
- 'deposit': currencyDepositEnabled,
771
- 'withdraw': currencyWithdrawEnabled,
772
- 'fee': undefined,
773
- 'precision': this.parseNumber(currencyMaxPrecision),
774
- 'limits': {
775
- 'amount': {
776
- 'min': undefined,
777
- 'max': undefined,
778
- },
779
- 'withdraw': {
780
- 'min': undefined,
781
- 'max': undefined,
782
- },
783
- },
784
- 'networks': networks,
785
- 'info': currency,
786
- };
706
+ const infos = this.safeList(result[code], 'info', []);
707
+ infos.push(currency);
708
+ result[code]['info'] = infos;
709
+ }
710
+ // only after all entries are formed in currencies, restructure each entry
711
+ const allKeys = Object.keys(result);
712
+ for (let i = 0; i < allKeys.length; i++) {
713
+ const code = allKeys[i];
714
+ result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
787
715
  }
788
716
  return result;
789
717
  }
package/js/src/paradex.js CHANGED
@@ -1260,7 +1260,16 @@ export default class paradex extends Exchange {
1260
1260
  const price = this.safeString(order, 'price');
1261
1261
  const amount = this.safeString(order, 'size');
1262
1262
  const orderType = this.safeString(order, 'type');
1263
- const status = this.safeString(order, 'status');
1263
+ const cancelReason = this.safeString(order, 'cancel_reason');
1264
+ let status = this.safeString(order, 'status');
1265
+ if (cancelReason !== undefined) {
1266
+ if (cancelReason === 'NOT_ENOUGH_MARGIN') {
1267
+ status = 'rejected';
1268
+ }
1269
+ else {
1270
+ status = 'canceled';
1271
+ }
1272
+ }
1264
1273
  const side = this.safeStringLower(order, 'side');
1265
1274
  const average = this.omitZero(this.safeString(order, 'avg_fill_price'));
1266
1275
  const remaining = this.omitZero(this.safeString(order, 'remaining_size'));
package/js/src/phemex.js CHANGED
@@ -1128,9 +1128,7 @@ export default class phemex extends Exchange {
1128
1128
  for (let i = 0; i < currencies.length; i++) {
1129
1129
  const currency = currencies[i];
1130
1130
  const id = this.safeString(currency, 'currency');
1131
- const name = this.safeString(currency, 'name');
1132
1131
  const code = this.safeCurrencyCode(id);
1133
- const status = this.safeString(currency, 'status');
1134
1132
  const valueScaleString = this.safeString(currency, 'valueScale');
1135
1133
  const valueScale = parseInt(valueScaleString);
1136
1134
  const minValueEv = this.safeString(currency, 'minValueEv');
@@ -1144,12 +1142,12 @@ export default class phemex extends Exchange {
1144
1142
  minAmount = this.parseNumber(Precise.stringMul(minValueEv, precisionString));
1145
1143
  maxAmount = this.parseNumber(Precise.stringMul(maxValueEv, precisionString));
1146
1144
  }
1147
- result[code] = {
1145
+ result[code] = this.safeCurrencyStructure({
1148
1146
  'id': id,
1149
1147
  'info': currency,
1150
1148
  'code': code,
1151
- 'name': name,
1152
- 'active': status === 'Listed',
1149
+ 'name': this.safeString(currency, 'name'),
1150
+ 'active': this.safeString(currency, 'status') === 'Listed',
1153
1151
  'deposit': undefined,
1154
1152
  'withdraw': undefined,
1155
1153
  'fee': undefined,
@@ -1167,7 +1165,7 @@ export default class phemex extends Exchange {
1167
1165
  'valueScale': valueScale,
1168
1166
  'networks': undefined,
1169
1167
  'type': 'crypto',
1170
- };
1168
+ });
1171
1169
  }
1172
1170
  return result;
1173
1171
  }
@@ -269,6 +269,8 @@ export default class poloniex extends Exchange {
269
269
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
270
270
  */
271
271
  fetchDepositAddress(code: string, params?: {}): Promise<DepositAddress>;
272
+ prepareRequestForDepositAddress(code: string, params?: Dict): any;
273
+ parseDepositAddressSpecial(response: any, currency: any, networkEntry: any): DepositAddress;
272
274
  /**
273
275
  * @method
274
276
  * @name poloniex#transfer