ccxt 4.2.89 → 4.2.90

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 (78) hide show
  1. package/README.md +3 -3
  2. package/build.sh +1 -1
  3. package/dist/ccxt.browser.js +829 -114
  4. package/dist/ccxt.browser.min.js +6 -4
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/ascendex.js +1 -0
  7. package/dist/cjs/src/base/Exchange.js +38 -0
  8. package/dist/cjs/src/base/functions/crypto.js +37 -0
  9. package/dist/cjs/src/base/functions/rsa.js +19 -4
  10. package/dist/cjs/src/binance.js +90 -9
  11. package/dist/cjs/src/bingx.js +101 -1
  12. package/dist/cjs/src/bitfinex2.js +1 -0
  13. package/dist/cjs/src/bitget.js +2 -0
  14. package/dist/cjs/src/bitmex.js +1 -0
  15. package/dist/cjs/src/bitrue.js +1 -0
  16. package/dist/cjs/src/bybit.js +61 -0
  17. package/dist/cjs/src/coinbase.js +48 -24
  18. package/dist/cjs/src/coinbaseinternational.js +1 -0
  19. package/dist/cjs/src/coinex.js +102 -8
  20. package/dist/cjs/src/cryptocom.js +1 -0
  21. package/dist/cjs/src/delta.js +1 -0
  22. package/dist/cjs/src/digifinex.js +1 -0
  23. package/dist/cjs/src/exmo.js +1 -0
  24. package/dist/cjs/src/gate.js +2 -0
  25. package/dist/cjs/src/gemini.js +10 -9
  26. package/dist/cjs/src/hitbtc.js +1 -0
  27. package/dist/cjs/src/htx.js +1 -0
  28. package/dist/cjs/src/hyperliquid.js +1 -0
  29. package/dist/cjs/src/kucoin.js +1 -0
  30. package/dist/cjs/src/kucoinfutures.js +34 -3
  31. package/dist/cjs/src/mexc.js +1 -0
  32. package/dist/cjs/src/okx.js +157 -8
  33. package/dist/cjs/src/phemex.js +1 -0
  34. package/dist/cjs/src/static_dependencies/noble-curves/p256.js +48 -0
  35. package/dist/cjs/src/woo.js +1 -0
  36. package/js/ccxt.d.ts +1 -1
  37. package/js/ccxt.js +1 -1
  38. package/js/src/abstract/bingx.d.ts +2 -0
  39. package/js/src/abstract/bybit.d.ts +2 -0
  40. package/js/src/ascendex.js +1 -0
  41. package/js/src/base/Exchange.d.ts +5 -0
  42. package/js/src/base/Exchange.js +38 -0
  43. package/js/src/base/functions/crypto.js +37 -0
  44. package/js/src/base/functions/rsa.d.ts +1 -1
  45. package/js/src/base/functions/rsa.js +21 -5
  46. package/js/src/base/types.d.ts +1 -0
  47. package/js/src/binance.d.ts +1 -0
  48. package/js/src/binance.js +90 -9
  49. package/js/src/bingx.d.ts +1 -0
  50. package/js/src/bingx.js +101 -1
  51. package/js/src/bitfinex2.js +1 -0
  52. package/js/src/bitget.js +2 -0
  53. package/js/src/bitmex.js +1 -0
  54. package/js/src/bitrue.js +1 -0
  55. package/js/src/bybit.d.ts +2 -0
  56. package/js/src/bybit.js +61 -0
  57. package/js/src/coinbase.js +48 -24
  58. package/js/src/coinbaseinternational.js +1 -0
  59. package/js/src/coinex.d.ts +2 -0
  60. package/js/src/coinex.js +102 -8
  61. package/js/src/cryptocom.js +1 -0
  62. package/js/src/delta.js +1 -0
  63. package/js/src/digifinex.js +1 -0
  64. package/js/src/exmo.js +1 -0
  65. package/js/src/gate.js +2 -0
  66. package/js/src/gemini.js +10 -9
  67. package/js/src/hitbtc.js +1 -0
  68. package/js/src/htx.js +1 -0
  69. package/js/src/hyperliquid.js +1 -0
  70. package/js/src/kucoin.js +1 -0
  71. package/js/src/kucoinfutures.d.ts +2 -9
  72. package/js/src/kucoinfutures.js +34 -3
  73. package/js/src/mexc.js +1 -0
  74. package/js/src/okx.d.ts +1 -0
  75. package/js/src/okx.js +157 -8
  76. package/js/src/phemex.js +1 -0
  77. package/js/src/woo.js +1 -0
  78. package/package.json +1 -1
