ccxt 4.1.8 → 4.1.10

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 (69) hide show
  1. package/.git-templates/hooks/pre-push +55 -0
  2. package/README.md +3 -3
  3. package/dist/ccxt.browser.js +1458 -302
  4. package/dist/ccxt.browser.min.js +7 -7
  5. package/dist/cjs/ccxt.js +3 -1
  6. package/dist/cjs/src/base/Exchange.js +59 -3
  7. package/dist/cjs/src/bingx.js +103 -41
  8. package/dist/cjs/src/bitbns.js +107 -83
  9. package/dist/cjs/src/bitget.js +35 -17
  10. package/dist/cjs/src/btcalpha.js +9 -1
  11. package/dist/cjs/src/btcmarkets.js +5 -5
  12. package/dist/cjs/src/coinex.js +14 -2
  13. package/dist/cjs/src/deribit.js +6 -0
  14. package/dist/cjs/src/gate.js +9 -1
  15. package/dist/cjs/src/hitbtc.js +20 -2
  16. package/dist/cjs/src/kucoinfutures.js +2 -2
  17. package/dist/cjs/src/phemex.js +20 -1
  18. package/dist/cjs/src/pro/bingx.js +891 -0
  19. package/dist/cjs/src/probit.js +3 -0
  20. package/dist/cjs/src/woo.js +21 -1
  21. package/js/ccxt.d.ts +6 -3
  22. package/js/ccxt.js +3 -1
  23. package/js/src/abstract/bingx.d.ts +1 -0
  24. package/js/src/base/Exchange.d.ts +6 -3
  25. package/js/src/base/Exchange.js +59 -3
  26. package/js/src/base/types.d.ts +7 -0
  27. package/js/src/binance.d.ts +17 -17
  28. package/js/src/bingx.d.ts +4 -3
  29. package/js/src/bingx.js +103 -41
  30. package/js/src/bitbns.d.ts +1 -1
  31. package/js/src/bitbns.js +107 -83
  32. package/js/src/bitfinex2.d.ts +13 -13
  33. package/js/src/bitget.d.ts +15 -15
  34. package/js/src/bitget.js +35 -17
  35. package/js/src/bitmex.d.ts +15 -15
  36. package/js/src/btcalpha.js +9 -1
  37. package/js/src/btcmarkets.js +5 -5
  38. package/js/src/bybit.d.ts +23 -23
  39. package/js/src/coinbase.d.ts +16 -16
  40. package/js/src/coinbasepro.d.ts +12 -12
  41. package/js/src/coinex.d.ts +2 -2
  42. package/js/src/coinex.js +14 -2
  43. package/js/src/cryptocom.d.ts +12 -12
  44. package/js/src/deribit.d.ts +2 -2
  45. package/js/src/deribit.js +6 -0
  46. package/js/src/digifinex.d.ts +2 -2
  47. package/js/src/gate.d.ts +10 -10
  48. package/js/src/gate.js +9 -1
  49. package/js/src/hitbtc.d.ts +2 -2
  50. package/js/src/hitbtc.js +20 -2
  51. package/js/src/huobi.d.ts +16 -16
  52. package/js/src/kraken.d.ts +2 -2
  53. package/js/src/krakenfutures.d.ts +6 -6
  54. package/js/src/kucoin.d.ts +13 -13
  55. package/js/src/kucoinfutures.d.ts +10 -10
  56. package/js/src/kucoinfutures.js +2 -2
  57. package/js/src/mexc.d.ts +3 -3
  58. package/js/src/okx.d.ts +13 -13
  59. package/js/src/phemex.d.ts +2 -2
  60. package/js/src/phemex.js +20 -1
  61. package/js/src/poloniex.d.ts +5 -5
  62. package/js/src/pro/bingx.d.ts +24 -0
  63. package/js/src/pro/bingx.js +892 -0
  64. package/js/src/probit.js +3 -0
  65. package/js/src/woo.d.ts +2 -2
  66. package/js/src/woo.js +21 -1
  67. package/package.json +1 -1
  68. package/pyproject.toml +8 -0
  69. package/skip-tests.json +4 -1
@@ -1573,19 +1573,28 @@ class hitbtc extends hitbtc$1 {
1573
1573
  * @method
1574
1574
  * @name hitbtc#fetchOHLCV
1575
1575
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1576
+ * @see https://api.hitbtc.com/#candles
1576
1577
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1577
1578
  * @param {string} timeframe the length of time each candle represents
1578
1579
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
1579
1580
  * @param {int} [limit] the maximum amount of candles to fetch
1580
1581
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
1582
+ * @param {int} [params.until] timestamp in ms of the latest funding rate
1583
+ * @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)
1581
1584
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1582
1585
  */
1583
1586
  await this.loadMarkets();
1587
+ let paginate = false;
1588
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
1589
+ if (paginate) {
1590
+ return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 1000);
1591
+ }
1584
1592
  const market = this.market(symbol);
