ccxt 4.1.13 → 4.1.16

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 (152) hide show
  1. package/CHANGELOG.md +219 -0
  2. package/CONTRIBUTING.md +1 -0
  3. package/README.md +3 -3
  4. package/dist/ccxt.browser.js +539 -189
  5. package/dist/ccxt.browser.min.js +9 -9
  6. package/dist/cjs/ccxt.js +1 -1
  7. package/dist/cjs/src/ascendex.js +1 -0
  8. package/dist/cjs/src/base/Exchange.js +3 -0
  9. package/dist/cjs/src/binance.js +6 -2
  10. package/dist/cjs/src/bingx.js +5 -3
  11. package/dist/cjs/src/bitget.js +357 -64
  12. package/dist/cjs/src/bitmart.js +2 -0
  13. package/dist/cjs/src/bitmex.js +6 -3
  14. package/dist/cjs/src/bittrex.js +7 -0
  15. package/dist/cjs/src/btcalpha.js +2 -1
  16. package/dist/cjs/src/btcturk.js +3 -0
  17. package/dist/cjs/src/cex.js +1 -0
  18. package/dist/cjs/src/coinbase.js +1 -0
  19. package/dist/cjs/src/coinbasepro.js +1 -0
  20. package/dist/cjs/src/coinex.js +2 -0
  21. package/dist/cjs/src/coinfalcon.js +1 -0
  22. package/dist/cjs/src/coinmate.js +1 -0
  23. package/dist/cjs/src/coinone.js +15 -5
  24. package/dist/cjs/src/cryptocom.js +25 -87
  25. package/dist/cjs/src/currencycom.js +1 -0
  26. package/dist/cjs/src/delta.js +1 -0
  27. package/dist/cjs/src/deribit.js +1 -0
  28. package/dist/cjs/src/digifinex.js +10 -8
  29. package/dist/cjs/src/exmo.js +1 -0
  30. package/dist/cjs/src/gate.js +3 -0
  31. package/dist/cjs/src/gemini.js +1 -0
  32. package/dist/cjs/src/hitbtc.js +1 -0
  33. package/dist/cjs/src/hollaex.js +1 -0
  34. package/dist/cjs/src/huobi.js +8 -0
  35. package/dist/cjs/src/huobijp.js +1 -0
  36. package/dist/cjs/src/idex.js +1 -0
  37. package/dist/cjs/src/independentreserve.js +1 -0
  38. package/dist/cjs/src/indodax.js +1 -0
  39. package/dist/cjs/src/kraken.js +10 -0
  40. package/dist/cjs/src/krakenfutures.js +1 -0
  41. package/dist/cjs/src/kucoin.js +1 -0
  42. package/dist/cjs/src/kucoinfutures.js +1 -0
  43. package/dist/cjs/src/kuna.js +1 -0
  44. package/dist/cjs/src/latoken.js +1 -0
  45. package/dist/cjs/src/lbank.js +1 -0
  46. package/dist/cjs/src/lbank2.js +2 -0
  47. package/dist/cjs/src/luno.js +1 -0
  48. package/dist/cjs/src/lykke.js +2 -1
  49. package/dist/cjs/src/mercado.js +1 -0
  50. package/dist/cjs/src/mexc.js +4 -1
  51. package/dist/cjs/src/ndax.js +1 -0
  52. package/dist/cjs/src/novadax.js +1 -0
  53. package/dist/cjs/src/oceanex.js +1 -0
  54. package/dist/cjs/src/phemex.js +2 -0
  55. package/dist/cjs/src/poloniex.js +1 -0
  56. package/dist/cjs/src/poloniexfutures.js +8 -2
  57. package/dist/cjs/src/pro/krakenfutures.js +14 -10
  58. package/dist/cjs/src/probit.js +1 -0
  59. package/dist/cjs/src/tidex.js +1 -0
  60. package/dist/cjs/src/timex.js +1 -0
  61. package/dist/cjs/src/tokocrypto.js +1 -0
  62. package/dist/cjs/src/upbit.js +1 -0
  63. package/dist/cjs/src/wavesexchange.js +1 -0
  64. package/dist/cjs/src/wazirx.js +2 -1
  65. package/dist/cjs/src/whitebit.js +1 -0
  66. package/dist/cjs/src/woo.js +1 -0
  67. package/dist/cjs/src/yobit.js +1 -0
  68. package/dist/cjs/src/zaif.js +1 -0
  69. package/dist/cjs/src/zonda.js +1 -0
  70. package/js/ccxt.d.ts +1 -1
  71. package/js/ccxt.js +1 -1
  72. package/js/src/abstract/binance.d.ts +4 -0
  73. package/js/src/abstract/binancecoinm.d.ts +4 -0
  74. package/js/src/abstract/binanceus.d.ts +4 -0
  75. package/js/src/abstract/binanceusdm.d.ts +4 -0
  76. package/js/src/abstract/btcturk.d.ts +3 -0
  77. package/js/src/abstract/kraken.d.ts +8 -0
  78. package/js/src/abstract/poloniexfutures.d.ts +6 -1
  79. package/js/src/ascendex.js +1 -0
  80. package/js/src/base/Exchange.d.ts +1 -0
  81. package/js/src/base/Exchange.js +3 -0
  82. package/js/src/binance.js +6 -2
  83. package/js/src/bingx.js +5 -3
  84. package/js/src/bitget.d.ts +28 -0
  85. package/js/src/bitget.js +357 -64
  86. package/js/src/bitmart.js +2 -0
  87. package/js/src/bitmex.js +6 -3
  88. package/js/src/bittrex.d.ts +2 -2
  89. package/js/src/bittrex.js +7 -0
  90. package/js/src/btcalpha.js +2 -1
  91. package/js/src/btcturk.js +3 -0
  92. package/js/src/cex.js +1 -0
  93. package/js/src/coinbase.js +1 -0
  94. package/js/src/coinbasepro.js +1 -0
  95. package/js/src/coinex.js +2 -0
  96. package/js/src/coinfalcon.js +1 -0
  97. package/js/src/coinmate.js +1 -0
  98. package/js/src/coinone.js +15 -5
  99. package/js/src/cryptocom.d.ts +0 -2
  100. package/js/src/cryptocom.js +25 -87
  101. package/js/src/currencycom.js +1 -0
  102. package/js/src/delta.js +1 -0
  103. package/js/src/deribit.js +1 -0
  104. package/js/src/digifinex.d.ts +3 -28
  105. package/js/src/digifinex.js +10 -8
  106. package/js/src/exmo.js +1 -0
  107. package/js/src/gate.d.ts +1 -0
  108. package/js/src/gate.js +3 -0
  109. package/js/src/gemini.d.ts +1 -0
  110. package/js/src/gemini.js +1 -0
  111. package/js/src/hitbtc.js +1 -0
  112. package/js/src/hollaex.js +1 -0
  113. package/js/src/huobi.js +8 -0
  114. package/js/src/huobijp.js +1 -0
  115. package/js/src/idex.js +1 -0
  116. package/js/src/independentreserve.js +1 -0
  117. package/js/src/indodax.js +1 -0
  118. package/js/src/kraken.js +10 -0
  119. package/js/src/krakenfutures.js +1 -0
  120. package/js/src/kucoin.js +1 -0
  121. package/js/src/kucoinfutures.js +1 -0
  122. package/js/src/kuna.js +1 -0
  123. package/js/src/latoken.js +1 -0
  124. package/js/src/lbank.js +1 -0
  125. package/js/src/lbank2.js +2 -0
  126. package/js/src/luno.js +1 -0
  127. package/js/src/lykke.js +2 -1
  128. package/js/src/mercado.js +1 -0
  129. package/js/src/mexc.js +4 -1
  130. package/js/src/ndax.js +1 -0
  131. package/js/src/novadax.js +1 -0
  132. package/js/src/oceanex.js +1 -0
  133. package/js/src/phemex.d.ts +2 -0
  134. package/js/src/phemex.js +2 -0
  135. package/js/src/poloniex.js +1 -0
  136. package/js/src/poloniexfutures.js +8 -2
  137. package/js/src/pro/krakenfutures.js +14 -10
  138. package/js/src/probit.js +1 -0
  139. package/js/src/tidex.js +1 -0
  140. package/js/src/timex.d.ts +1 -0
  141. package/js/src/timex.js +1 -0
  142. package/js/src/tokocrypto.js +1 -0
  143. package/js/src/upbit.js +1 -0
  144. package/js/src/wavesexchange.js +1 -0
  145. package/js/src/wazirx.js +2 -1
  146. package/js/src/whitebit.js +1 -0
  147. package/js/src/woo.js +1 -0
  148. package/js/src/yobit.js +1 -0
  149. package/js/src/zaif.js +1 -0
  150. package/js/src/zonda.js +1 -0
  151. package/package.json +1 -1
  152. package/skip-tests.json +141 -12