@@ -5,6 +5,7 @@ var errors = require('./base/errors.js');
5
5
  var Precise = require('./base/Precise.js');
6
6
  var number = require('./base/functions/number.js');
7
7
  var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
8
+ var rsa = require('./base/functions/rsa.js');
8
9
 
9
10
  // ----------------------------------------------------------------------------
10
11
  // ----------------------------------------------------------------------------
@@ -3783,31 +3784,16 @@ class coinbase extends coinbase$1 {
3783
3784
  const url = this.urls['api']['rest'] + fullPath;
3784
3785
  if (signed) {
3785
3786
  const authorization = this.safeString(this.headers, 'Authorization');
3787
+ let authorizationString = undefined;
3786
3788
  if (authorization !== undefined) {
3787
- headers = {
3788
- 'Authorization': authorization,
3789
- 'Content-Type': 'application/json',
3790
- };
3791
- if (method !== 'GET') {
3792
- if (Object.keys(query).length) {
3793
- body = this.json(query);
3794
- }
3795
- }
3789
+ authorizationString = authorization;
3796
3790
  }
3797
3791
  else if (this.token && !this.checkRequiredCredentials(false)) {
3798
- headers = {
3799
- 'Authorization': 'Bearer ' + this.token,
3800
- 'Content-Type': 'application/json',
3801
- };
3802
- if (method !== 'GET') {
3803
- if (Object.keys(query).length) {
3804
- body = this.json(query);
3805
- }
3806
- }
3792
+ authorizationString = 'Bearer ' + this.token;
3807
3793
  }
3808
3794
  else {
3809
3795
  this.checkRequiredCredentials();
3810
- const timestampString = this.seconds().toString();
3796
+ const seconds = this.seconds();
3811
3797
  let payload = '';
3812
3798
  if (method !== 'GET') {
3813
3799
  if (Object.keys(query).length) {
@@ -3826,14 +3812,52 @@ class coinbase extends coinbase$1 {
3826
3812
  // https://docs.cloud.coinbase.com/advanced-trade-api/docs/auth#example-request
3827
3813
  // v2: 'GET' require payload in the signature
3828
3814
  // https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-key-authentication
3829
- const auth = timestampString + method + savedPath + payload;
3830
- const signature = this.hmac(this.encode(auth), this.encode(this.secret), sha256.sha256);
3815
+ const isCloudAPiKey = (this.apiKey.indexOf('organizations/') >= 0) || (this.secret.startsWith('-----BEGIN'));
3816
+ if (isCloudAPiKey) {
3817
+ if (this.apiKey.startsWith('-----BEGIN')) {
3818
+ throw new errors.ArgumentsRequired(this.id + ' apiKey should contain the name (eg: organizations/3b910e93....) and not the public key');
3819
+ }
3820
+ // it may not work for v2
3821
+ let uri = method + ' ' + url.replace('https://', '');
3822
+ const quesPos = uri.indexOf('?');
3823
+ if (quesPos >= 0) {
3824
+ uri = uri.slice(0, quesPos);
3825
+ }
3826
+ const nonce = this.randomBytes(16);
3827
+ const request = {
3828
+ 'aud': ['retail_rest_api_proxy'],
3829
+ 'iss': 'coinbase-cloud',
3830
+ 'nbf': seconds,
3831
+ 'exp': seconds + 120,
3832
+ 'sub': this.apiKey,
3833
+ 'uri': uri,
3834
+ 'iat': seconds,
3835
+ };
3836
+ const token = rsa.jwt(request, this.encode(this.secret), sha256.sha256, false, { 'kid': this.apiKey, 'nonce': nonce, 'alg': 'ES256' });
3837
+ authorizationString = 'Bearer ' + token;
3838
+ }
3839
+ else {
3840
+ const timestampString = this.seconds().toString();
3841
+ const auth = timestampString + method + savedPath + payload;
3842
+ const signature = this.hmac(this.encode(auth), this.encode(this.secret), sha256.sha256);
3843
+ headers = {
3844
+ 'CB-ACCESS-KEY': this.apiKey,
3845
+ 'CB-ACCESS-SIGN': signature,
3846
+ 'CB-ACCESS-TIMESTAMP': timestampString,
3847
+ 'Content-Type': 'application/json',
3848
+ };
3849
+ }
3850
+ }
3851
+ if (authorizationString !== undefined) {
3831
3852
  headers = {
3832
- 'CB-ACCESS-KEY': this.apiKey,
3833
- 'CB-ACCESS-SIGN': signature,
3834
- 'CB-ACCESS-TIMESTAMP': timestampString,
3853
+ 'Authorization': authorizationString,
3835
3854
  'Content-Type': 'application/json',
3836
3855
  };
3856
+ if (method !== 'GET') {
3857
+ if (Object.keys(query).length) {
3858
+ body = this.json(query);
3859
+ }
3860
+ }
3837
3861
  }
3838
3862
  }
3839
3863
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
@@ -76,6 +76,7 @@ class coinbaseinternational extends coinbaseinternational$1 {
76
76
  'fetchLedger': false,
77
77
  'fetchLeverage': false,
78
78
  'fetchLeverageTiers': false,
79
+ 'fetchMarginAdjustmentHistory': false,
79
80
  'fetchMarginMode': false,
80
81
  'fetchMarkets': true,
81
82
  'fetchMarkOHLCV': false,
@@ -80,6 +80,7 @@ class coinex extends coinex$1 {
80
80
  'fetchLeverage': 'emulated',
81
81
  'fetchLeverages': true,
82
82
  'fetchLeverageTiers': true,
83
+ 'fetchMarginAdjustmentHistory': true,
83
84
  'fetchMarketLeverageTiers': 'emulated',
84
85
  'fetchMarkets': true,
85
86
  'fetchMarkOHLCV': false,
@@ -4239,11 +4240,10 @@ class coinex extends coinex$1 {
4239
4240
  // "message":"OK"
4240
4241
  // }
4241
4242
  //
4243
+ const data = this.safeDict(response, 'data');
4242
4244
  const status = this.safeString(response, 'message');
4243
- const type = (addOrReduce === 1) ? 'add' : 'reduce';
4244
- return this.extend(this.parseMarginModification(response, market), {
4245
+ return this.extend(this.parseMarginModification(data, market), {
4245
4246
  'amount': this.parseNumber(amount),
4246
- 'type': type,
4247
4247
  'status': status,
4248
4248
  });
4249
4249
  }
@@ -4303,13 +4303,34 @@ class coinex extends coinex$1 {
4303
4303
  // "user_id": 3620173
4304
4304
  // }
4305
4305
  //
4306
- const timestamp = this.safeIntegerProduct(data, 'update_time', 1000);
4306
+ // fetchMarginAdjustmentHistory
4307
+ //
4308
+ // {
4309
+ // bkr_price: '0',
4310
+ // leverage: '3',
4311
+ // liq_price: '0',
4312
+ // margin_amount: '5.33236666666666666666',
4313
+ // margin_change: '3',
4314
+ // market: 'XRPUSDT',
4315
+ // position_amount: '11',
4316
+ // position_id: '297155652',
4317
+ // position_type: '2',
4318
+ // settle_price: '0.6361',
4319
+ // time: '1711050906.382891',
4320
+ // type: '1',
4321
+ // user_id: '3685860'
4322
+ // }
4323
+ //
4324
+ const marketId = this.safeString(data, 'market');
4325
+ const type = this.safeString(data, 'type');
4326
+ const timestamp = this.safeIntegerProduct2(data, 'time', 'update_time', 1000);
4307
4327
  return {
4308
4328
  'info': data,
4309
- 'symbol': this.safeSymbol(undefined, market),
4310
- 'type': undefined,
4311
- 'amount': this.safeNumber(data, 'margin_amount'),
4312
- 'total': undefined,
4329
+ 'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
4330
+ 'type': (type === '1') ? 'add' : 'reduce',
4331
+ 'marginMode': 'isolated',
4332
+ 'amount': this.safeNumber(data, 'margin_change'),
4333
+ 'total': this.safeNumber(data, 'position_amount'),
4313
4334
  'code': market['quote'],
4314
4335
  'status': undefined,
4315
4336
  'timestamp': timestamp,
@@ -4960,6 +4981,7 @@ class coinex extends coinex$1 {
4960
4981
  const currencyId = this.safeString(transfer, 'asset');
4961
4982
  const currencyCode = this.safeCurrencyCode(currencyId, currency);
4962
4983
  return {
4984
+ 'info': transfer,
4963
4985
  'id': this.safeInteger(transfer, 'id'),
4964
4986
  'timestamp': timestamp,
4965
4987
  'datetime': this.iso8601(timestamp),
@@ -5792,6 +5814,78 @@ class coinex extends coinex$1 {
5792
5814
  }
5793
5815
  return undefined;
5794
5816
  }
5817
+ async fetchMarginAdjustmentHistory(symbol = undefined, type = undefined, since = undefined, limit = undefined, params = {}) {
5818
+ /**
5819
+ * @method
5820
+ * @name coinex#fetchMarginAdjustmentHistory
5821
+ * @description fetches the history of margin added or reduced from contract isolated positions
5822
+ * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http046_position_margin_history
5823
+ * @param {string} [symbol] unified market symbol
5824
+ * @param {string} [type] not used by coinex fetchMarginAdjustmentHistory
5825
+ * @param {int} [since] timestamp in ms of the earliest change to fetch
5826
+ * @param {int} [limit] the maximum amount of changes to fetch, default=100, max=100
5827
+ * @param {object} params extra parameters specific to the exchange api endpoint
5828
+ * @param {int} [params.until] timestamp in ms of the latest change to fetch
5829
+ *
5830
+ * EXCHANGE SPECIFIC PARAMETERS
5831
+ * @param {int} [params.offset] offset
5832
+ * @returns {object[]} a list of [margin structures]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
5833
+ */
5834
+ await this.loadMarkets();
5835
+ const until = this.safeInteger(params, 'until');
5836
+ params = this.omit(params, 'until');
5837
+ if (limit === undefined) {
5838
+ limit = 100;
5839
+ }
5840
+ const request = {
5841
+ 'market': '',
5842
+ 'position_id': 0,
5843
+ 'offset': 0,
5844
+ 'limit': limit,
5845
+ };
5846
+ if (symbol !== undefined) {
5847
+ const market = this.market(symbol);
5848
+ request['market'] = market['id'];
5849
+ }
5850
+ if (since !== undefined) {
5851
+ request['start_time'] = since;
5852
+ }
5853
+ if (until !== undefined) {
5854
+ request['end_time'] = until;
5855
+ }
5856
+ const response = await this.v1PerpetualPrivateGetPositionMarginHistory(this.extend(request, params));
5857
+ //
5858
+ // {
5859
+ // code: '0',
5860
+ // data: {
5861
+ // limit: '100',
5862
+ // offset: '0',
5863
+ // records: [
5864
+ // {
5865
+ // bkr_price: '0',
5866
+ // leverage: '3',
5867
+ // liq_price: '0',
5868
+ // margin_amount: '5.33236666666666666666',
5869
+ // margin_change: '3',
5870
+ // market: 'XRPUSDT',
5871
+ // position_amount: '11',
5872
+ // position_id: '297155652',
5873
+ // position_type: '2',
5874
+ // settle_price: '0.6361',
5875
+ // time: '1711050906.382891',
5876
+ // type: '1',
5877
+ // user_id: '3685860'
5878
+ // }
5879
+ // ]
5880
+ // },
5881
+ // message: 'OK'
5882
+ // }
5883
+ //
5884
+ const data = this.safeDict(response, 'data', {});
5885
+ const records = this.safeList(data, 'records', []);
5886
+ const modifications = this.parseMarginModifications(records, undefined, 'market', 'swap');
5887
+ return this.filterBySymbolSinceLimit(modifications, symbol, since, limit);
5888
+ }
5795
5889
  }
5796
5890
 
5797
5891
  module.exports = coinex;
@@ -66,6 +66,7 @@ class cryptocom extends cryptocom$1 {
66
66
  'fetchLedger': true,
67
67
  'fetchLeverage': false,
68
68
  'fetchLeverageTiers': false,
69
+ 'fetchMarginAdjustmentHistory': false,
69
70
  'fetchMarginMode': false,
70
71
  'fetchMarketLeverageTiers': false,
71
72
  'fetchMarkets': true,
@@ -2665,6 +2665,7 @@ class delta extends delta$1 {
2665
2665
  'info': data,
2666
2666
  'symbol': market['symbol'],
2667
2667
  'type': undefined,
2668
+ 'marginMode': 'isolated',
2668
2669
  'amount': undefined,
2669
2670
  'total': this.safeNumber(data, 'margin'),
2670
2671
  'code': undefined,
@@ -4135,6 +4135,7 @@ class digifinex extends digifinex$1 {
4135
4135
  'info': data,
4136
4136
  'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
4137
4137
  'type': (rawType === 1) ? 'add' : 'reduce',
4138
+ 'marginMode': 'isolated',
4138
4139
  'amount': this.safeNumber(data, 'amount'),
4139
4140
  'total': undefined,
4140
4141
  'code': market['settle'],
@@ -264,6 +264,7 @@ class exmo extends exmo$1 {
264
264
  'info': data,
265
265
  'symbol': this.safeSymbol(undefined, market),
266
266
  'type': undefined,
267
+ 'marginMode': 'isolated',
267
268
  'amount': undefined,
268
269
  'total': undefined,
269
270
  'code': this.safeValue(market, 'quote'),
@@ -120,6 +120,7 @@ class gate extends gate$1 {
120
120
  'fetchLeverages': true,
121
121
  'fetchLeverageTiers': true,
122
122
  'fetchLiquidations': true,
123
+ 'fetchMarginAdjustmentHistory': false,
123
124
  'fetchMarginMode': false,
124
125
  'fetchMarketLeverageTiers': true,
125
126
  'fetchMarkets': true,
@@ -6119,6 +6120,7 @@ class gate extends gate$1 {
6119
6120
  'info': data,
6120
6121
  'symbol': market['symbol'],
6121
6122
  'type': undefined,
6123
+ 'marginMode': 'isolated',
6122
6124
  'amount': undefined,
6123
6125
  'total': total,
6124
6126
  'code': this.safeValue(market, 'quote'),
@@ -107,6 +107,7 @@ class gemini extends gemini$1 {
107
107
  // https://github.com/ccxt/ccxt/issues/7874
108
108
  // https://github.com/ccxt/ccxt/issues/7894
109
109
  'web': 'https://docs.gemini.com',
110
+ 'webExchange': 'https://exchange.gemini.com',
110
111
  },
111
112
  'fees': [
112
113
  'https://gemini.com/api-fee-schedule',
@@ -644,7 +645,7 @@ class gemini extends gemini$1 {
644
645
  let quoteId = undefined;
645
646
  let settleId = undefined;
646
647
  let tickSize = undefined;
647
- let increment = undefined;
648
+ let amountPrecision = undefined;
648
649
  let minSize = undefined;
649
650
  let status = undefined;
650
651
  let swap = false;
@@ -655,9 +656,9 @@ class gemini extends gemini$1 {
655
656
  const isArray = (Array.isArray(response));
656
657
  if (!isString && !isArray) {
657
658
  marketId = this.safeStringLower(response, 'symbol');
659
+ amountPrecision = this.safeNumber(response, 'tick_size'); // right, exchange has an imperfect naming and this turns out to be an amount-precision
660
+ tickSize = this.safeNumber(response, 'quote_increment'); // this is tick-size actually
658
661
  minSize = this.safeNumber(response, 'min_order_size');
659
- tickSize = this.safeNumber(response, 'tick_size');
660
- increment = this.safeNumber(response, 'quote_increment');
661
662
  status = this.parseMarketActive(this.safeString(response, 'status'));
662
663
  baseId = this.safeString(response, 'base_currency');
663
664
  quoteId = this.safeString(response, 'quote_currency');
@@ -670,9 +671,9 @@ class gemini extends gemini$1 {
670
671
  }
671
672
  else {
672
673
  marketId = this.safeStringLower(response, 0);
673
- minSize = this.safeNumber(response, 3);
674
- tickSize = this.parseNumber(this.parsePrecision(this.safeString(response, 1)));
675
- increment = this.parseNumber(this.parsePrecision(this.safeString(response, 2)));
674
+ tickSize = this.parseNumber(this.parsePrecision(this.safeString(response, 1))); // priceTickDecimalPlaces
675
+ amountPrecision = this.parseNumber(this.parsePrecision(this.safeString(response, 2))); // quantityTickDecimalPlaces
676
+ minSize = this.safeNumber(response, 3); // quantityMinimum
676
677
  }
677
678
  const marketIdUpper = marketId.toUpperCase();
678
679
  const isPerp = (marketIdUpper.indexOf('PERP') >= 0);
@@ -727,8 +728,8 @@ class gemini extends gemini$1 {
727
728
  'strike': undefined,
728
729
  'optionType': undefined,
729
730
  'precision': {
730
- 'price': increment,
731
- 'amount': tickSize,
731
+ 'price': tickSize,
732
+ 'amount': amountPrecision,
732
733
  },
733
734
  'limits': {
734
735
  'leverage': {
@@ -1802,7 +1803,7 @@ class gemini extends gemini$1 {
1802
1803
  if (apiKey.indexOf('account') < 0) {
1803
1804
  throw new errors.AuthenticationError(this.id + ' sign() requires an account-key, master-keys are not-supported');
1804
1805
  }
1805
- const nonce = this.nonce();
1806
+ const nonce = this.nonce().toString();
1806
1807
  const request = this.extend({
1807
1808
  'request': url,
1808
1809
  'nonce': nonce,
@@ -3321,6 +3321,7 @@ class hitbtc extends hitbtc$1 {
3321
3321
  'info': data,
3322
3322
  'symbol': market['symbol'],
3323
3323
  'type': undefined,
3324
+ 'marginMode': 'isolated',
3324
3325
  'amount': undefined,
3325
3326
  'total': undefined,
3326
3327
  'code': this.safeString(currencyInfo, 'code'),
@@ -84,6 +84,7 @@ class htx extends htx$1 {
84
84
  'fetchLeverage': false,
85
85
  'fetchLeverageTiers': true,
86
86
  'fetchLiquidations': true,
87
+ 'fetchMarginAdjustmentHistory': false,
87
88
  'fetchMarketLeverageTiers': true,
88
89
  'fetchMarkets': true,
89
90
  'fetchMarkOHLCV': true,
@@ -2137,6 +2137,7 @@ class hyperliquid extends hyperliquid$1 {
2137
2137
  'info': data,
2138
2138
  'symbol': this.safeSymbol(undefined, market),
2139
2139
  'type': undefined,
2140
+ 'marginMode': 'isolated',
2140
2141
  'amount': undefined,
2141
2142
  'total': undefined,
2142
2143
  'code': this.safeString(market, 'settle'),
@@ -73,6 +73,7 @@ class kucoin extends kucoin$1 {
73
73
  'fetchL3OrderBook': true,
74
74
  'fetchLedger': true,
75
75
  'fetchLeverageTiers': false,
76
+ 'fetchMarginAdjustmentHistory': false,
76
77
  'fetchMarginMode': false,
77
78
  'fetchMarketLeverageTiers': false,
78
79
  'fetchMarkets': true,
@@ -67,6 +67,7 @@ class kucoinfutures extends kucoinfutures$1 {
67
67
  'fetchL3OrderBook': true,
68
68
  'fetchLedger': true,
69
69
  'fetchLeverageTiers': false,
70
+ 'fetchMarginAdjustmentHistory': false,
70
71
  'fetchMarginMode': false,
71
72
  'fetchMarketLeverageTiers': true,
72
73
  'fetchMarkets': true,
@@ -1613,14 +1614,18 @@ class kucoinfutures extends kucoinfutures$1 {
1613
1614
  const crossMode = this.safeValue(info, 'crossMode');
1614
1615
  const mode = crossMode ? 'cross' : 'isolated';
1615
1616
  const marketId = this.safeString(market, 'symbol');
1617
+ const timestamp = this.safeInteger(info, 'currentTimestamp');
1616
1618
  return {
1617
1619
  'info': info,
1618
- 'direction': undefined,
1619
- 'mode': mode,
1620
+ 'symbol': this.safeSymbol(marketId, market),
1621
+ 'type': undefined,
1622
+ 'marginMode': mode,
1620
1623
  'amount': undefined,
1624
+ 'total': undefined,
1621
1625
  'code': this.safeCurrencyCode(currencyId),
1622
- 'symbol': this.safeSymbol(marketId, market),
1623
1626
  'status': undefined,
1627
+ 'timestamp': timestamp,
1628
+ 'datetime': this.iso8601(timestamp),
1624
1629
  };
1625
1630
  }
1626
1631
  async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -1761,6 +1766,32 @@ class kucoinfutures extends kucoinfutures$1 {
1761
1766
  }
1762
1767
  return await this.fetchOrdersByStatus('done', symbol, since, limit, params);
1763
1768
  }
1769
+ async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1770
+ /**
1771
+ * @method
1772
+ * @name kucoinfutures#fetchOpenOrders
1773
+ * @description fetches information on multiple open orders made by the user
1774
+ * @see https://docs.kucoin.com/futures/#get-order-list
1775
+ * @see https://docs.kucoin.com/futures/#get-untriggered-stop-order-list
1776
+ * @param {string} symbol unified market symbol of the market orders were made in
1777
+ * @param {int} [since] the earliest time in ms to fetch orders for
1778
+ * @param {int} [limit] the maximum number of order structures to retrieve
1779
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1780
+ * @param {int} [params.till] end time in ms
1781
+ * @param {string} [params.side] buy or sell
1782
+ * @param {string} [params.type] limit, or market
1783
+ * @param {boolean} [params.trigger] set to true to retrieve untriggered stop orders
1784
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
1785
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1786
+ */
1787
+ await this.loadMarkets();
1788
+ let paginate = false;
1789
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
1790
+ if (paginate) {
1791
+ return await this.fetchPaginatedCallDynamic('fetchOpenOrders', symbol, since, limit, params);
1792
+ }
1793
+ return await this.fetchOrdersByStatus('open', symbol, since, limit, params);
1794
+ }
1764
1795
  async fetchOrder(id = undefined, symbol = undefined, params = {}) {
1765
1796
  /**
1766
1797
  * @method
@@ -75,6 +75,7 @@ class mexc extends mexc$1 {
75
75
  'fetchLeverage': true,
76
76
  'fetchLeverages': false,
77
77
  'fetchLeverageTiers': true,
78
+ 'fetchMarginAdjustmentHistory': false,
78
79
  'fetchMarginMode': false,
79
80
  'fetchMarketLeverageTiers': undefined,
80
81
  'fetchMarkets': true,