ccxt 4.3.94 → 4.3.96

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 +4 -4
  2. package/dist/ccxt.browser.min.js +8 -8
  3. package/dist/cjs/ccxt.js +1 -7
  4. package/dist/cjs/src/ascendex.js +8 -6
  5. package/dist/cjs/src/base/Exchange.js +3 -7
  6. package/dist/cjs/src/bingx.js +2 -1
  7. package/dist/cjs/src/bitfinex.js +3 -2
  8. package/dist/cjs/src/bitfinex2.js +6 -5
  9. package/dist/cjs/src/blofin.js +0 -1
  10. package/dist/cjs/src/btcturk.js +2 -2
  11. package/dist/cjs/src/bybit.js +8 -2
  12. package/dist/cjs/src/gate.js +3 -2
  13. package/dist/cjs/src/gemini.js +3 -2
  14. package/dist/cjs/src/hyperliquid.js +337 -42
  15. package/dist/cjs/src/independentreserve.js +4 -3
  16. package/dist/cjs/src/indodax.js +3 -0
  17. package/dist/cjs/src/kucoin.js +12 -12
  18. package/dist/cjs/src/mexc.js +78 -154
  19. package/dist/cjs/src/okx.js +2 -1
  20. package/dist/cjs/src/p2b.js +0 -1
  21. package/dist/cjs/src/pro/binance.js +100 -2
  22. package/dist/cjs/src/pro/bybit.js +65 -4
  23. package/dist/cjs/src/pro/cryptocom.js +224 -0
  24. package/dist/cjs/src/pro/okx.js +264 -35
  25. package/dist/cjs/src/tradeogre.js +0 -1
  26. package/js/ccxt.d.ts +2 -8
  27. package/js/ccxt.js +2 -6
  28. package/js/src/abstract/okx.d.ts +2 -0
  29. package/js/src/ascendex.js +8 -6
  30. package/js/src/base/Exchange.d.ts +1 -3
  31. package/js/src/base/Exchange.js +3 -7
  32. package/js/src/bingx.js +2 -1
  33. package/js/src/bitfinex.js +3 -2
  34. package/js/src/bitfinex2.js +6 -5
  35. package/js/src/blofin.js +0 -1
  36. package/js/src/btcturk.d.ts +2 -2
  37. package/js/src/btcturk.js +2 -2
  38. package/js/src/bybit.js +8 -2
  39. package/js/src/gate.js +3 -2
  40. package/js/src/gemini.js +3 -2
  41. package/js/src/hyperliquid.d.ts +25 -0
  42. package/js/src/hyperliquid.js +337 -42
  43. package/js/src/independentreserve.js +4 -3
  44. package/js/src/indodax.js +3 -0
  45. package/js/src/kucoin.d.ts +1 -1
  46. package/js/src/kucoin.js +12 -12
  47. package/js/src/mexc.js +78 -154
  48. package/js/src/okx.js +2 -1
  49. package/js/src/p2b.js +0 -1
  50. package/js/src/pro/binance.d.ts +2 -0
  51. package/js/src/pro/binance.js +100 -2
  52. package/js/src/pro/bybit.d.ts +3 -1
  53. package/js/src/pro/bybit.js +65 -4
  54. package/js/src/pro/cryptocom.d.ts +10 -1
  55. package/js/src/pro/cryptocom.js +225 -1
  56. package/js/src/pro/okx.d.ts +10 -1
  57. package/js/src/pro/okx.js +264 -35
  58. package/js/src/tradeogre.js +0 -1
  59. package/package.json +1 -1
  60. package/js/src/abstract/bitbay.d.ts +0 -56
  61. package/js/src/abstract/bitbay.js +0 -11
  62. package/js/src/abstract/hitbtc3.d.ts +0 -118
  63. package/js/src/abstract/hitbtc3.js +0 -11