@@ -366,6 +366,7 @@ class bittrex extends bittrex$1 {
366
366
  'max': undefined,
367
367
  },
368
368
  },
369
+ 'created': this.parse8601(this.safeString(market, 'createdAt')),
369
370
  'info': market,
370
371
  });
371
372
  }
@@ -905,8 +906,14 @@ class bittrex extends bittrex$1 {
905
906
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
906
907
  * @param {int} [limit] the maximum amount of candles to fetch
907
908
  * @param {object} [params] extra parameters specific to the bittrex api endpoint
909
+ * @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)
908
910
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
909
911
  */
912
+ let paginate = false;
913
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
914
+ if (paginate) {
915
+ return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 1440);
916
+ }
910
917
  await this.loadMarkets();
911
918
  const market = this.market(symbol);
912
919
  const reverseId = market['baseId'] + '-' + market['quoteId'];
@@ -307,7 +307,8 @@ class btcalpha extends btcalpha$1 {
307
307
  // sell: '22521.11'
308
308
  // }
309
309
  //
310
- const timestamp = this.safeIntegerProduct(ticker, 'timestamp', 1000000);
310
+ const timestampStr = this.safeString(ticker, 'timestamp');
311
+ const timestamp = parseInt(Precise["default"].stringMul(timestampStr, '1000000'));
311
312
  const marketId = this.safeString(ticker, 'pair');
312
313
  market = this.safeMarket(marketId, market, '_');
313
314
  const last = this.safeString(ticker, 'last');
@@ -92,6 +92,7 @@ class btcturk extends btcturk$1 {
92
92
  'orderbook': 1,
93
93
  'ticker': 0.1,
94
94
  'trades': 1,
95
+ 'ohlc': 1,
95
96
  'server/exchangeinfo': 1,
96
97
  },
97
98
  },
