ccxt 4.4.37 → 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.
package/dist/cjs/ccxt.js CHANGED
@@ -200,7 +200,7 @@ var xt$1 = require('./src/pro/xt.js');
200
200
 
201
201
  //-----------------------------------------------------------------------------
202
202
  // this is updated by vss.js when building
203
- const version = '4.4.37';
203
+ const version = '4.4.38';
204
204
  Exchange["default"].ccxtVersion = version;
205
205
  const exchanges = {
206
206
  'ace': ace,
@@ -2390,6 +2390,10 @@ class Exchange {
2390
2390
  }
2391
2391
  featuresMapper(initialFeatures, marketType, subType = undefined) {
2392
2392
  let featuresObj = (subType !== undefined) ? initialFeatures[marketType][subType] : initialFeatures[marketType];
2393
+ // if exchange does not have that market-type (eg. future>inverse)
2394
+ if (featuresObj === undefined) {
2395
+ return undefined;
2396
+ }
2393
2397
  const extendsStr = this.safeString(featuresObj, 'extends');
2394
2398
  if (extendsStr !== undefined) {
2395
2399
  featuresObj = this.omit(featuresObj, 'extends');
@@ -2412,7 +2416,7 @@ class Exchange {
2412
2416
  // default 'GTC' to true
2413
2417
  const gtcValue = this.safeBool(featuresObj['createOrder']['timeInForce'], 'gtc');
2414
2418
  if (gtcValue === undefined) {
2415
- featuresObj['createOrder']['timeInForce']['gtc'] = true;
2419
+ featuresObj['createOrder']['timeInForce']['GTC'] = true;
2416
2420
  }
2417
2421
  }
2418
2422
  return featuresObj;
@@ -1568,7 +1568,6 @@ class binance extends binance$1 {
1568
1568
  'takeProfitPrice': true,
1569
1569
  'attachedStopLossTakeProfit': undefined,
1570
1570
  'timeInForce': {
1571
- 'GTC': true,
1572
1571
  'IOC': true,
1573
1572
  'FOK': true,
1574
1573
  'PO': true,
@@ -1635,7 +1634,6 @@ class binance extends binance$1 {
1635
1634
  'takeProfitPrice': true,
1636
1635
  'attachedStopLossTakeProfit': undefined,
1637
1636
  'timeInForce': {
1638
- 'GTC': true,
1639
1637
  'IOC': true,
1640
1638
  'FOK': true,
1641
1639
  'PO': true,
@@ -80,7 +80,7 @@ class bingx extends bingx$1 {
80
80
  'fetchPositionHistory': false,
81
81
  'fetchPositionMode': true,
82
82
  'fetchPositions': true,
83
- 'fetchPositionsHistory': false,
83
+ 'fetchPositionsHistory': true,
84
84
  'fetchTicker': true,
85
85
  'fetchTickers': true,
86
86
  'fetchTime': true,
@@ -204,7 +204,6 @@ class bingx extends bingx$1 {
204
204
  'private': {
205
205
  'get': {
206
206
  'positionSide/dual': 5,
207
- 'market/markPriceKlines': 1,
208
207
  'trade/batchCancelReplace': 5,
209
208
  'trade/fullOrder': 2,
210
209
  'maintMarginRatio': 2,
@@ -538,7 +537,6 @@ class bingx extends bingx$1 {
538
537
  'limitPrice': true,
539
538
  },
540
539
  'timeInForce': {
541
- 'GTC': true,
542
540
  'IOC': true,
543
541
  'FOK': true,
544
542
  'PO': true,
@@ -1015,7 +1013,7 @@ class bingx extends bingx$1 {
1015
1013
  * @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#K-Line%20Data
1016
1014
  * @see https://bingx-api.github.io/docs/#/spot/market-api.html#Candlestick%20chart%20data
1017
1015
  * @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#%20K-Line%20Data
1018
- * @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#K-Line%20Data%20-%20Mark%20Price
1016
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#Mark%20Price%20Kline/Candlestick%20Data
1019
1017
  * @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Get%20K-line%20Data
1020
1018
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1021
1019
  * @param {string} timeframe the length of time each candle represents
@@ -1061,7 +1059,7 @@ class bingx extends bingx$1 {
1061
1059
  const price = this.safeString(params, 'price');
1062
1060
  params = this.omit(params, 'price');
1063
1061
  if (price === 'mark') {
1064
- response = await this.swapV1PrivateGetMarketMarkPriceKlines(this.extend(request, params));
1062
+ response = await this.swapV1PublicGetMarketMarkPriceKlines(this.extend(request, params));
1065
1063
  }
1066
1064
  else {
1067
1065
  response = await this.swapV3PublicGetQuoteKlines(this.extend(request, params));
@@ -2334,6 +2332,71 @@ class bingx extends bingx$1 {
2334
2332
  }
2335
2333
  return this.safeBalance(result);
2336
2334
  }
2335
+ /**
2336
+ * @method
2337
+ * @name bingx#fetchPositionHistory
2338
+ * @description fetches historical positions
2339
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Position%20History
2340
+ * @param {string} symbol unified contract symbol
2341
+ * @param {int} [since] the earliest time in ms to fetch positions for
2342
+ * @param {int} [limit] the maximum amount of records to fetch
2343
+ * @param {object} [params] extra parameters specific to the exchange api endpoint
2344
+ * @param {int} [params.until] the latest time in ms to fetch positions for
2345
+ * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
2346
+ */
2347
+ async fetchPositionHistory(symbol, since = undefined, limit = undefined, params = {}) {
2348
+ await this.loadMarkets();
2349
+ const market = this.market(symbol);
2350
+ let request = {
2351
+ 'symbol': market['id'],
2352
+ };
2353
+ if (limit !== undefined) {
2354
+ request['pageSize'] = limit;
2355
+ }
2356
+ if (since !== undefined) {
2357
+ request['startTs'] = since;
2358
+ }
2359
+ [request, params] = this.handleUntilOption('endTs', request, params);
2360
+ let response = undefined;
2361
+ if (market['linear']) {
2362
+ response = await this.swapV1PrivateGetTradePositionHistory(this.extend(request, params));
2363
+ }
2364
+ else {
2365
+ throw new errors.NotSupported(this.id + ' fetchPositionHistory() is not supported for inverse swap positions');
2366
+ }
2367
+ //
2368
+ // {
2369
+ // "code": 0,
2370
+ // "msg": "",
2371
+ // "data": {
2372
+ // "positionHistory": [
2373
+ // {
2374
+ // "positionId": "1861675561156571136",
2375
+ // "symbol": "LTC-USDT",
2376
+ // "isolated": false,
2377
+ // "positionSide": "LONG",
2378
+ // "openTime": 1732693017000,
2379
+ // "updateTime": 1733310292000,
2380
+ // "avgPrice": "95.18",
2381
+ // "avgClosePrice": "129.48",
2382
+ // "realisedProfit": "102.89",
2383
+ // "netProfit": "99.63",
2384
+ // "positionAmt": "30.0",
2385
+ // "closePositionAmt": "30.0",
2386
+ // "leverage": 6,
2387
+ // "closeAllPositions": true,
2388
+ // "positionCommission": "-0.33699650000000003",
2389
+ // "totalFunding": "-2.921461693902908"
2390
+ // },
2391
+ // ]
2392
+ // }
2393
+ // }
2394
+ //
2395
+ const data = this.safeDict(response, 'data', {});
2396
+ const records = this.safeList(data, 'positionHistory', []);
2397
+ const positions = this.parsePositions(records);
2398
+ return this.filterBySymbolSinceLimit(positions, symbol, since, limit);
2399
+ }
2337
2400
  /**
2338
2401
  * @method
2339
2402
  * @name bingx#fetchPositions
@@ -2582,6 +2645,27 @@ class bingx extends bingx$1 {
2582
2645
  // "positionAmt": "1.20365912",
2583
2646
  // }
2584
2647
  //
2648
+ // linear swap fetchPositionHistory
2649
+ //
2650
+ // {
2651
+ // "positionId": "1861675561156571136",
2652
+ // "symbol": "LTC-USDT",
2653
+ // "isolated": false,
2654
+ // "positionSide": "LONG",
2655
+ // "openTime": 1732693017000,
2656
+ // "updateTime": 1733310292000,
2657
+ // "avgPrice": "95.18",
2658
+ // "avgClosePrice": "129.48",
2659
+ // "realisedProfit": "102.89",
2660
+ // "netProfit": "99.63",
2661
+ // "positionAmt": "30.0",
2662
+ // "closePositionAmt": "30.0",
2663
+ // "leverage": 6,
2664
+ // "closeAllPositions": true,
2665
+ // "positionCommission": "-0.33699650000000003",
2666
+ // "totalFunding": "-2.921461693902908"
2667
+ // }
2668
+ //
2585
2669
  let marketId = this.safeString(position, 'symbol', '');
2586
2670
  marketId = marketId.replace('/', '-'); // standard return different format
2587
2671
  const isolated = this.safeBool(position, 'isolated');
@@ -2589,6 +2673,7 @@ class bingx extends bingx$1 {
2589
2673
  if (isolated !== undefined) {
2590
2674
  marginMode = isolated ? 'isolated' : 'cross';
2591
2675
  }
2676
+ const timestamp = this.safeInteger(position, 'openTime');
2592
2677
  return this.safePosition({
2593
2678
  'info': position,
2594
2679
  'id': this.safeString(position, 'positionId'),
@@ -2606,8 +2691,8 @@ class bingx extends bingx$1 {
2606
2691
  'lastPrice': undefined,
2607
2692
  'side': this.safeStringLower(position, 'positionSide'),
2608
2693
  'hedged': undefined,
2609
- 'timestamp': undefined,
2610
- 'datetime': undefined,
2694
+ 'timestamp': timestamp,
2695
+ 'datetime': this.iso8601(timestamp),
2611
2696
  'lastUpdateTimestamp': this.safeInteger(position, 'updateTime'),
2612
2697
  'maintenanceMargin': undefined,
2613
2698
  'maintenanceMarginPercentage': undefined,
@@ -6381,7 +6466,7 @@ class bingx extends bingx$1 {
6381
6466
  }
6382
6467
  else {
6383
6468
  const query = this.urlencode(parsedParams);
6384
- url += '?' + query + '&signature=' + signature;
6469
+ url += '?' + query + '&' + 'signature=' + signature;
6385
6470
  }
6386
6471
  }
6387
6472
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
@@ -1462,7 +1462,6 @@ class bitget extends bitget$1 {
1462
1462
  'limitPrice': true,
1463
1463
  },
1464
1464
  'timeInForce': {
1465
- 'GTC': true,
1466
1465
  'IOC': true,
1467
1466
  'FOK': true,
1468
1467
  'PO': true,
@@ -1533,7 +1532,6 @@ class bitget extends bitget$1 {
1533
1532
  'limitPrice': false,
1534
1533
  },
1535
1534
  'timeInForce': {
1536
- 'GTC': true,
1537
1535
  'IOC': true,
1538
1536
  'FOK': true,
1539
1537
  'PO': true,
@@ -1049,7 +1049,7 @@ class bithumb extends bithumb$1 {
1049
1049
  'address': address,
1050
1050
  'currency': currency['id'],
1051
1051
  };
1052
- if (code === 'XRP' || code === 'XMR' || code === 'EOS' || code === 'STEEM') {
1052
+ if (code === 'XRP' || code === 'XMR' || code === 'EOS' || code === 'STEEM' || code === 'TON') {
1053
1053
  const destination = this.safeString(params, 'destination');
1054
1054
  if ((tag === undefined) && (destination === undefined)) {
1055
1055
  throw new errors.ArgumentsRequired(this.id + ' ' + code + ' withdraw() requires a tag argument or an extra destination param');
@@ -685,6 +685,151 @@ class bitmart extends bitmart$1 {
685
685
  'createMarketBuyOrderRequiresPrice': true,
686
686
  'brokerId': 'CCXTxBitmart000',
687
687
  },
688
+ 'features': {
689
+ 'default': {
690
+ 'sandbox': false,
691
+ 'createOrder': {
692
+ 'marginMode': true,
693
+ 'triggerPrice': false,
694
+ 'triggerPriceType': undefined,
695
+ 'triggerDirection': false,
696
+ 'stopLossPrice': false,
697
+ 'takeProfitPrice': false,
698
+ 'attachedStopLossTakeProfit': undefined,
699
+ 'timeInForce': {
700
+ 'IOC': true,
701
+ 'FOK': false,
702
+ 'PO': true,
703
+ 'GTD': false,
704
+ },
705
+ 'hedged': false,
706
+ 'trailing': false,
707
+ 'marketBuyRequiresPrice': true,
708
+ 'marketBuyByCost': true,
709
+ // exchange-supported features
710
+ // 'leverage': true,
711
+ // 'selfTradePrevention': false,
712
+ // 'twap': false,
713
+ // 'iceberg': false,
714
+ // 'oco': false,
715
+ },
716
+ 'createOrders': {
717
+ 'max': 10,
718
+ },
719
+ 'fetchMyTrades': {
720
+ 'marginMode': true,
721
+ 'limit': 200,
722
+ 'daysBack': undefined,
723
+ 'untilDays': 99999,
724
+ },
725
+ 'fetchOrder': {
726
+ 'marginMode': false,
727
+ 'trigger': false,
728
+ 'trailing': false,
729
+ },
730
+ 'fetchOpenOrders': {
731
+ 'marginMode': true,
732
+ 'limit': 200,
733
+ 'trigger': false,
734
+ 'trailing': false,
735
+ },
736
+ 'fetchOrders': undefined,
737
+ 'fetchClosedOrders': {
738
+ 'marginMode': true,
739
+ 'limit': 200,
740
+ 'daysBackClosed': undefined,
741
+ 'daysBackCanceled': undefined,
742
+ 'untilDays': undefined,
743
+ 'trigger': false,
744
+ 'trailing': false,
745
+ },
746
+ 'fetchOHLCV': {
747
+ 'limit': 1000, // variable timespans for recent endpoint, 200 for historical
748
+ },
749
+ },
750
+ 'forDerivatives': {
751
+ 'extends': 'default',
752
+ 'createOrder': {
753
+ 'marginMode': true,
754
+ 'triggerPrice': true,
755
+ 'triggerPriceType': {
756
+ 'last': true,
757
+ 'mark': true,
758
+ 'index': false,
759
+ },
760
+ 'triggerDirection': true,
761
+ 'stopLossPrice': true,
762
+ 'takeProfitPrice': true,
763
+ 'attachedStopLossTakeProfit': {
764
+ 'triggerPriceType': {
765
+ 'last': true,
766
+ 'mark': true,
767
+ 'index': false,
768
+ },
769
+ 'limitPrice': false,
770
+ },
771
+ 'timeInForce': {
772
+ 'IOC': true,
773
+ 'FOK': true,
774
+ 'PO': true,
775
+ 'GTD': false,
776
+ },
777
+ 'hedged': false,
778
+ 'trailing': true,
779
+ 'marketBuyRequiresPrice': true,
780
+ 'marketBuyByCost': true,
781
+ // exchange-supported features
782
+ // 'selfTradePrevention': true,
783
+ // 'twap': false,
784
+ // 'iceberg': false,
785
+ // 'oco': false,
786
+ },
787
+ 'fetchMyTrades': {
788
+ 'marginMode': true,
789
+ 'limit': undefined,
790
+ 'daysBack': undefined,
791
+ 'untilDays': 99999,
792
+ },
793
+ 'fetchOrder': {
794
+ 'marginMode': false,
795
+ 'trigger': false,
796
+ 'trailing': true,
797
+ },
798
+ 'fetchOpenOrders': {
799
+ 'marginMode': false,
800
+ 'limit': 100,
801
+ 'trigger': true,
802
+ 'trailing': false,
803
+ },
804
+ 'fetchClosedOrders': {
805
+ 'marginMode': true,
806
+ 'limit': 200,
807
+ 'daysBackClosed': undefined,
808
+ 'daysBackCanceled': undefined,
809
+ 'untilDays': undefined,
810
+ 'trigger': false,
811
+ 'trailing': false,
812
+ },
813
+ 'fetchOHLCV': {
814
+ 'limit': 500,
815
+ },
816
+ },
817
+ 'spot': {
818
+ 'extends': 'default',
819
+ },
820
+ 'swap': {
821
+ 'linear': {
822
+ 'extends': 'forDerivatives',
823
+ },
824
+ 'inverse': {
825
+ 'extends': 'forDerivatives',
826
+ },
827
+ },
828
+ 'future': {
829
+ 'linear': undefined,
830
+ 'inverse': undefined,
831
+ },
832
+ },
688
833
  });
689
834
  }
690
835
  /**
@@ -1951,11 +2096,12 @@ class bitmart extends bitmart$1 {
1951
2096
  request['orderMode'] = 'iso_margin';
1952
2097
  }
1953
2098
  const options = this.safeDict(this.options, 'fetchMyTrades', {});
1954
- const defaultLimit = this.safeInteger(options, 'limit', 200);
2099
+ const maxLimit = 200;
2100
+ const defaultLimit = this.safeInteger(options, 'limit', maxLimit);
1955
2101
  if (limit === undefined) {
1956
2102
  limit = defaultLimit;
1957
2103
  }
1958
- request['limit'] = limit;
2104
+ request['limit'] = Math.min(limit, maxLimit);
1959
2105
  if (since !== undefined) {
1960
2106
  request['startTime'] = since;
1961
2107
  }
@@ -2639,8 +2785,7 @@ class bitmart extends bitmart$1 {
2639
2785
  * @name bitmart#createSwapOrderRequest
2640
2786
  * @ignore
2641
2787
  * @description create a trade order
2642
- * @see https://developer-pro.bitmart.com/en/futures/#submit-order-signed
2643
- * @see https://developer-pro.bitmart.com/en/futures/#submit-plan-order-signed
2788
+ * @see https://developer-pro.bitmart.com/en/futuresv2/#submit-order-signed
2644
2789
  * @see https://developer-pro.bitmart.com/en/futuresv2/#submit-plan-order-signed
2645
2790
  * @see https://developer-pro.bitmart.com/en/futuresv2/#submit-tp-or-sl-order-signed
2646
2791
  * @param {string} symbol unified symbol of the market to create an order in
@@ -3159,13 +3304,13 @@ class bitmart extends bitmart$1 {
3159
3304
  market = this.market(symbol);
3160
3305
  request['symbol'] = market['id'];
3161
3306
  }
3162
- if (limit !== undefined) {
3163
- request['limit'] = limit;
3164
- }
3165
3307
  let type = undefined;
3166
3308
  let response = undefined;
3167
3309
  [type, params] = this.handleMarketTypeAndParams('fetchOpenOrders', market, params);
3168
3310
  if (type === 'spot') {
3311
+ if (limit !== undefined) {
3312
+ request['limit'] = Math.min(limit, 200);
3313
+ }
3169
3314
  let marginMode = undefined;
3170
3315
  [marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrders', params);
3171
3316
  if (marginMode === 'isolated') {
@@ -3182,9 +3327,12 @@ class bitmart extends bitmart$1 {
3182
3327
  response = await this.privatePostSpotV4QueryOpenOrders(this.extend(request, params));
3183
3328
  }
3184
3329
  else if (type === 'swap') {
3185
- const isStop = this.safeBool2(params, 'stop', 'trigger');
3330
+ if (limit !== undefined) {
3331
+ request['limit'] = Math.min(limit, 100);
3332
+ }
3333
+ const isTrigger = this.safeBool2(params, 'stop', 'trigger');
3186
3334
  params = this.omit(params, ['stop', 'trigger']);
3187
- if (isStop) {
3335
+ if (isTrigger) {
3188
3336
  response = await this.privateGetContractPrivateCurrentPlanOrder(this.extend(request, params));
3189
3337
  }
3190
3338
  else {
@@ -3290,13 +3438,8 @@ class bitmart extends bitmart$1 {
3290
3438
  throw new errors.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
3291
3439
  }
3292
3440
  }
3293
- let marginMode = undefined;
3294
- [marginMode, params] = this.handleMarginModeAndParams('fetchClosedOrders', params);
3295
- if (marginMode === 'isolated') {
3296
- request['orderMode'] = 'iso_margin';
3297
- }
3298
- const startTimeKey = (type === 'spot') ? 'startTime' : 'start_time';
3299
3441
  if (since !== undefined) {
3442
+ const startTimeKey = (type === 'spot') ? 'startTime' : 'start_time';
3300
3443
  request[startTimeKey] = since;
3301
3444
  }
3302
3445
  const endTimeKey = (type === 'spot') ? 'endTime' : 'end_time';
@@ -3307,6 +3450,11 @@ class bitmart extends bitmart$1 {
3307
3450
  }
3308
3451
  let response = undefined;
3309
3452
  if (type === 'spot') {
3453
+ let marginMode = undefined;
3454
+ [marginMode, params] = this.handleMarginModeAndParams('fetchClosedOrders', params);
3455
+ if (marginMode === 'isolated') {
3456
+ request['orderMode'] = 'iso_margin';
3457
+ }
3310
3458
  response = await this.privatePostSpotV4QueryHistoryOrders(this.extend(request, params));
3311
3459
  }
3312
3460
  else {
@@ -659,6 +659,9 @@ class bybit extends bybit$1 {
659
659
  '110071': errors.ExchangeError,
660
660
  '110072': errors.InvalidOrder,
661
661
  '110073': errors.ExchangeError,
662
+ '110092': errors.InvalidOrder,
663
+ '110093': errors.InvalidOrder,
664
+ '110094': errors.InvalidOrder,
662
665
  '130006': errors.InvalidOrder,
663
666
  '130021': errors.InsufficientFunds,
664
667
  '130074': errors.InvalidOrder,
@@ -1098,7 +1101,6 @@ class bybit extends bybit$1 {
1098
1101
  'limitPrice': true,
1099
1102
  },
1100
1103
  'timeInForce': {
1101
- 'GTC': true,
1102
1104
  'IOC': true,
1103
1105
  'FOK': true,
1104
1106
  'PO': true,
@@ -1160,7 +1162,6 @@ class bybit extends bybit$1 {
1160
1162
  'limitPrice': true,
1161
1163
  },
1162
1164
  'timeInForce': {
1163
- 'GTC': true,
1164
1165
  'IOC': true,
1165
1166
  'FOK': true,
1166
1167
  'PO': true,
@@ -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') {