ccxt 4.3.95 → 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 (45) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -7
  4. package/dist/cjs/src/base/Exchange.js +0 -4
  5. package/dist/cjs/src/bingx.js +2 -1
  6. package/dist/cjs/src/blofin.js +0 -1
  7. package/dist/cjs/src/bybit.js +8 -2
  8. package/dist/cjs/src/hyperliquid.js +262 -32
  9. package/dist/cjs/src/kucoin.js +12 -12
  10. package/dist/cjs/src/mexc.js +6 -0
  11. package/dist/cjs/src/okx.js +0 -1
  12. package/dist/cjs/src/p2b.js +0 -1
  13. package/dist/cjs/src/pro/binance.js +100 -2
  14. package/dist/cjs/src/pro/bybit.js +65 -4
  15. package/dist/cjs/src/pro/cryptocom.js +224 -0
  16. package/dist/cjs/src/pro/okx.js +264 -35
  17. package/dist/cjs/src/tradeogre.js +0 -1
  18. package/js/ccxt.d.ts +2 -8
  19. package/js/ccxt.js +2 -6
  20. package/js/src/base/Exchange.d.ts +0 -2
  21. package/js/src/base/Exchange.js +0 -4
  22. package/js/src/bingx.js +2 -1
  23. package/js/src/blofin.js +0 -1
  24. package/js/src/bybit.js +8 -2
  25. package/js/src/hyperliquid.d.ts +22 -0
  26. package/js/src/hyperliquid.js +262 -32
  27. package/js/src/kucoin.d.ts +1 -1
  28. package/js/src/kucoin.js +12 -12
  29. package/js/src/mexc.js +6 -0
  30. package/js/src/okx.js +0 -1
  31. package/js/src/p2b.js +0 -1
  32. package/js/src/pro/binance.d.ts +2 -0
  33. package/js/src/pro/binance.js +100 -2
  34. package/js/src/pro/bybit.d.ts +3 -1
  35. package/js/src/pro/bybit.js +65 -4
  36. package/js/src/pro/cryptocom.d.ts +10 -1
  37. package/js/src/pro/cryptocom.js +225 -1
  38. package/js/src/pro/okx.d.ts +10 -1
  39. package/js/src/pro/okx.js +264 -35
  40. package/js/src/tradeogre.js +0 -1
  41. package/package.json +1 -1
  42. package/js/src/abstract/bitbay.d.ts +0 -56
  43. package/js/src/abstract/bitbay.js +0 -11
  44. package/js/src/abstract/hitbtc3.d.ts +0 -118
  45. package/js/src/abstract/hitbtc3.js +0 -11
