ccxt 4.3.58 → 4.3.60

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 (83) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +4 -2
  4. package/dist/cjs/src/base/Exchange.js +4 -4
  5. package/dist/cjs/src/base/errors.js +22 -22
  6. package/dist/cjs/src/binance.js +90 -1
  7. package/dist/cjs/src/bingx.js +467 -123
  8. package/dist/cjs/src/bitfinex.js +38 -4
  9. package/dist/cjs/src/bitmart.js +1 -0
  10. package/dist/cjs/src/bitso.js +4 -1
  11. package/dist/cjs/src/btcbox.js +149 -7
  12. package/dist/cjs/src/bybit.js +3 -5
  13. package/dist/cjs/src/cryptocom.js +14 -6
  14. package/dist/cjs/src/deribit.js +15 -1
  15. package/dist/cjs/src/digifinex.js +32 -7
  16. package/dist/cjs/src/gate.js +16 -17
  17. package/dist/cjs/src/htx.js +7 -7
  18. package/dist/cjs/src/hyperliquid.js +108 -2
  19. package/dist/cjs/src/kraken.js +1 -1
  20. package/dist/cjs/src/mexc.js +11 -11
  21. package/dist/cjs/src/okx.js +11 -2
  22. package/dist/cjs/src/pro/binance.js +11 -13
  23. package/dist/cjs/src/pro/bingx.js +11 -8
  24. package/dist/cjs/src/pro/cex.js +1 -1
  25. package/dist/cjs/src/pro/kucoin.js +35 -3
  26. package/dist/cjs/src/pro/phemex.js +1 -1
  27. package/dist/cjs/src/pro/xt.js +1112 -0
  28. package/dist/cjs/src/timex.js +18 -2
  29. package/dist/cjs/src/upbit.js +148 -49
  30. package/dist/cjs/src/xt.js +73 -8
  31. package/js/ccxt.d.ts +6 -3
  32. package/js/ccxt.js +5 -3
  33. package/js/src/abstract/bingx.d.ts +1 -1
  34. package/js/src/abstract/bitmart.d.ts +1 -0
  35. package/js/src/abstract/btcbox.d.ts +1 -0
  36. package/js/src/abstract/upbit.d.ts +3 -0
  37. package/js/src/abstract/xt.d.ts +1 -0
  38. package/js/src/base/Exchange.d.ts +3 -3
  39. package/js/src/base/Exchange.js +5 -5
  40. package/js/src/base/errorHierarchy.d.ts +5 -5
  41. package/js/src/base/errorHierarchy.js +5 -5
  42. package/js/src/base/errors.d.ts +15 -15
  43. package/js/src/base/errors.js +22 -22
  44. package/js/src/binance.d.ts +1 -1
  45. package/js/src/binance.js +90 -1
  46. package/js/src/bingx.js +467 -123
  47. package/js/src/bitfinex.d.ts +2 -2
  48. package/js/src/bitfinex.js +38 -4
  49. package/js/src/bitmart.js +1 -0
  50. package/js/src/bitso.js +4 -1
  51. package/js/src/btcbox.d.ts +4 -1
  52. package/js/src/btcbox.js +149 -7
  53. package/js/src/bybit.js +3 -5
  54. package/js/src/cryptocom.js +14 -6
  55. package/js/src/deribit.d.ts +1 -1
  56. package/js/src/deribit.js +15 -1
  57. package/js/src/digifinex.d.ts +3 -2
  58. package/js/src/digifinex.js +32 -7
  59. package/js/src/gate.js +16 -17
  60. package/js/src/htx.js +7 -7
  61. package/js/src/hyperliquid.d.ts +3 -1
  62. package/js/src/hyperliquid.js +108 -2
  63. package/js/src/kraken.js +1 -1
  64. package/js/src/mexc.js +11 -11
  65. package/js/src/okx.js +11 -2
  66. package/js/src/pro/binance.js +11 -13
  67. package/js/src/pro/bingx.js +11 -8
  68. package/js/src/pro/bitmart.d.ts +3 -3
  69. package/js/src/pro/bitopro.d.ts +2 -2
  70. package/js/src/pro/cex.js +1 -1
  71. package/js/src/pro/coincheck.d.ts +2 -2
  72. package/js/src/pro/coinone.d.ts +2 -2
  73. package/js/src/pro/hyperliquid.d.ts +2 -2
  74. package/js/src/pro/kucoin.js +35 -3
  75. package/js/src/pro/phemex.js +1 -1
  76. package/js/src/pro/xt.d.ts +31 -0
  77. package/js/src/pro/xt.js +1113 -0
  78. package/js/src/timex.d.ts +2 -2
  79. package/js/src/timex.js +18 -2
  80. package/js/src/upbit.d.ts +0 -1
  81. package/js/src/upbit.js +148 -49
  82. package/js/src/xt.js +73 -8
  83. package/package.json +1 -1