package/dist/cjs/ccxt.js CHANGED
@@ -24,7 +24,6 @@ var binanceusdm = require('./src/binanceusdm.js');
24
24
  var bingx = require('./src/bingx.js');
25
25
  var bit2c = require('./src/bit2c.js');
26
26
  var bitbank = require('./src/bitbank.js');
27
- var bitbay = require('./src/bitbay.js');
28
27
  var bitbns = require('./src/bitbns.js');
29
28
  var bitcoincom = require('./src/bitcoincom.js');
30
29
  var bitfinex = require('./src/bitfinex.js');
@@ -74,7 +73,6 @@ var gateio = require('./src/gateio.js');
74
73
  var gemini = require('./src/gemini.js');
75
74
  var hashkey = require('./src/hashkey.js');
76
75
  var hitbtc = require('./src/hitbtc.js');
77
- var hitbtc3 = require('./src/hitbtc3.js');
78
76
  var hollaex = require('./src/hollaex.js');
79
77
  var htx = require('./src/htx.js');
80
78
  var huobi = require('./src/huobi.js');
@@ -196,7 +194,7 @@ var xt$1 = require('./src/pro/xt.js');
196
194
 
197
195
  //-----------------------------------------------------------------------------
198
196
  // this is updated by vss.js when building
199
- const version = '4.3.94';
197
+ const version = '4.3.96';
200
198
  Exchange["default"].ccxtVersion = version;