@@ -14,6 +14,7 @@ class okx extends okx$1 {
14
14
  'ws': true,
15
15
  'watchTicker': true,
16
16
  'watchTickers': true,
17
+ 'watchBidsAsks': true,
17
18
  'watchOrderBook': true,
18
19
  'watchTrades': true,
19
20
  'watchTradesForSymbols': true,
@@ -125,9 +126,8 @@ class okx extends okx$1 {
125
126
  }
126
127
  symbols = this.marketSymbols(symbols);
127
128
  const url = this.getUrl(channel, access);
128
- let messageHash = channel;
129
+ const messageHashes = [];
129
130
  const args = [];
130
- messageHash += '::' + symbols.join(',');
131
131
  for (let i = 0; i < symbols.length; i++) {
132
132
  const marketId = this.marketId(symbols[i]);
133
133
  const arg = {
@@ -135,12 +135,13 @@ class okx extends okx$1 {
135
135
  'instId': marketId,
136
136
  };
137
137
  args.push(this.extend(arg, params));
138
+ messageHashes.push(channel + '::' + symbols[i]);
138
139
  }
139
140
  const request = {
140
141
  'op': 'subscribe',
141
142
  'args': args,
142
143
  };
143
- return await this.watch(url, messageHash, request, messageHash);
144
+ return await this.watchMultiple(url, messageHashes, request, messageHashes);
144
145
  }
145
146
  async subscribe(access, messageHash, channel, symbol, params = {}) {
146
147
  await this.loadMarkets();
@@ -394,6 +395,19 @@ class okx extends okx$1 {
394
395
  const ticker = await this.watchTickers([symbol], params);
395
396
  return this.safeValue(ticker, symbol);
396
397
  }
398
+ async unWatchTicker(symbol, params = {}) {
399
+ /**
400
+ * @method
401
+ * @name okx#unWatchTicker
402
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-ws-tickers-channel
403
+ * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
404
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
405
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
406
+ * @param {string} [params.channel] the channel to subscribe to, tickers by default. Can be tickers, sprd-tickers, index-tickers, block-tickers
407
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
408
+ */
409
+ return await this.unWatchTickers([symbol], params);
410
+ }
397
411
  async watchTickers(symbols = undefined, params = {}) {
398
412
  /**
399
413
  * @method
@@ -415,6 +429,40 @@ class okx extends okx$1 {
415
429
  }
416
430
  return this.filterByArray(this.tickers, 'symbol', symbols);
417
431
  }
432
+ async unWatchTickers(symbols = undefined, params = {}) {
433
+ /**
434
+ * @method
435
+ * @name okx#unWatchTickers
436
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-ws-tickers-channel
437
+ * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
438
+ * @param {string[]} [symbols] unified symbol of the market to fetch the ticker for
439
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
440
+ * @param {string} [params.channel] the channel to subscribe to, tickers by default. Can be tickers, sprd-tickers, index-tickers, block-tickers
441
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
442
+ */
443
+ await this.loadMarkets();
444
+ symbols = this.marketSymbols(symbols, undefined, false);
445
+ let channel = undefined;
446
+ [channel, params] = this.handleOptionAndParams(params, 'watchTickers', 'channel', 'tickers');
447
+ const topics = [];
448
+ const messageHashes = [];
449
+ for (let i = 0; i < symbols.length; i++) {
450
+ const symbol = symbols[i];
451
+ messageHashes.push('unsubscribe:ticker:' + symbol);
452
+ const marketId = this.marketId(symbol);
453
+ const topic = {
454
+ 'channel': channel,
455
+ 'instId': marketId,
456
+ };
457
+ topics.push(topic);
458
+ }
459
+ const request = {
460
+ 'op': 'unsubscribe',
461
+ 'args': topics,
462
+ };
463
+ const url = this.getUrl(channel, 'public');
464
+ return await this.watchMultiple(url, messageHashes, request, messageHashes);
465
+ }
418
466
  handleTicker(client, message) {
419
467
  //
420
468
  // {
@@ -441,30 +489,109 @@ class okx extends okx$1 {
441
489
  // ]
442
490
  // }
443
491
  //
492
+ this.handleBidAsk(client, message);
444
493
  const arg = this.safeValue(message, 'arg', {});
494
+ const marketId = this.safeString(arg, 'instId');
495
+ const market = this.safeMarket(marketId, undefined, '-');
496
+ const symbol = market['symbol'];
445
497
  const channel = this.safeString(arg, 'channel');
446
498
  const data = this.safeValue(message, 'data', []);
447
- const newTickers = [];
499
+ const newTickers = {};
448
500
  for (let i = 0; i < data.length; i++) {
449
501
  const ticker = this.parseTicker(data[i]);
450
- const symbol = ticker['symbol'];
451
502
  this.tickers[symbol] = ticker;
452
- newTickers.push(ticker);
453
- }
454
- const messageHashes = this.findMessageHashes(client, channel + '::');
455
- for (let i = 0; i < messageHashes.length; i++) {
456
- const messageHash = messageHashes[i];
457
- const parts = messageHash.split('::');
458
- const symbolsString = parts[1];
459
- const symbols = symbolsString.split(',');
460
- const tickers = this.filterByArray(newTickers, 'symbol', symbols);
461
- const tickersSymbols = Object.keys(tickers);
462
- const numTickers = tickersSymbols.length;
463
- if (numTickers > 0) {
464
- client.resolve(tickers, messageHash);
465
- }
503
+ newTickers[symbol] = ticker;
466
504
  }
467
- return message;
505
+ const messageHash = channel + '::' + symbol;
506
+ client.resolve(newTickers, messageHash);
507
+ }
508
+ async watchBidsAsks(symbols = undefined, params = {}) {
509
+ /**
510
+ * @method
511
+ * @name okx#watchBidsAsks
512
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-ws-tickers-channel
513
+ * @description watches best bid & ask for symbols
514
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
515
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
516
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
517
+ */
518
+ await this.loadMarkets();
519
+ symbols = this.marketSymbols(symbols, undefined, false);
520
+ let channel = undefined;
521
+ [channel, params] = this.handleOptionAndParams(params, 'watchBidsAsks', 'channel', 'tickers');
522
+ const url = this.getUrl(channel, 'public');
523
+ const messageHashes = [];
524
+ const args = [];
525
+ for (let i = 0; i < symbols.length; i++) {
526
+ const marketId = this.marketId(symbols[i]);
527
+ const arg = {
528
+ 'channel': channel,
529
+ 'instId': marketId,
530
+ };
531
+ args.push(this.extend(arg, params));
532
+ messageHashes.push('bidask::' + symbols[i]);
533
+ }
534
+ const request = {
535
+ 'op': 'subscribe',
536
+ 'args': args,
537
+ };
538
+ const newTickers = await this.watchMultiple(url, messageHashes, request, messageHashes);
539
+ if (this.newUpdates) {
540
+ const tickers = {};
541
+ tickers[newTickers['symbol']] = newTickers;
542
+ return tickers;
543
+ }
544
+ return this.filterByArray(this.bidsasks, 'symbol', symbols);
545
+ }
546
+ handleBidAsk(client, message) {
547
+ //
548
+ // {
549
+ // "arg": { channel: "tickers", instId: "BTC-USDT" },
550
+ // "data": [
551
+ // {
552
+ // "instType": "SPOT",
553
+ // "instId": "BTC-USDT",
554
+ // "last": "31500.1",
555
+ // "lastSz": "0.00001754",
556
+ // "askPx": "31500.1",
557
+ // "askSz": "0.00998144",
558
+ // "bidPx": "31500",
559
+ // "bidSz": "3.05652439",
560
+ // "open24h": "31697",
561
+ // "high24h": "32248",
562
+ // "low24h": "31165.6",
563
+ // "sodUtc0": "31385.5",
564
+ // "sodUtc8": "32134.9",
565
+ // "volCcy24h": "503403597.38138519",
566
+ // "vol24h": "15937.10781721",
567
+ // "ts": "1626526618762"
568
+ // }
569
+ // ]
570
+ // }
571
+ //
572
+ const data = this.safeList(message, 'data', []);
573
+ const ticker = this.safeDict(data, 0, {});
574
+ const parsedTicker = this.parseWsBidAsk(ticker);
575
+ const symbol = parsedTicker['symbol'];
576
+ this.bidsasks[symbol] = parsedTicker;
577
+ const messageHash = 'bidask::' + symbol;
578
+ client.resolve(parsedTicker, messageHash);
579
+ }
580
+ parseWsBidAsk(ticker, market = undefined) {
581
+ const marketId = this.safeString(ticker, 'instId');
582
+ market = this.safeMarket(marketId, market);
583
+ const symbol = this.safeString(market, 'symbol');
584
+ const timestamp = this.safeInteger(ticker, 'ts');
585
+ return this.safeTicker({
586
+ 'symbol': symbol,
587
+ 'timestamp': timestamp,
588
+ 'datetime': this.iso8601(timestamp),
589
+ 'ask': this.safeString(ticker, 'askPx'),
590
+ 'askVolume': this.safeString(ticker, 'askSz'),
591
+ 'bid': this.safeString(ticker, 'bidPx'),
592
+ 'bidVolume': this.safeString(ticker, 'bidSz'),
593
+ 'info': ticker,
594
+ }, market);
468
595
  }
469
596
  async watchLiquidationsForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
470
597
  /**
@@ -579,12 +706,28 @@ class okx extends okx$1 {
579
706
  params = this.omit(params, ['stop', 'trigger']);
580
707
  await this.authenticate({ 'access': isStop ? 'business' : 'private' });
581
708
  symbols = this.marketSymbols(symbols, undefined, true, true);
582
- let messageHash = 'myLiquidations';
709
+ const messageHash = 'myLiquidations';
710
+ const messageHashes = [];
583
711
  if (symbols !== undefined) {
584
- messageHash += '::' + symbols.join(',');
712
+ for (let i = 0; i < symbols.length; i++) {
713
+ const symbol = symbols[i];
714
+ messageHashes.push(messageHash + '::' + symbol);
715
+ }
716
+ }
717
+ else {
718
+ messageHashes.push(messageHash);
585
719
  }
586
720
  const channel = 'balance_and_position';
587
- const newLiquidations = await this.subscribe('private', messageHash, channel, undefined, params);
721
+ const request = {
722
+ 'op': 'subscribe',
723
+ 'args': [
724
+ {
725
+ 'channel': channel,
726
+ },
727
+ ],
728
+ };
729
+ const url = this.getUrl(channel, 'private');
730
+ const newLiquidations = await this.watchMultiple(url, messageHashes, this.deepExtend(request, params), messageHashes);
588
731
  if (this.newUpdates) {
589
732
  return newLiquidations;
590
733
  }
@@ -751,6 +894,19 @@ class okx extends okx$1 {
751
894
  }
752
895
  return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
753
896
  }
897
+ async unWatchOHLCV(symbol, timeframe = '1m', params = {}) {
898
+ /**
899
+ * @method
900
+ * @name okx#unWatchOHLCV
901
+ * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
902
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
903
+ * @param {string} timeframe the length of time each candle represents
904
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
905
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
906
+ */
907
+ await this.loadMarkets();
908
+ return await this.unWatchOHLCVForSymbols([[symbol, timeframe]], params);
909
+ }
754
910
  async watchOHLCVForSymbols(symbolsAndTimeframes, since = undefined, limit = undefined, params = {}) {
755
911
  /**
756
912
  * @method
@@ -795,6 +951,43 @@ class okx extends okx$1 {
795
951
  const filtered = this.filterBySinceLimit(candles, since, limit, 0, true);
796
952
  return this.createOHLCVObject(symbol, timeframe, filtered);
797
953
  }
954
+ async unWatchOHLCVForSymbols(symbolsAndTimeframes, params = {}) {
955
+ /**
956
+ * @method
957
+ * @name okx#unWatchOHLCVForSymbols
958
+ * @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
959
+ * @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
960
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
961
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
962
+ */
963
+ const symbolsLength = symbolsAndTimeframes.length;
964
+ if (symbolsLength === 0 || !Array.isArray(symbolsAndTimeframes[0])) {
965
+ throw new errors.ArgumentsRequired(this.id + " watchOHLCVForSymbols() requires a an array of symbols and timeframes, like [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]");
966
+ }
967
+ await this.loadMarkets();
968
+ const topics = [];
969
+ const messageHashes = [];
970
+ for (let i = 0; i < symbolsAndTimeframes.length; i++) {
971
+ const symbolAndTimeframe = symbolsAndTimeframes[i];
972
+ const sym = symbolAndTimeframe[0];
973
+ const tf = symbolAndTimeframe[1];
974
+ const marketId = this.marketId(sym);
975
+ const interval = this.safeString(this.timeframes, tf, tf);
976
+ const channel = 'candle' + interval;
977
+ const topic = {
978
+ 'channel': channel,
979
+ 'instId': marketId,
980
+ };
981
+ topics.push(topic);
982
+ messageHashes.push('unsubscribe:multi:' + channel + ':' + sym);
983
+ }
984
+ const request = {
985
+ 'op': 'unsubscribe',
986
+ 'args': topics,
987
+ };
988
+ const url = this.getUrl('candle', 'public');
989
+ return await this.watchMultiple(url, messageHashes, request, messageHashes);
990
+ }
798
991
  handleOHLCV(client, message) {
799
992
  //
800
993
  // {
@@ -1502,6 +1695,9 @@ class okx extends okx$1 {
1502
1695
  // }
1503
1696
  //
1504
1697
  const arg = this.safeValue(message, 'arg', {});
1698
+ const marketId = this.safeString(arg, 'instId');
1699
+ const market = this.safeMarket(marketId, undefined, '-');
1700
+ const symbol = market['symbol'];
1505
1701
  const channel = this.safeString(arg, 'channel', '');
1506
1702
  const data = this.safeValue(message, 'data', []);
1507
1703
  if (this.positions === undefined) {
@@ -1522,18 +1718,11 @@ class okx extends okx$1 {
1522
1718
  newPositions.push(position);
1523
1719
  cache.append(position);
1524
1720
  }
1525
- const messageHashes = this.findMessageHashes(client, channel + '::');
1526
- for (let i = 0; i < messageHashes.length; i++) {
1527
- const messageHash = messageHashes[i];
1528
- const parts = messageHash.split('::');
1529
- const symbolsString = parts[1];
1530
- const symbols = symbolsString.split(',');
1531
- const positions = this.filterByArray(newPositions, 'symbol', symbols, false);
1532
- if (!this.isEmpty(positions)) {
1533
- client.resolve(positions, messageHash);
1534
- }
1721
+ let messageHash = channel;
1722
+ if (symbol !== undefined) {
1723
+ messageHash = channel + '::' + symbol;
1535
1724
  }
1536
- client.resolve(newPositions, channel);
1725
+ client.resolve(newPositions, messageHash);
1537
1726
  }
1538
1727
  async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1539
1728
  /**
@@ -2167,6 +2356,40 @@ class okx extends okx$1 {
2167
2356
  client.reject(error, subMessageHash);
2168
2357
  client.resolve(true, messageHash);
2169
2358
  }
2359
+ handleUnsubscriptionOHLCV(client, symbol, channel) {
2360
+ const tf = channel.replace('candle', '');
2361
+ const timeframe = this.findTimeframe(tf);
2362
+ const subMessageHash = 'multi:' + channel + ':' + symbol;
2363
+ const messageHash = 'unsubscribe:' + subMessageHash;
2364
+ if (subMessageHash in client.subscriptions) {
2365
+ delete client.subscriptions[subMessageHash];
2366
+ }
2367
+ if (messageHash in client.subscriptions) {
2368
+ delete client.subscriptions[messageHash];
2369
+ }
2370
+ if (timeframe in this.ohlcvs[symbol]) {
2371
+ delete this.ohlcvs[symbol][timeframe];
2372
+ }
2373
+ const error = new errors.UnsubscribeError(this.id + ' ' + subMessageHash);
2374
+ client.reject(error, subMessageHash);
2375
+ client.resolve(true, messageHash);
2376
+ }
2377
+ handleUnsubscriptionTicker(client, symbol, channel) {
2378
+ const subMessageHash = channel + '::' + symbol;
2379
+ const messageHash = 'unsubscribe:ticker:' + symbol;
2380
+ if (subMessageHash in client.subscriptions) {
2381
+ delete client.subscriptions[subMessageHash];
2382
+ }
2383
+ if (messageHash in client.subscriptions) {
2384
+ delete client.subscriptions[messageHash];
2385
+ }
2386
+ if (symbol in this.tickers) {
2387
+ delete this.tickers[symbol];
2388
+ }
2389
+ const error = new errors.UnsubscribeError(this.id + ' ' + subMessageHash);
2390
+ client.reject(error, subMessageHash);
2391
+ client.resolve(true, messageHash);
2392
+ }
2170
2393
  handleUnsubscription(client, message) {
2171
2394
  //
2172
2395
  // {
@@ -2179,7 +2402,7 @@ class okx extends okx$1 {
2179
2402
  // }
2180
2403
  // arg might be an array or list
2181
2404
  const arg = this.safeDict(message, 'arg', {});
2182
- const channel = this.safeString(arg, 'channel');
2405
+ const channel = this.safeString(arg, 'channel', '');
2183
2406
  const marketId = this.safeString(arg, 'instId');
2184
2407
  const symbol = this.safeSymbol(marketId);
2185
2408
  if (channel === 'trades') {
@@ -2188,6 +2411,12 @@ class okx extends okx$1 {
2188
2411
  else if (channel.startsWith('bbo') || channel.startsWith('book')) {
2189
2412
  this.handleUnsubscriptionOrderBook(client, symbol, channel);
2190
2413
  }
2414
+ else if (channel.indexOf('tickers') > -1) {
2415
+ this.handleUnsubscriptionTicker(client, symbol, channel);
2416
+ }
2417
+ else if (channel.startsWith('candle')) {
2418
+ this.handleUnsubscriptionOHLCV(client, symbol, channel);
2419
+ }
2191
2420
  }
2192
2421
  }
2193
2422
 
@@ -77,7 +77,6 @@ class tradeogre extends tradeogre$1 {
77
77
  'fetchOrderBooks': false,
78
78
  'fetchOrders': false,
79
79
  'fetchOrderTrades': false,
80
- 'fetchPermissions': false,
81
80
  'fetchPosition': false,
82
81
  'fetchPositionHistory': false,
83
82
  'fetchPositionMode': false,
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
7
- declare const version = "4.3.94";
7
+ declare const version = "4.3.95";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -17,7 +17,6 @@ import binanceusdm from './src/binanceusdm.js';
17
17
  import bingx from './src/bingx.js';
18
18
  import bit2c from './src/bit2c.js';
19
19
  import bitbank from './src/bitbank.js';
20
- import bitbay from './src/bitbay.js';
21
20
  import bitbns from './src/bitbns.js';
22
21
  import bitcoincom from './src/bitcoincom.js';
23
22
  import bitfinex from './src/bitfinex.js';
@@ -67,7 +66,6 @@ import gateio from './src/gateio.js';
67
66
  import gemini from './src/gemini.js';
68
67
  import hashkey from './src/hashkey.js';
69
68
  import hitbtc from './src/hitbtc.js';
70
- import hitbtc3 from './src/hitbtc3.js';
71
69
  import hollaex from './src/hollaex.js';
72
70
  import htx from './src/htx.js';
73
71
  import huobi from './src/huobi.js';
@@ -199,7 +197,6 @@ declare const exchanges: {
199
197
  bingx: typeof bingx;
200
198
  bit2c: typeof bit2c;
201
199
  bitbank: typeof bitbank;
202
- bitbay: typeof bitbay;
203
200
  bitbns: typeof bitbns;
204
201
  bitcoincom: typeof bitcoincom;
205
202
  bitfinex: typeof bitfinex;
@@ -249,7 +246,6 @@ declare const exchanges: {
249
246
  gemini: typeof gemini;
250
247
  hashkey: typeof hashkey;
251
248
  hitbtc: typeof hitbtc;
252
- hitbtc3: typeof hitbtc3;
253
249
  hollaex: typeof hollaex;
254
250
  htx: typeof htx;
255
251
  huobi: typeof huobi;
@@ -462,7 +458,6 @@ declare const ccxt: {
462
458
  bingx: typeof bingx;
463
459
  bit2c: typeof bit2c;
464
460
  bitbank: typeof bitbank;
465
- bitbay: typeof bitbay;
466
461
  bitbns: typeof bitbns;
467
462
  bitcoincom: typeof bitcoincom;
468
463
  bitfinex: typeof bitfinex;
@@ -512,7 +507,6 @@ declare const ccxt: {
512
507
  gemini: typeof gemini;
513
508
  hashkey: typeof hashkey;
514
509
  hitbtc: typeof hitbtc;
515
- hitbtc3: typeof hitbtc3;
516
510
  hollaex: typeof hollaex;
517
511
  htx: typeof htx;
518
512
  huobi: typeof huobi;
@@ -561,5 +555,5 @@ declare const ccxt: {
561
555
  zaif: typeof zaif;
562
556
  zonda: typeof zonda;
563
557
  } & typeof functions & typeof errors;
564
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
558
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
565
559
  export default ccxt;
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.95';
41
+ const version = '4.3.96';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -53,7 +53,6 @@ import binanceusdm from './src/binanceusdm.js';
53
53
  import bingx from './src/bingx.js';
54
54
  import bit2c from './src/bit2c.js';
55
55
  import bitbank from './src/bitbank.js';
56
- import bitbay from './src/bitbay.js';
57
56
  import bitbns from './src/bitbns.js';
58
57
  import bitcoincom from './src/bitcoincom.js';
59
58
  import bitfinex from './src/bitfinex.js';
@@ -103,7 +102,6 @@ import gateio from './src/gateio.js';
103
102
  import gemini from './src/gemini.js';
104
103
  import hashkey from './src/hashkey.js';
105
104
  import hitbtc from './src/hitbtc.js';
106
- import hitbtc3 from './src/hitbtc3.js';
107
105
  import hollaex from './src/hollaex.js';
108
106
  import htx from './src/htx.js';
109
107
  import huobi from './src/huobi.js';
@@ -236,7 +234,6 @@ const exchanges = {
236
234
  'bingx': bingx,
237
235
  'bit2c': bit2c,
238
236
  'bitbank': bitbank,
239
- 'bitbay': bitbay,
240
237
  'bitbns': bitbns,
241
238
  'bitcoincom': bitcoincom,
242
239
  'bitfinex': bitfinex,
@@ -286,7 +283,6 @@ const exchanges = {
286
283
  'gemini': gemini,
287
284
  'hashkey': hashkey,
288
285
  'hitbtc': hitbtc,
289
- 'hitbtc3': hitbtc3,
290
286
  'hollaex': hollaex,
291
287
  'htx': htx,
292
288
  'huobi': huobi,
@@ -420,6 +416,6 @@ pro.exchanges = Object.keys(pro);
420
416
  pro['Exchange'] = Exchange; // now the same for rest and ts
421
417
  //-----------------------------------------------------------------------------
422
418
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
423
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
419
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
424
420
  export default ccxt;
425
421
  //-----------------------------------------------------------------------------
@@ -538,7 +538,6 @@ export default class Exchange {
538
538
  fetchOrdersWs: any;
539
539
  fetchOrderTrades: any;
540
540
  fetchOrderWs: any;
541
- fetchPermissions: any;
542
541
  fetchPosition: any;
543
542
  fetchPositionHistory: any;
544
543
  fetchPositionsHistory: any;
@@ -914,7 +913,6 @@ export default class Exchange {
914
913
  editLimitOrder(id: string, symbol: string, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
915
914
  editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
916
915
  editOrderWs(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
917
- fetchPermissions(params?: {}): Promise<{}>;
918
916
  fetchPosition(symbol: string, params?: {}): Promise<Position>;
919
917
  fetchPositionWs(symbol: string, params?: {}): Promise<Position[]>;
920
918
  watchPosition(symbol?: Str, params?: {}): Promise<Position>;
@@ -1420,7 +1420,6 @@ export default class Exchange {
1420
1420
  'fetchOrdersWs': undefined,
1421
1421
  'fetchOrderTrades': undefined,
1422
1422
  'fetchOrderWs': undefined,
1423
- 'fetchPermissions': undefined,
1424
1423
  'fetchPosition': undefined,
1425
1424
  'fetchPositionHistory': undefined,
1426
1425
  'fetchPositionsHistory': undefined,
@@ -3983,9 +3982,6 @@ export default class Exchange {
3983
3982
  await this.cancelOrderWs(id, symbol);
3984
3983
  return await this.createOrderWs(symbol, type, side, amount, price, params);
3985
3984
  }
3986
- async fetchPermissions(params = {}) {
3987
- throw new NotSupported(this.id + ' fetchPermissions() is not supported yet');
3988
- }
3989
3985
  async fetchPosition(symbol, params = {}) {
3990
3986
  throw new NotSupported(this.id + ' fetchPosition() is not supported yet');
3991
3987
  }
package/js/src/bingx.js CHANGED
@@ -466,7 +466,8 @@ export default class bingx extends Exchange {
466
466
  'broad': {},
467
467
  },
468
468
  'commonCurrencies': {
469
- 'SNOW': 'Snowman', // Snowman vs SnowSwap conflict
469
+ 'SNOW': 'Snowman',
470
+ 'OMNI': 'OmniCat',
470
471
  },
471
472
  'options': {
472
473
  'defaultType': 'spot',
package/js/src/blofin.js CHANGED
@@ -103,7 +103,6 @@ export default class blofin extends Exchange {
103
103
  'fetchOrderBooks': false,
104
104
  'fetchOrders': false,
105
105
  'fetchOrderTrades': true,
106
- 'fetchPermissions': undefined,
107
106
  'fetchPosition': true,
108
107
  'fetchPositions': true,
109
108
  'fetchPositionsForSymbol': false,
package/js/src/bybit.js CHANGED
@@ -5931,11 +5931,17 @@ export default class bybit extends Exchange {
5931
5931
  * @param {string} code unified currency code, default is undefined
5932
5932
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
5933
5933
  * @param {int} [limit] max number of ledger entrys to return, default is undefined
5934
- * @param {object} [params] extra parameters specific to the exchange API endpoint
5934
+ * @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)
5935
5935
  * @param {string} [params.subType] if inverse will use v5/account/contract-transaction-log
5936
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
5936
5937
  * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
5937
5938
  */
5938
5939
  await this.loadMarkets();
5940
+ let paginate = false;
5941
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
5942
+ if (paginate) {
5943
+ return await this.fetchPaginatedCallCursor('fetchLedger', code, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
5944
+ }
5939
5945
  const request = {
5940
5946
  // 'coin': currency['id'],
5941
5947
  // 'currency': currency['id'], // alias
@@ -5988,7 +5994,7 @@ export default class bybit extends Exchange {
5988
5994
  }
5989
5995
  }
5990
5996
  else {
5991
- response = await this.privateGetV2PrivateWalletFundRecords(this.extend(request, params));
5997
+ response = await this.privateGetV5AccountContractTransactionLog(this.extend(request, params));
5992
5998
  }
5993
5999
  //
5994
6000
  // {
@@ -88,6 +88,28 @@ export default class hyperliquid extends Exchange {
88
88
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
89
89
  fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
90
90
  parseTradingFee(fee: Dict, market?: Market): TradingFeeInterface;
91
+ fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
92
+ parseLedgerEntry(item: Dict, currency?: Currency): {
93
+ id: string;
94
+ direction: any;
95
+ account: any;
96
+ referenceAccount: string;
97
+ referenceId: string;
98
+ type: string;
99
+ currency: any;
100
+ amount: number;
101
+ timestamp: number;
102
+ datetime: string;
103
+ before: any;
104
+ after: any;
105
+ status: any;
106
+ fee: any;
107
+ info: Dict;
108
+ };
109
+ parseLedgerEntryType(type: any): string;
110
+ fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
111
+ fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
112
+ extractTypeFromDelta(data?: any[]): any[];
91
113
  formatVaultAddress(address?: Str): string;
92
114
  handlePublicAddress(methodName: string, params: Dict): any[];
93
115
  coinToMarketId(coin: Str): string;