ccxt 4.4.36 → 4.4.38

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 (63) hide show
  1. package/README.md +7 -7
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +6 -6
  4. package/dist/cjs/src/abstract/bitfinex1.js +9 -0
  5. package/dist/cjs/src/base/Exchange.js +10 -1
  6. package/dist/cjs/src/binance.js +0 -2
  7. package/dist/cjs/src/bingx.js +93 -8
  8. package/dist/cjs/src/bitfinex.js +3178 -1161
  9. package/dist/cjs/src/bitfinex1.js +1760 -0
  10. package/dist/cjs/src/bitget.js +0 -2
  11. package/dist/cjs/src/bithumb.js +1 -1
  12. package/dist/cjs/src/bitmart.js +163 -15
  13. package/dist/cjs/src/bybit.js +3 -2
  14. package/dist/cjs/src/coinbase.js +87 -0
  15. package/dist/cjs/src/gate.js +1 -1
  16. package/dist/cjs/src/hyperliquid.js +125 -14
  17. package/dist/cjs/src/kucoin.js +76 -2
  18. package/dist/cjs/src/kucoinfutures.js +93 -5
  19. package/dist/cjs/src/ndax.js +7 -2
  20. package/dist/cjs/src/okx.js +0 -1
  21. package/dist/cjs/src/paradex.js +4 -2
  22. package/dist/cjs/src/pro/bitfinex.js +760 -271
  23. package/dist/cjs/src/pro/bitfinex1.js +675 -0
  24. package/dist/cjs/src/pro/probit.js +1 -0
  25. package/dist/cjs/src/probit.js +3 -1
  26. package/js/ccxt.d.ts +8 -8
  27. package/js/ccxt.js +6 -6
  28. package/js/src/abstract/bingx.d.ts +0 -1
  29. package/js/src/abstract/bitfinex.d.ts +135 -64
  30. package/js/src/abstract/bitfinex1.d.ts +72 -0
  31. package/js/src/base/Exchange.js +10 -1
  32. package/js/src/binance.js +0 -2
  33. package/js/src/bingx.d.ts +14 -1
  34. package/js/src/bingx.js +93 -8
  35. package/js/src/bitfinex.d.ts +316 -106
  36. package/js/src/bitfinex.js +3179 -1162
  37. package/js/src/bitfinex1.d.ts +296 -0
  38. package/js/src/bitfinex1.js +1761 -0
  39. package/js/src/bitget.js +0 -2
  40. package/js/src/bithumb.js +1 -1
  41. package/js/src/bitmart.js +163 -15
  42. package/js/src/bybit.js +3 -2
  43. package/js/src/coinbase.d.ts +33 -0
  44. package/js/src/coinbase.js +87 -0
  45. package/js/src/gate.js +1 -1
  46. package/js/src/hyperliquid.d.ts +6 -1
  47. package/js/src/hyperliquid.js +125 -14
  48. package/js/src/kucoin.js +76 -2
  49. package/js/src/kucoinfutures.js +93 -5
  50. package/js/src/ndax.d.ts +2 -0
  51. package/js/src/ndax.js +7 -2
  52. package/js/src/okx.js +0 -1
  53. package/js/src/paradex.d.ts +2 -0
  54. package/js/src/paradex.js +4 -2
  55. package/js/src/pro/bitfinex.d.ts +42 -10
  56. package/js/src/pro/bitfinex.js +761 -272
  57. package/js/src/pro/bitfinex1.d.ts +67 -0
  58. package/js/src/pro/bitfinex1.js +676 -0
  59. package/js/src/pro/probit.js +1 -0
  60. package/js/src/probit.js +3 -1
  61. package/package.json +1 -1
  62. package/js/src/abstract/bitfinex2.d.ts +0 -143
  63. /package/js/src/abstract/{bitfinex2.js → bitfinex1.js} +0 -0
@@ -908,6 +908,7 @@ class kucoin extends kucoin$1 {
908
908
  'TRUE': 'true',
909
909
  'CS': 'cs',
910
910
  'ORAI': 'orai',
911
+ 'BASE': 'base',
911
912
  // below will be uncommented after consensus
912
913
  // 'BITCOINDIAMON': 'bcd',
913
914
  // 'BITCOINGOLD': 'btg',
@@ -983,6 +984,74 @@ class kucoin extends kucoin$1 {
983
984
  'spot': 'TRADE',
984
985
  },
985
986
  },