package/dist/cjs/ccxt.js CHANGED
@@ -187,10 +187,11 @@ var wazirx$1 = require('./src/pro/wazirx.js');
187
187
  var whitebit$1 = require('./src/pro/whitebit.js');
188
188
  var woo$1 = require('./src/pro/woo.js');
189
189
  var woofipro$1 = require('./src/pro/woofipro.js');
190
+ var xt$1 = require('./src/pro/xt.js');
190
191
 
191
192
  //-----------------------------------------------------------------------------
192
193
  // this is updated by vss.js when building
193
- const version = '4.3.58';
194
+ const version = '4.3.60';
194
195
  Exchange["default"].ccxtVersion = version;
195
196
  const exchanges = {
196
197
  'ace': ace,
@@ -370,6 +371,7 @@ const pro = {
370
371
  'whitebit': whitebit$1,
371
372
  'woo': woo$1,
372
373
  'woofipro': woofipro$1,
374
+ 'xt': xt$1,
373
375
  };
374
376
  pro.exchanges = Object.keys(pro);
375
377
  pro['Exchange'] = Exchange["default"]; // now the same for rest and ts
@@ -400,6 +402,7 @@ exports.InsufficientFunds = errors.InsufficientFunds;
400
402
  exports.InvalidAddress = errors.InvalidAddress;
401
403
  exports.InvalidNonce = errors.InvalidNonce;
402
404
  exports.InvalidOrder = errors.InvalidOrder;
405
+ exports.InvalidProxySettings = errors.InvalidProxySettings;
403
406
  exports.MarginModeAlreadySet = errors.MarginModeAlreadySet;
404
407
  exports.MarketClosed = errors.MarketClosed;
405
408
  exports.NetworkError = errors.NetworkError;
@@ -414,7 +417,6 @@ exports.OrderNotCached = errors.OrderNotCached;
414
417
  exports.OrderNotFillable = errors.OrderNotFillable;
415
418
  exports.OrderNotFound = errors.OrderNotFound;
416
419
  exports.PermissionDenied = errors.PermissionDenied;
417
- exports.ProxyError = errors.ProxyError;
418
420
  exports.RateLimitExceeded = errors.RateLimitExceeded;
419
421
  exports.RequestTimeout = errors.RequestTimeout;
420
422
  exports.errors = errors;
@@ -1702,7 +1702,7 @@ class Exchange {
1702
1702
  const length = usedProxies.length;
1703
1703
  if (length > 1) {
1704
1704
  const joinedProxyNames = usedProxies.join(',');
1705
- throw new errors.ProxyError(this.id + ' you have multiple conflicting proxy settings (' + joinedProxyNames + '), please use only one from : proxyUrl, proxy_url, proxyUrlCallback, proxy_url_callback');
1705
+ throw new errors.InvalidProxySettings(this.id + ' you have multiple conflicting proxy settings (' + joinedProxyNames + '), please use only one from : proxyUrl, proxy_url, proxyUrlCallback, proxy_url_callback');
1706
1706
  }
1707
1707
  return proxyUrl;
1708
1708
  }
@@ -1766,7 +1766,7 @@ class Exchange {
1766
1766
  const length = usedProxies.length;
1767
1767
  if (length > 1) {
1768
1768
  const joinedProxyNames = usedProxies.join(',');
1769
- throw new errors.ProxyError(this.id + ' you have multiple conflicting proxy settings (' + joinedProxyNames + '), please use only one from: httpProxy, httpsProxy, httpProxyCallback, httpsProxyCallback, socksProxy, socksProxyCallback');
1769
+ throw new errors.InvalidProxySettings(this.id + ' you have multiple conflicting proxy settings (' + joinedProxyNames + '), please use only one from: httpProxy, httpsProxy, httpProxyCallback, httpsProxyCallback, socksProxy, socksProxyCallback');
1770
1770
  }
1771
1771
  return [httpProxy, httpsProxy, socksProxy];
1772
1772
  }
@@ -1806,13 +1806,13 @@ class Exchange {
1806
1806
  const length = usedProxies.length;
1807
1807
  if (length > 1) {
1808
1808
  const joinedProxyNames = usedProxies.join(',');
1809
- throw new errors.ProxyError(this.id + ' you have multiple conflicting proxy settings (' + joinedProxyNames + '), please use only one from: wsProxy, wssProxy, wsSocksProxy');
1809
+ throw new errors.InvalidProxySettings(this.id + ' you have multiple conflicting proxy settings (' + joinedProxyNames + '), please use only one from: wsProxy, wssProxy, wsSocksProxy');
1810
1810
  }
1811
1811
  return [wsProxy, wssProxy, wsSocksProxy];
1812
1812
  }
1813
1813
  checkConflictingProxies(proxyAgentSet, proxyUrlSet) {
1814
1814
  if (proxyAgentSet && proxyUrlSet) {
1815
- throw new errors.ProxyError(this.id + ' you have multiple conflicting proxy settings, please use only one from : proxyUrl, httpProxy, httpsProxy, socksProxy');
1815
+ throw new errors.InvalidProxySettings(this.id + ' you have multiple conflicting proxy settings, please use only one from : proxyUrl, httpProxy, httpsProxy, socksProxy');
1816
1816
  }
1817
1817
  }
1818
1818
  findMessageHashes(client, element) {
@@ -81,18 +81,6 @@ class MarketClosed extends OperationRejected {
81
81
  this.name = 'MarketClosed';
82
82
  }
83
83
  }
84
- class BadResponse extends ExchangeError {
85
- constructor(message) {
86
- super(message);
87
- this.name = 'BadResponse';
88
- }
89
- }
90
- class NullResponse extends BadResponse {
91
- constructor(message) {
92
- super(message);
93
- this.name = 'NullResponse';
94
- }
95
- }
96
84
  class InsufficientFunds extends ExchangeError {
97
85
  constructor(message) {
98
86
  super(message);
@@ -129,12 +117,6 @@ class OrderNotCached extends InvalidOrder {
129
117
  this.name = 'OrderNotCached';
130
118
  }
131
119
  }
132
- class CancelPending extends InvalidOrder {
133
- constructor(message) {
134
- super(message);
135
- this.name = 'CancelPending';
136
- }
137
- }
138
120
  class OrderImmediatelyFillable extends InvalidOrder {
139
121
  constructor(message) {
140
122
  super(message);
@@ -165,10 +147,10 @@ class NotSupported extends ExchangeError {
165
147
  this.name = 'NotSupported';
166
148
  }
167
149
  }
168
- class ProxyError extends ExchangeError {
150
+ class InvalidProxySettings extends ExchangeError {
169
151
  constructor(message) {
170
152
  super(message);
171
- this.name = 'ProxyError';
153
+ this.name = 'InvalidProxySettings';
172
154
  }
173
155
  }
174
156
  class ExchangeClosedByUser extends ExchangeError {
@@ -225,7 +207,25 @@ class RequestTimeout extends NetworkError {
225
207
  this.name = 'RequestTimeout';
226
208
  }
227
209
  }
228
- var errors = { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
210
+ class BadResponse extends OperationFailed {
211
+ constructor(message) {
212
+ super(message);
213
+ this.name = 'BadResponse';
214
+ }
215
+ }
216
+ class NullResponse extends BadResponse {
217
+ constructor(message) {
218
+ super(message);
219
+ this.name = 'NullResponse';
220
+ }
221
+ }
222
+ class CancelPending extends OperationFailed {
223
+ constructor(message) {
224
+ super(message);
225
+ this.name = 'CancelPending';
226
+ }
227
+ }
228
+ var errors = { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, BadResponse, NullResponse, CancelPending };
229
229
 
230
230
  exports.AccountNotEnabled = AccountNotEnabled;
231
231
  exports.AccountSuspended = AccountSuspended;
@@ -247,6 +247,7 @@ exports.InsufficientFunds = InsufficientFunds;
247
247
  exports.InvalidAddress = InvalidAddress;
248
248
  exports.InvalidNonce = InvalidNonce;
249
249
  exports.InvalidOrder = InvalidOrder;
250
+ exports.InvalidProxySettings = InvalidProxySettings;
250
251
  exports.MarginModeAlreadySet = MarginModeAlreadySet;
251
252
  exports.MarketClosed = MarketClosed;
252
253
  exports.NetworkError = NetworkError;
@@ -261,7 +262,6 @@ exports.OrderNotCached = OrderNotCached;
261
262
  exports.OrderNotFillable = OrderNotFillable;
262
263
  exports.OrderNotFound = OrderNotFound;
263
264
  exports.PermissionDenied = PermissionDenied;
264
- exports.ProxyError = ProxyError;
265
265
  exports.RateLimitExceeded = RateLimitExceeded;
266
266
  exports.RequestTimeout = RequestTimeout;
267
267
  exports["default"] = errors;
@@ -7102,31 +7102,73 @@ class binance extends binance$1 {
7102
7102
  let response = undefined;
7103
7103
  if (market['option']) {
7104
7104
  response = await this.eapiPrivateDeleteAllOpenOrders(this.extend(request, params));
7105
+ //
7106
+ // {
7107
+ // "code": 0,
7108
+ // "msg": "success"
7109
+ // }
7110
+ //
7105
7111
  }
7106
7112
  else if (market['linear']) {
7107
7113
  if (isPortfolioMargin) {
7108
7114
  if (isConditional) {
7109
7115
  response = await this.papiDeleteUmConditionalAllOpenOrders(this.extend(request, params));
7116
+ //
7117
+ // {
7118
+ // "code": "200",
7119
+ // "msg": "The operation of cancel all conditional open order is done."
7120
+ // }
7121
+ //
7110
7122
  }
7111
7123
  else {
7112
7124
  response = await this.papiDeleteUmAllOpenOrders(this.extend(request, params));
7125
+ //
7126
+ // {
7127
+ // "code": 200,
7128
+ // "msg": "The operation of cancel all open order is done."
7129
+ // }
7130
+ //
7113
7131
  }
7114
7132
  }
7115
7133
  else {
7116
7134
  response = await this.fapiPrivateDeleteAllOpenOrders(this.extend(request, params));
7135
+ //
7136
+ // {
7137
+ // "code": 200,
7138
+ // "msg": "The operation of cancel all open order is done."
7139
+ // }
7140
+ //
7117
7141
  }
7118
7142
  }
7119
7143
  else if (market['inverse']) {
7120
7144
  if (isPortfolioMargin) {
7121
7145
  if (isConditional) {
7122
7146
  response = await this.papiDeleteCmConditionalAllOpenOrders(this.extend(request, params));
7147
+ //
7148
+ // {
7149
+ // "code": "200",
7150
+ // "msg": "The operation of cancel all conditional open order is done."
7151
+ // }
7152
+ //
7123
7153
  }
7124
7154
  else {
7125
7155
  response = await this.papiDeleteCmAllOpenOrders(this.extend(request, params));
7156
+ //
7157
+ // {
7158
+ // "code": 200,
7159
+ // "msg": "The operation of cancel all open order is done."
7160
+ // }
7161
+ //
7126
7162
  }
7127
7163
  }
7128
7164
  else {
7129
7165
  response = await this.dapiPrivateDeleteAllOpenOrders(this.extend(request, params));
7166
+ //
7167
+ // {
7168
+ // "code": 200,
7169
+ // "msg": "The operation of cancel all open order is done."
7170
+ // }
7171
+ //
7130
7172
  }
7131
7173
  }
7132
7174
  else if ((type === 'margin') || (marginMode !== undefined) || isPortfolioMargin) {
@@ -7138,16 +7180,63 @@ class binance extends binance$1 {
7138
7180
  request['isIsolated'] = true;
7139
7181
  }
7140
7182
  response = await this.sapiDeleteMarginOpenOrders(this.extend(request, params));
7183
+ //
7184
+ // [
7185
+ // {
7186
+ // "symbol": "BTCUSDT",
7187
+ // "isIsolated": true, // if isolated margin
7188
+ // "origClientOrderId": "E6APeyTJvkMvLMYMqu1KQ4",
7189
+ // "orderId": 11,
7190
+ // "orderListId": -1,
7191
+ // "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
7192
+ // "price": "0.089853",
7193
+ // "origQty": "0.178622",
7194
+ // "executedQty": "0.000000",
7195
+ // "cummulativeQuoteQty": "0.000000",
7196
+ // "status": "CANCELED",
7197
+ // "timeInForce": "GTC",
7198
+ // "type": "LIMIT",
7199
+ // "side": "BUY",
7200
+ // "selfTradePreventionMode": "NONE"
7201
+ // },
7202
+ // ...
7203
+ // ]
7204
+ //
7141
7205
  }
7142
7206
  }
7143
7207
  else {
7144
7208
  response = await this.privateDeleteOpenOrders(this.extend(request, params));
7209
+ //
7210
+ // [
7211
+ // {
7212
+ // "symbol": "ADAUSDT",
7213
+ // "origClientOrderId": "x-R4BD3S82662cde7a90114475b86e21",
7214
+ // "orderId": 3935107,
7215
+ // "orderListId": -1,
7216
+ // "clientOrderId": "bqM2w1oTlugfRAjnTIFBE8",
7217
+ // "transactTime": 1720589016657,
7218
+ // "price": "0.35000000",
7219
+ // "origQty": "30.00000000",
7220
+ // "executedQty": "0.00000000",
7221
+ // "cummulativeQuoteQty": "0.00000000",
7222
+ // "status": "CANCELED",
7223
+ // "timeInForce": "GTC",
7224
+ // "type": "LIMIT",
7225
+ // "side": "BUY",
7226
+ // "selfTradePreventionMode": "EXPIRE_MAKER"
7227
+ // }
7228
+ // ]
7229
+ //
7145
7230
  }
7146
7231
  if (Array.isArray(response)) {
7147
7232
  return this.parseOrders(response, market);
7148
7233
  }
7149
7234
  else {
7150
- return response;
7235
+ return [
7236
+ this.safeOrder({
7237
+ 'info': response,
7238
+ }),
7239
+ ];
7151
7240
  }
7152
7241
  }
7153
7242
  async cancelOrders(ids, symbol = undefined, params = {}) {