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
@@ -743,8 +743,10 @@ class Exchange {
743
743
  // only call if exchange API provides endpoint (true), thus avoid emulated versions ('emulated')
744
744
  if (this.has['fetchCurrencies'] === true) {
745
745
  currencies = await this.fetchCurrencies();
746
+ this.options['cachedCurrencies'] = currencies;
746
747
  }
747
748
  const markets = await this.fetchMarkets(params);
749
+ delete this.options['cachedCurrencies'];
748
750
  return this.setMarkets(markets, currencies);
749
751
  }
750
752
  /**
@@ -3961,12 +3963,12 @@ class Exchange {
3961
3963
  }
3962
3964
  else {
3963
3965
  // if networkCode was provided by user, we should check it after response, as the referenced exchange doesn't support network-code during request
3964
- const networkId = isIndexedByUnifiedNetworkCode ? networkCode : this.networkCodeToId(networkCode, currencyCode);
3965
- if (networkId in indexedNetworkEntries) {
3966
- chosenNetworkId = networkId;
3966
+ const networkIdOrCode = isIndexedByUnifiedNetworkCode ? networkCode : this.networkCodeToId(networkCode, currencyCode);
3967
+ if (networkIdOrCode in indexedNetworkEntries) {
3968
+ chosenNetworkId = networkIdOrCode;
3967
3969
  }
3968
3970
  else {
3969
- throw new errors.NotSupported(this.id + ' - ' + networkId + ' network was not found for ' + currencyCode + ', use one of ' + availableNetworkIds.join(', '));
3971
+ throw new errors.NotSupported(this.id + ' - ' + networkIdOrCode + ' network was not found for ' + currencyCode + ', use one of ' + availableNetworkIds.join(', '));
3970
3972
  }
3971
3973
  }
3972
3974
  }
@@ -4308,15 +4310,15 @@ class Exchange {
4308
4310
  const cost = this.calculateRateLimiterCost(api, method, path, params, config);
4309
4311
  await this.throttle(cost);
4310
4312
  }
4313
+ let retries = undefined;
4314
+ [retries, params] = this.handleOptionAndParams(params, path, 'maxRetriesOnFailure', 0);
4315
+ let retryDelay = undefined;
4316
+ [retryDelay, params] = this.handleOptionAndParams(params, path, 'maxRetriesOnFailureDelay', 0);
4311
4317
  this.lastRestRequestTimestamp = this.milliseconds();
4312
4318
  const request = this.sign(path, api, method, params, headers, body);
4313
4319
  this.last_request_headers = request['headers'];
4314
4320
  this.last_request_body = request['body'];
4315
4321
  this.last_request_url = request['url'];
4316
- let retries = undefined;
4317
- [retries, params] = this.handleOptionAndParams(params, path, 'maxRetriesOnFailure', 0);
4318
- let retryDelay = undefined;
4319
- [retryDelay, params] = this.handleOptionAndParams(params, path, 'maxRetriesOnFailureDelay', 0);
4320
4322
  for (let i = 0; i < retries + 1; i++) {
4321
4323
  try {
4322
4324
  return await this.fetch(request['url'], request['method'], request['headers'], request['body']);
@@ -9,8 +9,8 @@ class bequant extends hitbtc {
9
9
  return this.deepExtend(super.describe(), {
10
10
  'id': 'bequant',
11
11
  'name': 'Bequant',
12
- 'countries': ['MT'],
13
12
  'pro': true,
13
+ 'countries': ['MT'],
14
14
  'urls': {
15
15
  'logo': 'https://github.com/user-attachments/assets/0583ef1f-29fe-4b7c-8189-63565a0e2867',
16
16
  'api': {
@@ -5195,7 +5195,6 @@ class binance extends binance$1 {
5195
5195
  if (postOnly) {
5196
5196
  uppercaseType = 'LIMIT_MAKER';
5197
5197
  }
5198
- request['type'] = uppercaseType;
5199
5198
  const triggerPrice = this.safeNumber2(params, 'stopPrice', 'triggerPrice');
5200
5199
  if (triggerPrice !== undefined) {
5201
5200
  if (uppercaseType === 'MARKET') {
@@ -5205,6 +5204,7 @@ class binance extends binance$1 {
5205
5204
  uppercaseType = 'STOP_LOSS_LIMIT';
5206
5205
  }
5207
5206
  }
5207
+ request['type'] = uppercaseType;
5208
5208
  const validOrderTypes = this.safeList(market['info'], 'orderTypes');
5209
5209
  if (!this.inArray(uppercaseType, validOrderTypes)) {
5210
5210
  if (initialUppercaseType !== uppercaseType) {
@@ -2390,7 +2390,7 @@ class bitget extends bitget$1 {
2390
2390
  'coin': currency['id'],
2391
2391
  'address': address,
2392
2392
  'chain': networkId,
2393
- 'size': amount,
2393
+ 'size': this.currencyToPrecision(code, amount, networkCode),
2394
2394
  'transferType': 'on_chain',
2395
2395
  };
2396
2396
  if (tag !== undefined) {
@@ -2415,8 +2415,6 @@ class bitget extends bitget$1 {
2415
2415
  const fillResponseFromRequest = this.safeBool(withdrawOptions, 'fillResponseFromRequest', true);
2416
2416
  if (fillResponseFromRequest) {
2417
2417
  result['currency'] = code;
2418
- result['timestamp'] = this.milliseconds();
2419
- result['datetime'] = this.iso8601(this.milliseconds());
2420
2418
  result['amount'] = amount;
2421
2419
  result['tag'] = tag;
2422
2420
  result['address'] = address;
@@ -2540,7 +2538,10 @@ class bitget extends bitget$1 {
2540
2538
  const status = this.safeString(transaction, 'status');
2541
2539
  const tag = this.safeString(transaction, 'tag');
2542
2540
  const feeCostString = this.safeString(transaction, 'fee');
2543
- const feeCostAbsString = Precise["default"].stringAbs(feeCostString);
2541
+ let feeCostAbsString = undefined;
2542
+ if (feeCostString !== undefined) {
2543
+ feeCostAbsString = Precise["default"].stringAbs(feeCostString);
2544
+ }
2544
2545
  let fee = undefined;
2545
2546
  let amountString = this.safeString(transaction, 'size');
2546
2547
  if (feeCostAbsString !== undefined) {
@@ -2371,7 +2371,7 @@ class bitmart extends bitmart$1 {
2371
2371
  const code = this.safeCurrencyCode(currencyId);
2372
2372
  const account = this.account();
2373
2373
  account['free'] = this.safeString2(balance, 'available', 'available_balance');
2374
- account['used'] = this.safeString2(balance, 'frozen', 'frozen_balance');
2374
+ account['used'] = this.safeStringN(balance, ['unAvailable', 'frozen', 'frozen_balance']);
2375
2375
  result[code] = account;
2376
2376
  }
2377
2377
  return this.safeBalance(result);
@@ -29,12 +29,18 @@ class bitteam extends bitteam$1 {
29
29
  'future': false,
30
30
  'option': false,
31
31
  'addMargin': false,
32
+ 'borrowCrossMargin': false,
33
+ 'borrowIsolatedMargin': false,
32
34
  'borrowMargin': false,
33
35
  'cancelAllOrders': true,
34
36
  'cancelOrder': true,
35
37
  'cancelOrders': false,
38
+ 'closeAllPositions': false,
39
+ 'closePosition': false,
36
40
  'createDepositAddress': false,
37
41
  'createOrder': true,
42
+ 'createOrderWithTakeProfitAndStopLoss': false,
43
+ 'createOrderWithTakeProfitAndStopLossWs': false,
38
44
  'createPostOnlyOrder': false,
39
45
  'createReduceOnlyOrder': false,
40
46
  'createStopLimitOrder': false,
@@ -46,8 +52,11 @@ class bitteam extends bitteam$1 {
46
52
  'fetchBalance': true,
47
53
  'fetchBidsAsks': false,
48
54
  'fetchBorrowInterest': false,
55
+ 'fetchBorrowRate': false,
49
56
  'fetchBorrowRateHistories': false,
50
57
  'fetchBorrowRateHistory': false,
58
+ 'fetchBorrowRates': false,
59
+ 'fetchBorrowRatesPerSymbol': false,
51
60
  'fetchCanceledOrders': true,
52
61
  'fetchClosedOrder': false,
53
62
  'fetchClosedOrders': true,
@@ -63,24 +72,42 @@ class bitteam extends bitteam$1 {
63
72
  'fetchDepositWithdrawFee': false,
64
73
  'fetchDepositWithdrawFees': false,
65
74
  'fetchFundingHistory': false,
75
+ 'fetchFundingInterval': false,
76
+ 'fetchFundingIntervals': false,
66
77
  'fetchFundingRate': false,
67
78
  'fetchFundingRateHistory': false,
68
79
  'fetchFundingRates': false,
80
+ 'fetchGreeks': false,
69
81
  'fetchIndexOHLCV': false,
70
82
  'fetchIsolatedBorrowRate': false,
71
83
  'fetchIsolatedBorrowRates': false,
84
+ 'fetchIsolatedPositions': false,
72
85
  'fetchL3OrderBook': false,
73
86
  'fetchLedger': false,
74
87
  'fetchLeverage': false,
88
+ 'fetchLeverages': false,
75
89
  'fetchLeverageTiers': false,
90
+ 'fetchLiquidations': false,
91
+ 'fetchLongShortRatio': false,
92
+ 'fetchLongShortRatioHistory': false,
93
+ 'fetchMarginAdjustmentHistory': false,
94
+ 'fetchMarginMode': false,
95
+ 'fetchMarginModes': false,
76
96
  'fetchMarketLeverageTiers': false,
77
97
  'fetchMarkets': true,
78
98
  'fetchMarkOHLCV': false,
99
+ 'fetchMarkPrices': false,
100
+ 'fetchMyLiquidations': false,
101
+ 'fetchMySettlementHistory': false,
79
102
  'fetchMyTrades': true,
80
103
  'fetchOHLCV': true,
104
+ 'fetchOpenInterest': false,
81
105
  'fetchOpenInterestHistory': false,
106
+ 'fetchOpenInterests': false,
82
107
  'fetchOpenOrder': false,
83
108
  'fetchOpenOrders': true,
109
+ 'fetchOption': false,
110
+ 'fetchOptionChain': false,
84
111
  'fetchOrder': true,
85
112
  'fetchOrderBook': true,
86
113
  'fetchOrderBooks': false,
@@ -94,6 +121,7 @@ class bitteam extends bitteam$1 {
94
121
  'fetchPositionsHistory': false,
95
122
  'fetchPositionsRisk': false,
96
123
  'fetchPremiumIndexOHLCV': false,
124
+ 'fetchSettlementHistory': false,
97
125
  'fetchStatus': false,
98
126
  'fetchTicker': true,
99
127
  'fetchTickers': true,
@@ -106,10 +134,13 @@ class bitteam extends bitteam$1 {
106
134
  'fetchTransactionFees': false,
107
135
  'fetchTransactions': true,
108
136
  'fetchTransfers': false,
137
+ 'fetchVolatilityHistory': false,
109
138
  'fetchWithdrawal': false,
110
139
  'fetchWithdrawals': false,
111
140
  'fetchWithdrawalWhitelist': false,
112
141
  'reduceMargin': false,
142
+ 'repayCrossMargin': false,
143
+ 'repayIsolatedMargin': false,
113
144
  'repayMargin': false,
114
145
  'setLeverage': false,
115
146
  'setMargin': false,