987
+ 'features': {
988
+ 'spot': {
989
+ 'sandbox': false,
990
+ 'createOrder': {
991
+ 'marginMode': true,
992
+ 'triggerPrice': true,
993
+ 'triggerPriceType': undefined,
994
+ 'triggerDirection': false,
995
+ 'stopLossPrice': true,
996
+ 'takeProfitPrice': true,
997
+ 'attachedStopLossTakeProfit': undefined,
998
+ 'timeInForce': {
999
+ 'IOC': true,
1000
+ 'FOK': true,
1001
+ 'PO': true,
1002
+ 'GTD': true,
1003
+ },
1004
+ 'hedged': false,
1005
+ 'trailing': false,
1006
+ // exchange-supported features
1007
+ // 'iceberg': true,
1008
+ // 'selfTradePrevention': true,
1009
+ // 'twap': false,
1010
+ // 'oco': false,
1011
+ },
1012
+ 'createOrders': {
1013
+ 'max': 5,
1014
+ },
1015
+ 'fetchMyTrades': {
1016
+ 'marginMode': true,
1017
+ 'limit': undefined,
1018
+ 'daysBack': undefined,
1019
+ 'untilDays': 7, // per implementation comments
1020
+ },
1021
+ 'fetchOrder': {
1022
+ 'marginMode': false,
1023
+ 'trigger': true,
1024
+ 'trailing': false,
1025
+ },
1026
+ 'fetchOpenOrders': {
1027
+ 'marginMode': true,
1028
+ 'limit': 500,
1029
+ 'trigger': true,
1030
+ 'trailing': false,
1031
+ },
1032
+ 'fetchOrders': undefined,
1033
+ 'fetchClosedOrders': {
1034
+ 'marginMode': true,
1035
+ 'limit': 500,
1036
+ 'daysBackClosed': undefined,
1037
+ 'daysBackCanceled': undefined,
1038
+ 'untilDays': 7,
1039
+ 'trigger': true,
1040
+ 'trailing': false,
1041
+ },
1042
+ 'fetchOHLCV': {
1043
+ 'limit': 1500,
1044
+ },
1045
+ },
1046
+ 'swap': {
1047
+ 'linear': undefined,
1048
+ 'inverse': undefined,
1049
+ },
1050
+ 'future': {
1051
+ 'linear': undefined,
1052
+ 'inverse': undefined,
1053
+ },
1054
+ },
986
1055
  });
987
1056
  }