@@ -103,6 +104,8 @@ class btcturk extends btcturk$1 {
103
104
  'users/transactions/trade': 1,
104
105
  },
105
106
  'post': {
107
+ 'users/transactions/crypto': 1,
108
+ 'users/transactions/fiat': 1,
106
109
  'order': 1,
107
110
  'cancelOrder': 1,
108
111
  },
@@ -436,6 +436,7 @@ class cex extends cex$1 {
436
436
  'max': undefined,
437
437
  },
438
438
  },
439
+ 'created': undefined,
439
440
  'info': market,
440
441
  });
441
442
  }
@@ -1073,6 +1073,7 @@ class coinbase extends coinbase$1 {
1073
1073
  'max': this.safeNumber(market, 'quote_max_size'),
1074
1074
  },
1075
1075
  },
1076
+ 'created': undefined,
1076
1077
  'info': market,
1077
1078
  });
1078
1079
  }
@@ -410,6 +410,7 @@ class coinbasepro extends coinbasepro$1 {
410
410
  'max': undefined,
411
411
  },
412
412
  },
413
+ 'created': undefined,
413
414
  'info': market,
414
415
  }));
415
416
  }
@@ -533,6 +533,7 @@ class coinex extends coinex$1 {
533
533
  'max': undefined,
534
534
  },
535
535
  },
536
+ 'created': undefined,
536
537
  'info': market,
537
538
  });
538
539
  }
@@ -629,6 +630,7 @@ class coinex extends coinex$1 {
629
630
  'max': undefined,
630
631
  },
631
632
  },
633
+ 'created': undefined,
632
634
  'info': entry,
633
635
  });
634
636
  }
@@ -213,6 +213,7 @@ class coinfalcon extends coinfalcon$1 {
213
213
  'max': undefined,
214
214
  },
215
215
  },
216
+ 'created': undefined,
216
217
  'info': market,
217
218
  });
218
219
  }
@@ -288,6 +288,7 @@ class coinmate extends coinmate$1 {
288
288
  'max': undefined,
289
289
  },
290
290
  },
291
+ 'created': undefined,
291
292
  'info': market,
292
293
  });