1585
- const request = {
1593
+ let request = {
1586
1594
  'symbols': market['id'],
1587
1595
  'period': this.safeString(this.timeframes, timeframe, timeframe),
1588
1596
  };
1597
+ [request, params] = this.handleUntilOption('till', request, params);
1589
1598
  if (since !== undefined) {
1590
1599
  request['from'] = this.iso8601(since);
1591
1600
  }
@@ -2380,16 +2389,24 @@ class hitbtc extends hitbtc$1 {
2380
2389
  /**
2381
2390
  * @method
2382
2391
  * @name hitbtc#fetchFundingRateHistory
2392
+ * @see https://api.hitbtc.com/#funding-history
2383
2393
  * @description fetches historical funding rate prices
2384
2394
  * @param {string} symbol unified symbol of the market to fetch the funding rate history for
2385
2395
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
2386
2396
  * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
2387
2397
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
2398
+ * @param {int} [params.until] timestamp in ms of the latest funding rate
2399
+ * @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)
2388
2400
  * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
2389
2401
  */
2390
2402
  await this.loadMarkets();
2403
+ let paginate = false;
2404
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
2405
+ if (paginate) {
2406
+ return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 1000);
2407
+ }
2391
2408
  let market = undefined;
2392
- const request = {
2409
+ let request = {
2393
2410
  // all arguments are optional
2394
2411
  // 'symbols': Comma separated list of symbol codes,
2395
2412
  // 'sort': 'DESC' or 'ASC'
@@ -2398,6 +2415,7 @@ class hitbtc extends hitbtc$1 {
2398
2415
  // 'limit': 100,
2399
2416
  // 'offset': 0,
2400
2417
  };
2418
+ [request, params] = this.handleUntilOption('till', request, params);
2401
2419
  if (symbol !== undefined) {
2402
2420
  market = this.market(symbol);
2403
2421
  symbol = market['symbol'];
@@ -2325,12 +2325,12 @@ class kucoinfutures extends kucoinfutures$1 {
2325
2325
  async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2326
2326
  /**
2327
2327
  * @method
2328
- * @name okx#fetchFundingRateHistory
2328
+ * @name kucoinfutures#fetchFundingRateHistory
2329
2329
  * @description fetches historical funding rate prices
2330
2330
  * @param {string} symbol unified symbol of the market to fetch the funding rate history for
2331
2331
  * @param {int} [since] not used by kucuoinfutures
2332
2332
  * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
2333
- * @param {object} [params] extra parameters specific to the okx api endpoint
2333
+ * @param {object} [params] extra parameters specific to the kucoinfutures api endpoint
2334
2334
  * @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)
2335
2335
  * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
2336
2336
  */
@@ -4328,6 +4328,19 @@ class phemex extends phemex$1 {
4328
4328
  return this.safeString(statuses, status, status);
4329
4329
  }
4330
4330
  async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4331
+ /**
4332
+ * @method
4333
+ * @name phemex#fetchFundingRateHistory
4334
+ * @description fetches historical funding rate prices
4335
+ * @see https://phemex-docs.github.io/#query-funding-rate-history-2
4336
+ * @param {string} symbol unified symbol of the market to fetch the funding rate history for
4337
+ * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
4338
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
4339
+ * @param {object} [params] extra parameters specific to the phemex api endpoint
4340
+ * @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)
4341
+ * @param {int} [params.until] timestamp in ms of the latest funding rate
4342
+ * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
4343
+ */
4331
4344
  this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
4332
4345
  await this.loadMarkets();
4333
4346
  const market = this.market(symbol);
@@ -4335,6 +4348,11 @@ class phemex extends phemex$1 {
4335
4348
  if (!market['swap']) {
4336
4349
  throw new errors.BadRequest(this.id + ' fetchFundingRateHistory() supports swap contracts only');
4337
4350
  }
4351
+ let paginate = false;
4352
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
4353
+ if (paginate) {
4354
+ return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 100);
4355
+ }
4338
4356
  let customSymbol = undefined;
4339
4357
  if (isUsdtSettled) {
4340
4358
  customSymbol = '.' + market['id'] + 'FR8H'; // phemex requires a custom symbol for funding rate history
@@ -4342,7 +4360,7 @@ class phemex extends phemex$1 {
4342
4360
  else {
4343
4361
  customSymbol = '.' + market['baseId'] + 'FR8H';
4344
4362
  }
4345
- const request = {
4363
+ let request = {
4346
4364
  'symbol': customSymbol,
4347
4365
  };
4348
4366
  if (since !== undefined) {
@@ -4351,6 +4369,7 @@ class phemex extends phemex$1 {
4351
4369
  if (limit !== undefined) {
4352
4370
  request['limit'] = limit;
4353
4371
  }
4372
+ [request, params] = this.handleUntilOption('end', request, params);
4354
4373
  let response = undefined;
4355
4374
  if (isUsdtSettled) {
4356
4375
  response = await this.v2GetApiDataPublicDataFundingRateHistory(this.extend(request, params));