988
1057
  nonce() {
@@ -2691,7 +2760,7 @@ class kucoin extends kucoin$1 {
2691
2760
  await this.loadMarkets();
2692
2761
  let lowercaseStatus = status.toLowerCase();
2693
2762
  const until = this.safeInteger(params, 'until');
2694
- const stop = this.safeBool2(params, 'stop', 'trigger', false);
2763
+ const trigger = this.safeBool2(params, 'stop', 'trigger', false);
2695
2764
  let hf = undefined;
2696
2765
  [hf, params] = this.handleHfAndParams(params);
2697
2766
  if (hf && (symbol === undefined)) {
@@ -2724,7 +2793,7 @@ class kucoin extends kucoin$1 {
2724
2793
  }
2725
2794
  request['tradeType'] = this.safeString(this.options['marginModes'], marginMode, 'TRADE');
2726
2795
  let response = undefined;
2727
- if (stop) {
2796
+ if (trigger) {
2728
2797
  response = await this.privateGetStopOrder(this.extend(request, query));
2729
2798
  }
2730
2799
  else if (hf) {
@@ -3170,6 +3239,11 @@ class kucoin extends kucoin$1 {
3170
3239
  let response = undefined;
3171
3240
  [request, params] = this.handleUntilOption('endAt', request, params);
3172
3241
  if (hf) {
3242
+ // does not return trades earlier than 2019-02-18T00:00:00Z
3243
+ if (since !== undefined) {
3244
+ // only returns trades up to one week after the since param
3245
+ request['startAt'] = since;
3246
+ }
3173
3247
  response = await this.privateGetHfFills(this.extend(request, params));
3174
3248
  }
3175
3249
  else if (method === 'private_get_fills') {
@@ -357,6 +357,91 @@ class kucoinfutures extends kucoinfutures$1 {
357
357
  // 'code': 'BTC',
358
358
  // },
359
359
  },
360
+ 'features': {
361
+ 'spot': undefined,
362
+ 'forDerivs': {
363
+ 'sandbox': false,
364
+ 'createOrder': {
365
+ 'marginMode': true,
366
+ 'triggerPrice': true,
367
+ 'triggerPriceType': {
368
+ 'last': true,
369
+ 'mark': true,
370
+ 'index': true,
371
+ },
372
+ 'triggerDirection': true,
373
+ 'stopLossPrice': true,
374
+ 'takeProfitPrice': true,
375
+ 'attachedStopLossTakeProfit': {
376
+ 'triggerPrice': undefined,
377
+ 'triggerPriceType': undefined,
378
+ 'limitPrice': true,
379
+ },
380
+ 'timeInForce': {
381
+ 'IOC': true,
382
+ 'FOK': false,
383
+ 'PO': true,
384
+ 'GTD': false,
385
+ },
386
+ 'hedged': false,
387
+ 'trailing': false,
388
+ // exchange-supported features
389
+ // 'iceberg': true,
390
+ // 'selfTradePrevention': true,
391
+ // 'twap': false,
392
+ // 'oco': false,
393
+ },
394
+ 'createOrders': {
395
+ 'max': 20,
396
+ },
397
+ 'fetchMyTrades': {
398
+ 'marginMode': true,
399
+ 'limit': 1000,
400
+ 'daysBack': undefined,
401
+ 'untilDays': 7,
402
+ },
403
+ 'fetchOrder': {
404
+ 'marginMode': false,
405
+ 'trigger': false,
406
+ 'trailing': false,
407
+ },
408
+ 'fetchOpenOrders': {
409
+ 'marginMode': false,
410
+ 'limit': 1000,
411
+ 'trigger': true,
412
+ 'trailing': false,
413
+ },
414
+ 'fetchOrders': undefined,
415
+ 'fetchClosedOrders': {
416
+ 'marginMode': false,
417
+ 'limit': 1000,
418
+ 'daysBackClosed': undefined,
419
+ 'daysBackCanceled': undefined,
420
+ 'untilDays': undefined,
421
+ 'trigger': true,
422
+ 'trailing': false,
423
+ },
424
+ 'fetchOHLCV': {
425
+ 'limit': 500,
426
+ },
427
+ },
428
+ 'swap': {
429
+ 'linear': {
430
+ 'extends': 'forDerivs',
431
+ },
432
+ 'inverse': {
433
+ 'extends': 'forDerivs',
434
+ },
435
+ },
436
+ 'future': {
437
+ 'linear': {
438
+ 'extends': 'forDerivs',
439
+ },
440
+ 'inverse': {
441
+ 'extends': 'forDerivs',
442
+ },
443
+ },
444
+ },
360
445
  });
361
446
  }
362
447
  /**
@@ -1751,10 +1836,10 @@ class kucoinfutures extends kucoinfutures$1 {
1751
1836
  if (symbol !== undefined) {
1752
1837
  request['symbol'] = this.marketId(symbol);
1753
1838
  }
1754
- const stop = this.safeValue2(params, 'stop', 'trigger');
1839
+ const trigger = this.safeValue2(params, 'stop', 'trigger');
1755
1840
  params = this.omit(params, ['stop', 'trigger']);
1756
1841
  let response = undefined;
1757
- if (stop) {
1842
+ if (trigger) {
1758
1843
  response = await this.futuresPrivateDeleteStopOrders(this.extend(request, params));
1759
1844
  }
1760
1845
  else {
@@ -1938,7 +2023,7 @@ class kucoinfutures extends kucoinfutures$1 {
1938
2023
  if (paginate) {
1939
2024
  return await this.fetchPaginatedCallDynamic('fetchOrdersByStatus', symbol, since, limit, params);
1940
2025
  }
1941
- const stop = this.safeBool2(params, 'stop', 'trigger');
2026
+ const trigger = this.safeBool2(params, 'stop', 'trigger');
1942
2027
  const until = this.safeInteger(params, 'until');
1943
2028
  params = this.omit(params, ['stop', 'until', 'trigger']);
1944
2029
  if (status === 'closed') {
@@ -1948,7 +2033,7 @@ class kucoinfutures extends kucoinfutures$1 {
1948
2033
  status = 'active';
1949
2034
  }
1950
2035
  const request = {};
1951
- if (!stop) {
2036
+ if (!trigger) {
1952
2037
  request['status'] = status;
1953
2038
  }
1954
2039
  else if (status !== 'active') {
@@ -1966,7 +2051,7 @@ class kucoinfutures extends kucoinfutures$1 {
1966
2051
  request['endAt'] = until;
1967
2052
  }
1968
2053
  let response = undefined;
1969
- if (stop) {
2054
+ if (trigger) {
1970
2055
  response = await this.futuresPrivateGetStopOrders(this.extend(request, params));
1971
2056
  }
1972
2057
  else {
@@ -2591,6 +2676,9 @@ class kucoinfutures extends kucoinfutures$1 {
2591
2676
  if (since !== undefined) {
2592
2677
  request['startAt'] = since;
2593
2678
  }
2679
+ if (limit !== undefined) {
2680
+ request['pageSize'] = Math.min(1000, limit);
2681
+ }
2594
2682
  [request, params] = this.handleUntilOption('endAt', request, params);
2595
2683
  const response = await this.futuresPrivateGetFills(this.extend(request, params));
2596
2684
  //
@@ -1089,8 +1089,11 @@ class ndax extends ndax$1 {
1089
1089
  const omsId = this.safeInteger(this.options, 'omsId', 1);
1090
1090
  await this.loadMarkets();
1091
1091
  await this.loadAccounts();
1092
- const defaultAccountId = this.safeInteger2(this.options, 'accountId', 'AccountId', parseInt(this.accounts[0]['id']));
1093
- const accountId = this.safeInteger2(params, 'accountId', 'AccountId', defaultAccountId);
1092
+ const defaultAccountId = this.safeInteger2(this.options, 'accountId', 'AccountId');
1093
+ let accountId = this.safeInteger2(params, 'accountId', 'AccountId', defaultAccountId);
1094
+ if (accountId === undefined) {
1095
+ accountId = parseInt(this.accounts[0]['id']);
1096
+ }
1094
1097
  params = this.omit(params, ['accountId', 'AccountId']);
1095
1098
  const request = {
1096
1099
  'omsId': omsId,
@@ -1373,6 +1376,7 @@ class ndax extends ndax$1 {
1373
1376
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1374
1377
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1375
1378
  * @param {float} [params.triggerPrice] the price at which a trigger order would be triggered
1379
+ * @param {string} [params.clientOrderId] a unique id for the order
1376
1380
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1377
1381
  */
1378
1382
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -1615,6 +1619,7 @@ class ndax extends ndax$1 {
1615
1619
  * @param {string} id order id
1616
1620
  * @param {string} symbol unified symbol of the market the order was made in
1617
1621
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1622
+ * @param {string} [params.clientOrderId] a unique id for the order
1618
1623
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1619
1624
  */
1620
1625
  async cancelOrder(id, symbol = undefined, params = {}) {
@@ -1198,7 +1198,6 @@ class okx extends okx$1 {
1198
1198
  'limitPrice': true,
1199
1199
  },
1200
1200
  'timeInForce': {
1201
- 'GTC': true,
1202
1201
  'IOC': true,
1203
1202
  'FOK': true,
1204
1203
  'PO': true,
@@ -12,6 +12,8 @@ var secp256k1 = require('./static_dependencies/noble-curves/secp256k1.js');
12
12
  // ---------------------------------------------------------------------------
13
13
  /**
14
14
  * @class paradex
15
+ * @description Paradex is a decentralized exchange built on the StarkWare layer 2 scaling solution. To access private methods you can either use the ETH public key and private key by setting (exchange.privateKey and exchange.walletAddress)
16
+ * or alternatively you can provide the startknet private key and public key by setting exchange.options['paradexAccount'] with add {"privateKey": A, "publicKey": B, "address": C}
15
17
  * @augments Exchange
16
18
  */
17
19
  class paradex extends paradex$1 {
@@ -269,6 +271,7 @@ class paradex extends paradex$1 {
269
271
  'precisionMode': number.TICK_SIZE,
270
272
  'commonCurrencies': {},
271
273
  'options': {
274
+ 'paradexAccount': undefined,
272
275
  'broker': 'CCXT',
273
276
  },
274
277
  });
@@ -976,11 +979,11 @@ class paradex extends paradex$1 {
976
979
  };
977
980
  }
978
981
  async retrieveAccount() {
979
- this.checkRequiredCredentials();
980
982
  const cachedAccount = this.safeDict(this.options, 'paradexAccount');
981
983
  if (cachedAccount !== undefined) {
982
984
  return cachedAccount;
983
985
  }
986
+ this.checkRequiredCredentials();
984
987
  const systemConfig = await this.getSystemConfig();
985
988
  const domain = await this.prepareParadexDomain(true);
986
989
  const messageTypes = {
@@ -2009,7 +2012,6 @@ class paradex extends paradex$1 {
2009
2012
  }
2010
2013
  }
2011
2014
  else if (api === 'private') {
2012
- this.checkRequiredCredentials();
2013
2015
  headers = {
2014
2016
  'Accept': 'application/json',
2015
2017
  'PARADEX-PARTNER': this.safeString(this.options, 'broker', 'CCXT'),