201
199
  const exchanges = {
202
200
  'ace': ace,
@@ -211,7 +209,6 @@ const exchanges = {
211
209
  'bingx': bingx,
212
210
  'bit2c': bit2c,
213
211
  'bitbank': bitbank,
214
- 'bitbay': bitbay,
215
212
  'bitbns': bitbns,
216
213
  'bitcoincom': bitcoincom,
217
214
  'bitfinex': bitfinex,
@@ -261,7 +258,6 @@ const exchanges = {
261
258
  'gemini': gemini,
262
259
  'hashkey': hashkey,
263
260
  'hitbtc': hitbtc,
264
- 'hitbtc3': hitbtc3,
265
261
  'hollaex': hollaex,
266
262
  'htx': htx,
267
263
  'huobi': huobi,
@@ -445,7 +441,6 @@ exports.binanceusdm = binanceusdm;
445
441
  exports.bingx = bingx;
446
442
  exports.bit2c = bit2c;
447
443
  exports.bitbank = bitbank;
448
- exports.bitbay = bitbay;
449
444
  exports.bitbns = bitbns;
450
445
  exports.bitcoincom = bitcoincom;
451
446
  exports.bitfinex = bitfinex;
@@ -495,7 +490,6 @@ exports.gateio = gateio;
495
490
  exports.gemini = gemini;
496
491
  exports.hashkey = hashkey;
497
492
  exports.hitbtc = hitbtc;
498
- exports.hitbtc3 = hitbtc3;
499
493
  exports.hollaex = hollaex;
500
494
  exports.htx = htx;
501
495
  exports.huobi = huobi;
@@ -385,7 +385,7 @@ class ascendex extends ascendex$1 {
385
385
  * @param {object} [params] extra parameters specific to the exchange API endpoint
386
386
  * @returns {object} an associative dictionary of currencies
387
387
  */
388
- const assets = await this.v1PublicGetAssets(params);
388
+ const assetsPromise = this.v1PublicGetAssets(params);
389
389
  //
390
390
  // {
391
391
  // "code":0,
@@ -402,7 +402,7 @@ class ascendex extends ascendex$1 {
402
402
  // ]
403
403
  // }
404
404
  //
405
- const margin = await this.v1PublicGetMarginAssets(params);
405
+ const marginPromise = this.v1PublicGetMarginAssets(params);
406
406
  //
407
407
  // {
408
408
  // "code":0,
@@ -422,7 +422,7 @@ class ascendex extends ascendex$1 {
422
422
  // ]
423
423
  // }
424
424
  //
425
- const cash = await this.v1PublicGetCashAssets(params);
425
+ const cashPromise = this.v1PublicGetCashAssets(params);
426
426
  //
427
427
  // {
428
428
  // "code":0,
@@ -439,6 +439,7 @@ class ascendex extends ascendex$1 {
439
439
  // ]
440
440
  // }
441
441
  //
442
+ const [assets, margin, cash] = await Promise.all([assetsPromise, marginPromise, cashPromise]);
442
443
  const assetsData = this.safeList(assets, 'data', []);
443
444
  const marginData = this.safeList(margin, 'data', []);
444
445
  const cashData = this.safeList(cash, 'data', []);
@@ -493,7 +494,7 @@ class ascendex extends ascendex$1 {
493
494
  * @param {object} [params] extra parameters specific to the exchange API endpoint
494
495
  * @returns {object[]} an array of objects representing market data
495
496
  */
496
- const products = await this.v1PublicGetProducts(params);
497
+ const productsPromise = this.v1PublicGetProducts(params);
497
498
  //
498
499
  // {
499
500
  // "code": 0,
@@ -514,7 +515,7 @@ class ascendex extends ascendex$1 {
514
515
  // ]
515
516
  // }
516
517
  //
517
- const cash = await this.v1PublicGetCashProducts(params);
518
+ const cashPromise = this.v1PublicGetCashProducts(params);
518
519
  //
519
520
  // {
520
521
  // "code": 0,
@@ -544,7 +545,7 @@ class ascendex extends ascendex$1 {
544
545
  // ]
545
546
  // }
546
547
  //
547
- const perpetuals = await this.v2PublicGetFuturesContract(params);
548
+ const perpetualsPromise = this.v2PublicGetFuturesContract(params);
548
549
  //
549
550
  // {
550
551
  // "code": 0,
@@ -582,6 +583,7 @@ class ascendex extends ascendex$1 {
582
583
  // ]
583
584
  // }
584
585
  //
586
+ const [products, cash, perpetuals] = await Promise.all([productsPromise, cashPromise, perpetualsPromise]);
585
587
  const productsData = this.safeList(products, 'data', []);
586
588
  const productsById = this.indexBy(productsData, 'symbol');
587
589
  const cashData = this.safeList(cash, 'data', []);
@@ -1437,7 +1437,6 @@ class Exchange {
1437
1437
  'fetchOrdersWs': undefined,
1438
1438
  'fetchOrderTrades': undefined,
1439
1439
  'fetchOrderWs': undefined,
1440
- 'fetchPermissions': undefined,
1441
1440
  'fetchPosition': undefined,
1442
1441
  'fetchPositionHistory': undefined,
1443
1442
  'fetchPositionsHistory': undefined,
@@ -3470,7 +3469,7 @@ class Exchange {
3470
3469
  if (currencyCode === undefined) {
3471
3470
  const currencies = Object.values(this.currencies);
3472
3471
  for (let i = 0; i < currencies.length; i++) {
3473
- const currency = [i];
3472
+ const currency = currencies[i];
3474
3473
  const networks = this.safeDict(currency, 'networks');
3475
3474
  const network = this.safeDict(networks, networkCode);
3476
3475
  networkId = this.safeString(network, 'id');
@@ -3615,13 +3614,13 @@ class Exchange {
3615
3614
  'nonce': undefined,
3616
3615
  };
3617
3616
  }
3618
- parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined) {
3617
+ parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined, tail = false) {
3619
3618
  const results = [];
3620
3619
  for (let i = 0; i < ohlcvs.length; i++) {
3621
3620
  results.push(this.parseOHLCV(ohlcvs[i], market));
3622
3621
  }
3623
3622
  const sorted = this.sortBy(results, 0);
3624
- return this.filterBySinceLimit(sorted, since, limit, 0);
3623
+ return this.filterBySinceLimit(sorted, since, limit, 0, tail);
3625
3624
  }
3626
3625
  parseLeverageTiers(response, symbols = undefined, marketIdKey = undefined) {
3627
3626
  // marketIdKey should only be undefined when response is a dictionary
@@ -4000,9 +3999,6 @@ class Exchange {
4000
3999
  await this.cancelOrderWs(id, symbol);
4001
4000
  return await this.createOrderWs(symbol, type, side, amount, price, params);
4002
4001
  }
4003
- async fetchPermissions(params = {}) {
4004
- throw new errors.NotSupported(this.id + ' fetchPermissions() is not supported yet');
4005
- }
4006
4002
  async fetchPosition(symbol, params = {}) {
4007
4003
  throw new errors.NotSupported(this.id + ' fetchPosition() is not supported yet');
4008
4004
  }
@@ -463,7 +463,8 @@ class bingx extends bingx$1 {
463
463
  'broad': {},
464
464
  },
465
465
  'commonCurrencies': {
466
- 'SNOW': 'Snowman', // Snowman vs SnowSwap conflict
466
+ 'SNOW': 'Snowman',
467
+ 'OMNI': 'OmniCat',
467
468
  },
468
469
  'options': {
469
470
  'defaultType': 'spot',
@@ -563,11 +563,11 @@ class bitfinex extends bitfinex$1 {
563
563
  * @param {object} [params] extra parameters specific to the exchange API endpoint
564
564
  * @returns {object[]} an array of objects representing market data
565
565
  */
566
- const ids = await this.publicGetSymbols();
566
+ const idsPromise = this.publicGetSymbols();
567
567
  //
568
568
  // [ "btcusd", "ltcusd", "ltcbtc" ]
569
569
  //
570
- const details = await this.publicGetSymbolsDetails();
570
+ const detailsPromise = this.publicGetSymbolsDetails();
571
571
  //
572
572
  // [
573
573
  // {
@@ -582,6 +582,7 @@ class bitfinex extends bitfinex$1 {
582
582
  // },
583
583
  // ]
584
584
  //
585
+ const [ids, details] = await Promise.all([idsPromise, detailsPromise]);
585
586
  const result = [];
586
587
  for (let i = 0; i < details.length; i++) {
587
588
  const market = details[i];
@@ -520,12 +520,13 @@ class bitfinex2 extends bitfinex2$1 {
520
520
  * @param {object} [params] extra parameters specific to the exchange API endpoint
521
521
  * @returns {object[]} an array of objects representing market data
522
522
  */
523
- let spotMarketsInfo = await this.publicGetConfPubInfoPair(params);
524
- let futuresMarketsInfo = await this.publicGetConfPubInfoPairFutures(params);
525
- spotMarketsInfo = this.safeValue(spotMarketsInfo, 0, []);
526
- futuresMarketsInfo = this.safeValue(futuresMarketsInfo, 0, []);
523
+ const spotMarketsInfoPromise = this.publicGetConfPubInfoPair(params);
524
+ const futuresMarketsInfoPromise = this.publicGetConfPubInfoPairFutures(params);
525
+ const marginIdsPromise = this.publicGetConfPubListPairMargin(params);
526
+ let [spotMarketsInfo, futuresMarketsInfo, marginIds] = await Promise.all([spotMarketsInfoPromise, futuresMarketsInfoPromise, marginIdsPromise]);
527
+ spotMarketsInfo = this.safeList(spotMarketsInfo, 0, []);
528
+ futuresMarketsInfo = this.safeList(futuresMarketsInfo, 0, []);
527
529
  const markets = this.arrayConcat(spotMarketsInfo, futuresMarketsInfo);
528
- let marginIds = await this.publicGetConfPubListPairMargin(params);
529
530
  marginIds = this.safeValue(marginIds, 0, []);
530
531
  //
531
532
  // [
@@ -100,7 +100,6 @@ class blofin extends blofin$1 {
100
100
  'fetchOrderBooks': false,
101
101
  'fetchOrders': false,
102
102
  'fetchOrderTrades': true,
103
- 'fetchPermissions': undefined,
104
103
  'fetchPosition': true,
105
104
  'fetchPositions': true,
106
105
  'fetchPositionsForSymbol': false,
@@ -640,7 +640,7 @@ class btcturk extends btcturk$1 {
640
640
  //
641
641
  return this.parseOHLCVs(response, market, timeframe, since, limit);
642
642
  }
643
- parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined) {
643
+ parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined, tail = false) {
644
644
  const results = [];
645
645
  const timestamp = this.safeValue(ohlcvs, 't');
646
646
  const high = this.safeValue(ohlcvs, 'h');
@@ -660,7 +660,7 @@ class btcturk extends btcturk$1 {
660
660
  results.push(this.parseOHLCV(ohlcv, market));
661
661
  }
662
662
  const sorted = this.sortBy(results, 0);
663
- return this.filterBySinceLimit(sorted, since, limit, 0);
663
+ return this.filterBySinceLimit(sorted, since, limit, 0, tail);
664
664
  }
665
665
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
666
666
  /**
@@ -5928,11 +5928,17 @@ class bybit extends bybit$1 {
5928
5928
  * @param {string} code unified currency code, default is undefined
5929
5929
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
5930
5930
  * @param {int} [limit] max number of ledger entrys to return, default is undefined
5931
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5931
+ * @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)
5932
5932
  * @param {string} [params.subType] if inverse will use v5/account/contract-transaction-log
5933
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5933
5934
  * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
5934
5935
  */
5935
5936
  await this.loadMarkets();
5937
+ let paginate = false;
5938
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
5939
+ if (paginate) {
5940
+ return await this.fetchPaginatedCallCursor('fetchLedger', code, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
5941
+ }
5936
5942
  const request = {
5937
5943
  // 'coin': currency['id'],
5938
5944
  // 'currency': currency['id'], // alias
@@ -5985,7 +5991,7 @@ class bybit extends bybit$1 {
5985
5991
  }
5986
5992
  }
5987
5993
  else {
5988
- response = await this.privateGetV2PrivateWalletFundRecords(this.extend(request, params));
5994
+ response = await this.privateGetV5AccountContractTransactionLog(this.extend(request, params));
5989
5995
  }
5990
5996
  //
5991
5997
  // {
@@ -981,8 +981,9 @@ class gate extends gate$1 {
981
981
  return this.arrayConcat(markets, optionMarkets);
982
982
  }
983
983
  async fetchSpotMarkets(params = {}) {
984
- const marginResponse = await this.publicMarginGetCurrencyPairs(params);
985
- const spotMarketsResponse = await this.publicSpotGetCurrencyPairs(params);
984
+ const marginPromise = this.publicMarginGetCurrencyPairs(params);
985
+ const spotMarketsPromise = this.publicSpotGetCurrencyPairs(params);
986
+ const [marginResponse, spotMarketsResponse] = await Promise.all([marginPromise, spotMarketsPromise]);
986
987
  const marginMarkets = this.indexBy(marginResponse, 'id');
987
988
  //
988
989
  // Spot
@@ -842,8 +842,9 @@ class gemini extends gemini$1 {
842
842
  return this.parseTicker(response, market);
843
843
  }
844
844
  async fetchTickerV1AndV2(symbol, params = {}) {
845
- const tickerA = await this.fetchTickerV1(symbol, params);
846
- const tickerB = await this.fetchTickerV2(symbol, params);
845
+ const tickerPromiseA = this.fetchTickerV1(symbol, params);
846
+ const tickerPromiseB = this.fetchTickerV2(symbol, params);
847
+ const [tickerA, tickerB] = await Promise.all([tickerPromiseA, tickerPromiseB]);
847
848
  return this.deepExtend(tickerA, {
848
849
  'open': tickerB['open'],
849
850
  'high': tickerB['high'],