293
294
  }
@@ -229,6 +229,7 @@ class coinone extends coinone$1 {
229
229
  'max': undefined,
230
230
  },
231
231
  },
232
+ 'created': undefined,
232
233
  'info': ticker,
233
234
  });
234
235
  }
@@ -623,10 +624,19 @@ class coinone extends coinone$1 {
623
624
  const id = this.safeString(order, 'orderId');
624
625
  const baseId = this.safeString(order, 'baseCurrency');
625
626
  const quoteId = this.safeString(order, 'targetCurrency');
626
- const base = this.safeCurrencyCode(baseId, market['base']);
627
- const quote = this.safeCurrencyCode(quoteId, market['quote']);
628
- const symbol = base + '/' + quote;
629
- market = this.safeMarket(symbol, market, '/');
627
+ let base = undefined;
628
+ let quote = undefined;
629
+ if (baseId !== undefined) {
630
+ base = this.safeCurrencyCode(baseId, this.safeString(market, 'base'));
631
+ }
632
+ if (quoteId !== undefined) {
633
+ quote = this.safeCurrencyCode(quoteId, this.safeString(market, 'quote'));
634
+ }
635
+ let symbol = undefined;
636
+ if ((base !== undefined) && (quote !== undefined)) {
637
+ symbol = base + '/' + quote;
638
+ market = this.safeMarket(symbol, market, '/');
639
+ }
630
640
  const timestamp = this.safeTimestamp2(order, 'timestamp', 'updatedAt');
631
641
  let side = this.safeString2(order, 'type', 'side');
632
642
  if (side === 'ask') {
@@ -886,7 +896,7 @@ class coinone extends coinone$1 {
886
896
  const payload = this.stringToBase64(json);
887
897
  body = payload;
888
898
  const secret = this.secret.toUpperCase();
889
- const signature = this.hmac(payload, this.encode(secret), sha512.sha512);
899
+ const signature = this.hmac(this.encode(payload), this.encode(secret), sha512.sha512);
890
900
  headers = {
891
901
  'Content-Type': 'application/json',
892
902
  'X-COINONE-PAYLOAD': payload,
@@ -36,11 +36,11 @@ class cryptocom extends cryptocom$1 {
36
36
  'fetchAccounts': true,
37
37
  'fetchBalance': true,
38
38
  'fetchBidsAsks': false,
39
- 'fetchBorrowInterest': true,
39
+ 'fetchBorrowInterest': false,
40
40
  'fetchBorrowRate': false,
41
41
  'fetchBorrowRateHistories': false,
42
42
  'fetchBorrowRateHistory': false,
43
- 'fetchBorrowRates': true,
43
+ 'fetchBorrowRates': false,
44
44
  'fetchClosedOrders': 'emulated',
45
45
  'fetchCurrencies': false,
46
46
  'fetchDepositAddress': true,
@@ -334,6 +334,7 @@ class cryptocom extends cryptocom$1 {
334
334
  'precisionMode': number.TICK_SIZE,
335
335
  'exceptions': {
336
336
  'exact': {
337
+ '219': errors.InvalidOrder,
337
338
  '10001': errors.ExchangeError,
338
339
  '10002': errors.PermissionDenied,
339
340
  '10003': errors.PermissionDenied,
@@ -563,6 +564,7 @@ class cryptocom extends cryptocom$1 {
563
564
  'max': undefined,
564
565
  },
565
566
  },
567
+ 'created': undefined,
566
568
  'info': market,
567
569
  });
568
570
  }
@@ -1055,7 +1057,7 @@ class cryptocom extends cryptocom$1 {
1055
1057
  }
1056
1058
  const postOnly = this.safeValue(params, 'postOnly', false);
1057
1059
  if ((postOnly) || (timeInForce === 'PO')) {
1058
- request['exec_inst'] = 'POST_ONLY';
1060
+ request['exec_inst'] = ['POST_ONLY'];
1059
1061
  request['time_in_force'] = 'GOOD_TILL_CANCEL';
1060
1062
  }
1061
1063
  const triggerPrice = this.safeStringN(params, ['stopPrice', 'triggerPrice', 'ref_price']);
@@ -1863,8 +1865,8 @@ class cryptocom extends cryptocom$1 {
1863
1865
  'close': last,
1864
1866
  'last': last,
1865
1867
  'previousClose': undefined,
1866
- 'change': this.safeString(ticker, 'c'),
1867
- 'percentage': undefined,
1868
+ 'change': undefined,
1869
+ 'percentage': this.safeString(ticker, 'c'),
1868
1870
  'average': undefined,
1869
1871
  'baseVolume': this.safeString(ticker, 'v'),
1870
1872
  'quoteVolume': this.safeString(ticker, 'vv'),
@@ -2008,10 +2010,16 @@ class cryptocom extends cryptocom$1 {
2008
2010
  const created = this.safeInteger(order, 'create_time');
2009
2011
  const marketId = this.safeString(order, 'instrument_name');
2010
2012
  const symbol = this.safeSymbol(marketId, market);
2011
- const execInst = this.safeString(order, 'exec_inst');
2012
- let postOnly = undefined;
2013
+ const execInst = this.safeValue(order, 'exec_inst');
2014
+ let postOnly = false;
2013
2015
  if (execInst !== undefined) {
2014
- postOnly = (execInst === 'POST_ONLY');
2016
+ for (let i = 0; i < execInst.length; i++) {
2017
+ const inst = execInst[i];
2018
+ if (inst === 'POST_ONLY') {
2019
+ postOnly = true;
2020
+ break;
2021
+ }
2022
+ }
2015
2023
  }
2016
2024
  const feeCurrency = this.safeString(order, 'fee_instrument_name');
2017
2025
  return this.safeOrder({
@@ -2244,52 +2252,6 @@ class cryptocom extends cryptocom$1 {
2244
2252
  'info': info,
2245
2253
  };
2246
2254
  }
2247
- async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
2248
- await this.loadMarkets();
2249
- const request = {};
2250
- let market = undefined;
2251
- let currency = undefined;
2252
- if (symbol !== undefined) {
2253
- market = this.market(symbol);
2254
- }
2255
- if (code !== undefined) {
2256
- currency = this.currency(code);
2257
- request['currency'] = currency['id'];
2258
- }
2259
- if (since !== undefined) {
2260
- request['start_ts'] = since;
2261
- }
2262
- if (limit !== undefined) {
2263
- request['page_size'] = limit;
2264
- }
2265
- const response = await this.v2PrivatePostPrivateMarginGetInterestHistory(this.extend(request, params));
2266
- //
2267
- // {
2268
- // "id": 1656705829020,
2269
- // "method": "private/margin/get-interest-history",
2270
- // "code": 0,
2271
- // "result": {
2272
- // "list": [
2273
- // {
2274
- // "loan_id": "2643528867803765921",
2275
- // "currency": "USDT",
2276
- // "interest": 0.00000004,
2277
- // "time": 1656702899559,
2278
- // "stake_amount": 6,
2279
- // "interest_rate": 0.000025
2280
- // },
2281
- // ]
2282
- // }
2283
- // }
2284
- //
2285
- const data = this.safeValue(response, 'result', {});
2286
- const rows = this.safeValue(data, 'list', []);
2287
- let interest = undefined;
2288
- for (let i = 0; i < rows.length; i++) {
2289
- interest = this.parseBorrowInterests(rows, market);
2290
- }
2291
- return this.filterByCurrencySinceLimit(interest, code, since, limit);
2292
- }
2293
2255
  parseBorrowInterest(info, market = undefined) {
2294
2256
  //
2295
2257
  // {
@@ -2318,38 +2280,6 @@ class cryptocom extends cryptocom$1 {
2318
2280
  'info': info,
2319
2281
  };
2320
2282
  }
2321
- async fetchBorrowRates(params = {}) {
2322
- /**
2323
- * @method
2324
- * @name cryptocom#fetchBorrowRates
2325
- * @description fetch the borrow interest rates of all currencies
2326
- * @param {object} [params] extra parameters specific to the cryptocom api endpoint
2327
- * @returns {object} a list of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
2328
- */
2329
- await this.loadMarkets();
2330
- const response = await this.v2PrivatePostPrivateMarginGetUserConfig(params);
2331
- //
2332
- // {
2333
- // "id": 1656707947456,
2334
- // "method": "private/margin/get-user-config",
2335
- // "code": 0,
2336
- // "result": {
2337
- // "stake_amount": 6,
2338
- // "currency_configs": [
2339
- // {
2340
- // "currency": "AGLD",
2341
- // "hourly_rate": 0.00003334,
2342
- // "max_borrow_limit": 342.4032393,
2343
- // "min_borrow_limit": 30
2344
- // },
2345
- // ]
2346
- // }
2347
- // }
2348
- //
2349
- const data = this.safeValue(response, 'result', {});
2350
- const rates = this.safeValue(data, 'currency_configs', []);
2351
- return this.parseBorrowRates(rates, 'currency');
2352
- }
2353
2283
  parseBorrowRates(info, codeKey) {
2354
2284
  //
2355
2285
  // {
@@ -3022,7 +2952,15 @@ class cryptocom extends cryptocom$1 {
3022
2952
  const paramsKeys = Object.keys(keysorted);
3023
2953
  let strSortKey = '';
3024
2954
  for (let i = 0; i < paramsKeys.length; i++) {
3025
- strSortKey = strSortKey + paramsKeys[i].toString() + requestParams[paramsKeys[i]].toString();
2955
+ const key = paramsKeys[i].toString();
2956
+ let value = requestParams[paramsKeys[i]];
2957
+ if (Array.isArray(value)) {
2958
+ value = value.join(',');
2959
+ }
2960
+ else {
2961
+ value = value.toString();
2962
+ }
2963
+ strSortKey = strSortKey + key + value;
3026
2964
  }
3027
2965
  const payload = path + nonce + this.apiKey + strSortKey + nonce;
3028
2966
  const signature = this.hmac(this.encode(payload), this.encode(this.secret), sha256.sha256);
@@ -567,6 +567,7 @@ class currencycom extends currencycom$1 {
567
567
  'max': undefined,
568
568
  },
569
569
  },
570
+ 'created': undefined,
570
571
  'info': market,
571
572
  });
572
573
  }
@@ -819,6 +819,7 @@ class delta extends delta$1 {
819
819
  'max': undefined,
820
820
  },
821
821
  },
822
+ 'created': this.parse8601(this.safeString(market, 'launch_time')),
822
823
  'info': market,
823
824
  });
824
825
  }
@@ -811,6 +811,7 @@ class deribit extends deribit$1 {
811
811
  'max': undefined,
812
812
  },
813
813
  },
814
+ 'created': this.safeInteger(market, 'creation_timestamp'),
814
815
  'info': market,
815
816
  });
816
817
  }
@@ -653,6 +653,7 @@ class digifinex extends digifinex$1 {
653
653
  'max': undefined,
654
654
  },
655
655
  },
656
+ 'created': undefined,
656
657
  'info': market,
657
658
  });
658
659
  }
@@ -2807,14 +2808,16 @@ class digifinex extends digifinex$1 {
2807
2808
  // "leverage_ratio": 3
2808
2809
  // }
2809
2810
  //
2810
- const symbol = this.safeString(info, 'symbol');
2811
+ const marketId = this.safeString(info, 'symbol');
2811
2812
  const amountString = this.safeString(info, 'amount');
2812
2813
  const leverageString = this.safeString(info, 'leverage_ratio');
2813
2814
  const amountInvested = Precise["default"].stringDiv(amountString, leverageString);
2814
2815
  const amountBorrowed = Precise["default"].stringSub(amountString, amountInvested);
2815
2816
  const currency = (market === undefined) ? undefined : market['base'];
2817
+ const symbol = this.safeSymbol(marketId, market);
2816
2818
  return {
2817
- 'account': this.safeSymbol(symbol, market),
2819
+ 'account': symbol,
2820
+ 'symbol': symbol,
2818
2821
  'currency': currency,
2819
2822
  'interest': undefined,
2820
2823
  'interestRate': 0.001,
@@ -3294,10 +3297,9 @@ class digifinex extends digifinex$1 {
3294
3297
  return position;
3295
3298
  }
3296
3299
  else {
3297
- return this.extend(position, {
3298
- 'collateral': this.safeNumber(response, 'margin'),
3299
- 'marginRatio': this.safeNumber(response, 'margin_rate'),
3300
- });
3300
+ position['collateral'] = this.safeNumber(response, 'margin');
3301
+ position['marginRatio'] = this.safeNumber(response, 'margin_rate');
3302
+ return position;
3301
3303
  }
3302
3304
  }
3303
3305
  parsePosition(position, market = undefined) {
@@ -3357,7 +3359,7 @@ class digifinex extends digifinex$1 {
3357
3359
  else if (side === 'go_short') {
3358
3360
  side = 'short';
3359
3361
  }
3360
- return {
3362
+ return this.safePosition({
3361
3363
  'info': position,
3362
3364
  'id': undefined,
3363
3365
  'symbol': symbol,
@@ -3383,7 +3385,7 @@ class digifinex extends digifinex$1 {
3383
3385
  'percentage': undefined,
3384
3386
  'stopLossPrice': undefined,
3385
3387
  'takeProfitPrice': undefined,
3386
- };
3388
+ });
3387
3389
  }
3388
3390
  async setLeverage(leverage, symbol = undefined, params = {}) {
3389
3391
  /**
@@ -826,6 +826,7 @@ class exmo extends exmo$1 {
826
826
  'max': this.safeNumber(market, 'max_amount'),
827
827
  },
828
828
  },
829
+ 'created': undefined,
829
830
  'info': market,
830
831
  });
831
832
  }
@@ -1095,6 +1095,7 @@ class gate extends gate$1 {
1095
1095
  'max': margin ? this.safeNumber(market, 'max_quote_amount') : undefined,
1096
1096
  },
1097
1097
  },
1098
+ 'created': undefined,
1098
1099
  'info': market,
1099
1100
  });
1100
1101
  }
@@ -1292,6 +1293,7 @@ class gate extends gate$1 {
1292
1293
  'max': undefined,
1293
1294
  },
1294
1295
  },
1296
+ 'created': undefined,
1295
1297
  'info': market,
1296
1298
  };
1297
1299
  }
@@ -1412,6 +1414,7 @@ class gate extends gate$1 {
1412
1414
  'max': undefined,
1413
1415
  },
1414
1416
  },
1417
+ 'created': this.safeIntegerProduct(market, 'create_time', 1000),
1415
1418
  'info': market,
1416
1419
  });
1417
1420
  }
@@ -642,6 +642,7 @@ class gemini extends gemini$1 {
642
642
  'max': undefined,
643
643
  },
644
644
  },
645
+ 'created': undefined,
645
646
  'info': response,
646
647
  };
647
648
  }
@@ -734,6 +734,7 @@ class hitbtc extends hitbtc$1 {
734
734
  'max': undefined,
735
735
  },
736
736
  },
737
+ 'created': undefined,
737
738
  'info': market,
738
739
  });
739
740
  }
@@ -312,6 +312,7 @@ class hollaex extends hollaex$1 {
312
312
  'max': undefined,
313
313
  },
314
314
  },
315
+ 'created': this.parse8601(this.safeString(market, 'created_at')),
315
316
  'info': market,
316
317
  });
317
318
  }
@@ -1704,6 +1704,13 @@ class huobi extends huobi$1 {
1704
1704
  // 7 Settlement Completed
1705
1705
  // 8 Delivered
1706
1706
  // 9 Suspending of Trade
1707
+ let created = undefined;
1708
+ let createdDate = this.safeString(market, 'create_date'); // i.e 20230101
1709
+ if (createdDate !== undefined) {
1710
+ const createdArray = this.stringToCharsArray(createdDate);
1711
+ createdDate = createdArray[0] + createdArray[1] + createdArray[2] + createdArray[3] + '-' + createdArray[4] + createdArray[5] + '-' + createdArray[6] + createdArray[7] + ' 00:00:00';
1712
+ created = this.parse8601(createdDate);
1713
+ }
1707
1714
  result.push({
1708
1715
  'id': id,
1709
1716
  'lowercaseId': lowercaseId,
@@ -1756,6 +1763,7 @@ class huobi extends huobi$1 {
1756
1763
  'max': undefined,
1757
1764
  },
1758
1765
  },
1766
+ 'created': created,
1759
1767
  'info': market,
1760
1768
  });
1761
1769
  }
@@ -514,6 +514,7 @@ class huobijp extends huobijp$1 {
514
514
  'max': undefined,
515
515
  },
516
516
  },
517
+ 'created': undefined,
517
518
  'info': market,
518
519
  });
519
520
  }
@@ -309,6 +309,7 @@ class idex extends idex$1 {
309
309
  'max': undefined,
310
310
  },
311
311
  },
312
+ 'created': undefined,
312
313
  'info': entry,
313
314
  });
314
315
  }
@@ -211,6 +211,7 @@ class independentreserve extends independentreserve$1 {
211
211
  'max': undefined,
212
212
  },
213
213
  },
214
+ 'created': undefined,
214
215
  'info': id,
215
216
  });
216
217
  }
@@ -279,6 +279,7 @@ class indodax extends indodax$1 {
279
279
  'max': undefined,
280
280
  },
281
281
  },
282
+ 'created': undefined,
282
283
  'info': market,
283
284
  });
284
285
  }
@@ -153,6 +153,7 @@ class kraken extends kraken$1 {
153
153
  'Depth': 1,
154
154
  'OHLC': 1,
155
155
  'Spread': 1,
156
+ 'SystemStatus': 1,
156
157
  'Ticker': 1,
157
158
  'Time': 1,
158
159
  'Trades': 1,
@@ -165,6 +166,7 @@ class kraken extends kraken$1 {
165
166
  'AddExport': 3,
166
167
  'Balance': 3,
167
168
  'CancelAll': 3,
169
+ 'CancelAllOrdersAfter': 3,
168
170
  'CancelOrder': 0,
169
171
  'CancelOrderBatch': 0,
170
172
  'ClosedOrders': 6,
@@ -200,6 +202,13 @@ class kraken extends kraken$1 {
200
202
  // sub accounts
201
203
  'CreateSubaccount': 3,
202
204
  'AccountTransfer': 3,
205
+ // earn
206
+ 'Earn/Allocate': 3,
207
+ 'Earn/Deallocate': 3,
208
+ 'Earn/AllocateStatus': 3,
209
+ 'Earn/DeallocateStatus': 3,
210
+ 'Earn/Strategies': 3,
211
+ 'Earn/Allocations': 3,
203
212
  },
204
213
  },
205
214
  },
@@ -487,6 +496,7 @@ class kraken extends kraken$1 {
487
496
  'max': undefined,
488
497
  },
489
498
  },
499
+ 'created': undefined,
490
500
  'info': market,
491
501
  });
492
502
  }
@@ -385,6 +385,7 @@ class krakenfutures extends krakenfutures$1 {
385
385
  'max': undefined,
386
386
  },
387
387
  },
388
+ 'created': this.parse8601(this.safeString(market, 'openingDate')),
388
389
  'info': market,
389
390
  });
390
391
  }
@@ -986,6 +986,7 @@ class kucoin extends kucoin$1 {
986
986
  'max': this.safeNumber(market, 'quoteMaxSize'),
987
987
  },
988
988
  },
989
+ 'created': undefined,
989
990
  'info': market,
990
991
  });
991
992
  }
@@ -505,6 +505,7 @@ class kucoinfutures extends kucoinfutures$1 {
505
505
  'max': this.safeNumber(market, 'quoteMaxSize'),
506
506
  },
507
507
  },
508
+ 'created': this.safeInteger(market, 'firstOpenDate'),
508
509
  'info': market,
509
510
  });
510
511
  }
@@ -451,6 +451,7 @@ class kuna extends kuna$1 {
451
451
  'max': undefined,
452
452
  },
453
453
  },
454
+ 'created': undefined,
454
455
  'info': undefined,
455
456
  });
456
457
  }
@@ -364,6 +364,7 @@ class latoken extends latoken$1 {
364
364
  'max': this.safeNumber(market, 'maxOrderCost' + capitalizedQuote),
365
365
  },
366
366
  },
367
+ 'created': this.safeInteger(market, 'created'),
367
368
  'info': market,
368
369
  });
369
370
  }
@@ -229,6 +229,7 @@ class lbank extends lbank$1 {
229
229
  'max': undefined,
230
230
  },
231
231
  },
232
+ 'created': undefined,
232
233
  'info': id,
233
234
  });
234
235
  }
@@ -421,6 +421,7 @@ class lbank2 extends lbank2$1 {
421
421
  'max': undefined,
422
422
  },
423
423
  },
424
+ 'created': undefined,
424
425
  'info': market,
425
426
  });
426
427
  }
@@ -517,6 +518,7 @@ class lbank2 extends lbank2$1 {
517
518
  'max': undefined,
518
519
  },
519
520
  },
521
+ 'created': undefined,
520
522
  'info': market,
521
523
  });
522
524
  }