ccxt 4.5.1 → 4.5.3

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 (73) hide show
  1. package/README.md +110 -112
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -9
  4. package/dist/cjs/src/ascendex.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +11 -0
  6. package/dist/cjs/src/binance.js +25 -25
  7. package/dist/cjs/src/bitget.js +2 -2
  8. package/dist/cjs/src/coincatch.js +2 -2
  9. package/dist/cjs/src/gate.js +27 -12
  10. package/dist/cjs/src/gemini.js +3 -3
  11. package/dist/cjs/src/htx.js +4 -4
  12. package/dist/cjs/src/indodax.js +11 -12
  13. package/dist/cjs/src/kucoinfutures.js +8 -8
  14. package/dist/cjs/src/mexc.js +30 -1
  15. package/dist/cjs/src/okx.js +19 -5
  16. package/dist/cjs/src/poloniex.js +1 -1
  17. package/dist/cjs/src/pro/binance.js +3 -3
  18. package/dist/cjs/src/pro/bitfinex.js +140 -0
  19. package/dist/cjs/src/pro/bitget.js +222 -42
  20. package/dist/cjs/src/pro/bitmart.js +1 -1
  21. package/dist/cjs/src/pro/bybit.js +3 -3
  22. package/dist/cjs/src/pro/gemini.js +7 -2
  23. package/dist/cjs/src/pro/hyperliquid.js +5 -0
  24. package/dist/cjs/src/pro/kraken.js +4 -6
  25. package/dist/cjs/src/pro/kucoin.js +64 -0
  26. package/dist/cjs/src/pro/mexc.js +7 -3
  27. package/dist/cjs/src/zonda.js +12 -0
  28. package/js/ccxt.d.ts +2 -11
  29. package/js/ccxt.js +2 -8
  30. package/js/src/ascendex.js +1 -1
  31. package/js/src/base/Exchange.d.ts +2 -0
  32. package/js/src/base/Exchange.js +11 -0
  33. package/js/src/binance.d.ts +1 -1
  34. package/js/src/binance.js +25 -25
  35. package/js/src/bitget.js +2 -2
  36. package/js/src/coincatch.js +2 -2
  37. package/js/src/gate.js +27 -12
  38. package/js/src/gemini.js +3 -3
  39. package/js/src/htx.js +4 -4
  40. package/js/src/indodax.js +11 -12
  41. package/js/src/kucoinfutures.js +8 -8
  42. package/js/src/mexc.d.ts +3 -0
  43. package/js/src/mexc.js +30 -1
  44. package/js/src/okx.d.ts +4 -2
  45. package/js/src/okx.js +19 -5
  46. package/js/src/poloniex.js +1 -1
  47. package/js/src/pro/binance.js +3 -3
  48. package/js/src/pro/bitfinex.d.ts +30 -0
  49. package/js/src/pro/bitfinex.js +140 -0
  50. package/js/src/pro/bitget.d.ts +10 -0
  51. package/js/src/pro/bitget.js +228 -42
  52. package/js/src/pro/bitmart.js +1 -1
  53. package/js/src/pro/bybit.d.ts +2 -2
  54. package/js/src/pro/bybit.js +3 -3
  55. package/js/src/pro/gemini.d.ts +1 -1
  56. package/js/src/pro/gemini.js +7 -2
  57. package/js/src/pro/hyperliquid.js +5 -0
  58. package/js/src/pro/kraken.js +4 -6
  59. package/js/src/pro/kucoin.d.ts +22 -0
  60. package/js/src/pro/kucoin.js +64 -0
  61. package/js/src/pro/mexc.js +7 -3
  62. package/js/src/zonda.js +12 -0
  63. package/package.json +2 -1
  64. package/js/src/abstract/ellipx.d.ts +0 -28
  65. package/js/src/abstract/ellipx.js +0 -11
  66. package/js/src/abstract/vertex.d.ts +0 -22
  67. package/js/src/abstract/vertex.js +0 -11
  68. package/js/src/ellipx.d.ts +0 -237
  69. package/js/src/ellipx.js +0 -2071
  70. package/js/src/pro/vertex.d.ts +0 -104
  71. package/js/src/pro/vertex.js +0 -999
  72. package/js/src/vertex.d.ts +0 -346
  73. package/js/src/vertex.js +0 -3146
@@ -31,6 +31,11 @@ class kucoin extends kucoin$1["default"] {
31
31
  'watchOrderBookForSymbols': true,
32
32
  'watchBalance': true,
33
33
  'watchOHLCV': true,
34
+ 'unWatchTicker': true,
35
+ 'unWatchOHLCV': true,
36
+ 'unWatchOrderBook': true,
37
+ 'unWatchTrades': true,
38
+ 'unWatchhTradesForSymbols': true,
34
39
  },
35
40
  'options': {
36
41
  'tradesLimit': 1000,
@@ -138,6 +143,9 @@ class kucoin extends kucoin$1["default"] {
138
143
  }
139
144
  return await this.watch(url, messageHash, message, subscriptionHash, subscription);
140
145
  }
146
+ async unSubscribe(url, messageHash, topic, subscriptionHash, params = {}, subscription = undefined) {
147
+ return await this.unSubscribeMultiple(url, [messageHash], topic, [subscriptionHash], params, subscription);
148
+ }
141
149
  async subscribeMultiple(url, messageHashes, topic, subscriptionHashes, params = {}, subscription = undefined) {
142
150
  const requestId = this.requestId().toString();
143
151
  const request = {
@@ -196,6 +204,34 @@ class kucoin extends kucoin$1["default"] {
196
204
  const messageHash = 'ticker:' + symbol;
197
205
  return await this.subscribe(url, messageHash, topic, query);
198
206
  }
207
+ /**
208
+ * @method
209
+ * @name kucoin#unWatchTicker
210
+ * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
211
+ * @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/market-snapshot
212
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
213
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
214
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
215
+ */
216
+ async unWatchTicker(symbol, params = {}) {
217
+ await this.loadMarkets();
218
+ const market = this.market(symbol);
219
+ symbol = market['symbol'];
220
+ const url = await this.negotiate(false);
221
+ let method = undefined;
222
+ [method, params] = this.handleOptionAndParams(params, 'watchTicker', 'method', '/market/snapshot');
223
+ const topic = method + ':' + market['id'];
224
+ const messageHash = 'unsubscribe:ticker:' + symbol;
225
+ const subMessageHash = 'ticker:' + symbol;
226
+ const subscription = {
227
+ 'messageHashes': [messageHash],
228
+ 'subMessageHashes': [subMessageHash],
229
+ 'topic': 'trades',
230
+ 'unsubscribe': true,
231
+ 'symbols': [symbol],
232
+ };
233
+ return await this.unSubscribe(url, messageHash, topic, subMessageHash, params, subscription);
234
+ }
199
235
  /**
200
236
  * @method
201
237
  * @name kucoin#watchTickers
@@ -436,6 +472,34 @@ class kucoin extends kucoin$1["default"] {
436
472
  }
437
473
  return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
438
474
  }
475
+ /**
476
+ * @method
477
+ * @name kucoin#unWatchOHLCV
478
+ * @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
479
+ * @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/klines
480
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
481
+ * @param {string} timeframe the length of time each candle represents
482
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
483
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
484
+ */
485
+ async unWatchOHLCV(symbol, timeframe = '1m', params = {}) {
486
+ await this.loadMarkets();
487
+ const url = await this.negotiate(false);
488
+ const market = this.market(symbol);
489
+ symbol = market['symbol'];
490
+ const period = this.safeString(this.timeframes, timeframe, timeframe);
491
+ const topic = '/market/candles:' + market['id'] + '_' + period;
492
+ const messageHash = 'unsubscribe:candles:' + symbol + ':' + timeframe;
493
+ const subMessageHash = 'candles:' + symbol + ':' + timeframe;
494
+ const subscription = {
495
+ 'messageHashes': [messageHash],
496
+ 'subMessageHashes': [subMessageHash],
497
+ 'topic': 'ohlcv',
498
+ 'unsubscribe': true,
499
+ 'symbols': [symbol],
500
+ };
501
+ return await this.unSubscribe(url, messageHash, topic, messageHash, params, subscription);
502
+ }
439
503
  handleOHLCV(client, message) {
440
504
  //
441
505
  // {
@@ -176,7 +176,7 @@ class mexc extends mexc$1["default"] {
176
176
  this.handleBidAsk(client, message);
177
177
  const rawTicker = this.safeDictN(message, ['d', 'data', 'publicAggreBookTicker']);
178
178
  const marketId = this.safeString2(message, 's', 'symbol');
179
- const timestamp = this.safeInteger2(message, 't', 'sendtime');
179
+ const timestamp = this.safeInteger2(message, 't', 'sendTime');
180
180
  const market = this.safeMarket(marketId);
181
181
  const symbol = market['symbol'];
182
182
  let ticker = undefined;
@@ -1532,7 +1532,7 @@ class mexc extends mexc$1["default"] {
1532
1532
  // "ts": 1680059188190
1533
1533
  // }
1534
1534
  //
1535
- const c = this.safeString2(message, 'c', 'channel');
1535
+ const c = this.safeString(message, 'c'); // do not add 'channel' here, this is especially for spot
1536
1536
  const type = (c === undefined) ? 'swap' : 'spot';
1537
1537
  const messageHash = 'balance:' + type;
1538
1538
  const data = this.safeDictN(message, ['d', 'data', 'privateAccount']);
@@ -1547,7 +1547,11 @@ class mexc extends mexc$1["default"] {
1547
1547
  const currencyId = this.safeStringN(data, ['a', 'currency', 'vcoinName']);
1548
1548
  const code = this.safeCurrencyCode(currencyId);
1549
1549
  const account = this.account();
1550
- account['total'] = this.safeStringN(data, ['f', 'availableBalance', 'balanceAmount']);
1550
+ const balanceAmount = this.safeString(data, 'balanceAmount');
1551
+ if (balanceAmount !== undefined) {
1552
+ account['free'] = balanceAmount;
1553
+ }
1554
+ account['total'] = this.safeStringN(data, ['f', 'availableBalance']);
1551
1555
  account['used'] = this.safeStringN(data, ['l', 'frozenBalance', 'frozenAmount']);
1552
1556
  this.balance[type][code] = account;
1553
1557
  this.balance[type] = this.safeBalance(this.balance[type]);
@@ -29,6 +29,9 @@ class zonda extends zonda$1["default"] {
29
29
  'future': false,
30
30
  'option': false,
31
31
  'addMargin': false,
32
+ 'borrowCrossMargin': false,
33
+ 'borrowIsolatedMargin': false,
34
+ 'borrowMargin': false,
32
35
  'cancelAllOrders': false,
33
36
  'cancelOrder': true,
34
37
  'cancelOrders': false,
@@ -37,6 +40,7 @@ class zonda extends zonda$1["default"] {
37
40
  'createDepositAddress': false,
38
41
  'createOrder': true,
39
42
  'createReduceOnlyOrder': false,
43
+ 'fetchAllGreeks': false,
40
44
  'fetchBalance': true,
41
45
  'fetchBorrowInterest': false,
42
46
  'fetchBorrowRate': false,
@@ -67,12 +71,15 @@ class zonda extends zonda$1["default"] {
67
71
  'fetchLeverages': false,
68
72
  'fetchLeverageTiers': false,
69
73
  'fetchLiquidations': false,
74
+ 'fetchLongShortRatio': false,
75
+ 'fetchLongShortRatioHistory': false,
70
76
  'fetchMarginAdjustmentHistory': false,
71
77
  'fetchMarginMode': false,
72
78
  'fetchMarginModes': false,
73
79
  'fetchMarketLeverageTiers': false,
74
80
  'fetchMarkets': true,
75
81
  'fetchMarkOHLCV': false,
82
+ 'fetchMarkPrice': false,
76
83
  'fetchMarkPrices': false,
77
84
  'fetchMyLiquidations': false,
78
85
  'fetchMySettlementHistory': false,
@@ -80,6 +87,7 @@ class zonda extends zonda$1["default"] {
80
87
  'fetchOHLCV': true,
81
88
  'fetchOpenInterest': false,
82
89
  'fetchOpenInterestHistory': false,
90
+ 'fetchOpenInterests': false,
83
91
  'fetchOpenOrder': false,
84
92
  'fetchOpenOrders': true,
85
93
  'fetchOption': false,
@@ -87,8 +95,11 @@ class zonda extends zonda$1["default"] {
87
95
  'fetchOrderBook': true,
88
96
  'fetchOrderBooks': false,
89
97
  'fetchPosition': false,
98
+ 'fetchPositionHistory': false,
90
99
  'fetchPositionMode': false,
91
100
  'fetchPositions': false,
101
+ 'fetchPositionsForSymbol': false,
102
+ 'fetchPositionsHistory': false,
92
103
  'fetchPositionsRisk': false,
93
104
  'fetchPremiumIndexOHLCV': false,
94
105
  'fetchSettlementHistory': false,
@@ -109,6 +120,7 @@ class zonda extends zonda$1["default"] {
109
120
  'reduceMargin': false,
110
121
  'repayCrossMargin': false,
111
122
  'repayIsolatedMargin': false,
123
+ 'repayMargin': false,
112
124
  'setLeverage': false,
113
125
  'setMargin': false,
114
126
  'setMarginMode': 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, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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.5.0";
7
+ declare const version = "4.5.2";
8
8
  import alpaca from './src/alpaca.js';
9
9
  import apex from './src/apex.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -58,7 +58,6 @@ import delta from './src/delta.js';
58
58
  import deribit from './src/deribit.js';
59
59
  import derive from './src/derive.js';
60
60
  import digifinex from './src/digifinex.js';
61
- import ellipx from './src/ellipx.js';
62
61
  import exmo from './src/exmo.js';
63
62
  import fmfwio from './src/fmfwio.js';
64
63
  import foxbit from './src/foxbit.js';
@@ -103,7 +102,6 @@ import timex from './src/timex.js';
103
102
  import tokocrypto from './src/tokocrypto.js';
104
103
  import tradeogre from './src/tradeogre.js';
105
104
  import upbit from './src/upbit.js';
106
- import vertex from './src/vertex.js';
107
105
  import wavesexchange from './src/wavesexchange.js';
108
106
  import whitebit from './src/whitebit.js';
109
107
  import woo from './src/woo.js';
@@ -180,7 +178,6 @@ import poloniexPro from './src/pro/poloniex.js';
180
178
  import probitPro from './src/pro/probit.js';
181
179
  import tradeogrePro from './src/pro/tradeogre.js';
182
180
  import upbitPro from './src/pro/upbit.js';
183
- import vertexPro from './src/pro/vertex.js';
184
181
  import whitebitPro from './src/pro/whitebit.js';
185
182
  import wooPro from './src/pro/woo.js';
186
183
  import woofiproPro from './src/pro/woofipro.js';
@@ -239,7 +236,6 @@ declare const exchanges: {
239
236
  deribit: typeof deribit;
240
237
  derive: typeof derive;
241
238
  digifinex: typeof digifinex;
242
- ellipx: typeof ellipx;
243
239
  exmo: typeof exmo;
244
240
  fmfwio: typeof fmfwio;
245
241
  foxbit: typeof foxbit;
@@ -284,7 +280,6 @@ declare const exchanges: {
284
280
  tokocrypto: typeof tokocrypto;
285
281
  tradeogre: typeof tradeogre;
286
282
  upbit: typeof upbit;
287
- vertex: typeof vertex;
288
283
  wavesexchange: typeof wavesexchange;
289
284
  whitebit: typeof whitebit;
290
285
  woo: typeof woo;
@@ -363,7 +358,6 @@ declare const pro: {
363
358
  probit: typeof probitPro;
364
359
  tradeogre: typeof tradeogrePro;
365
360
  upbit: typeof upbitPro;
366
- vertex: typeof vertexPro;
367
361
  whitebit: typeof whitebitPro;
368
362
  woo: typeof wooPro;
369
363
  woofipro: typeof woofiproPro;
@@ -443,7 +437,6 @@ declare const ccxt: {
443
437
  probit: typeof probitPro;
444
438
  tradeogre: typeof tradeogrePro;
445
439
  upbit: typeof upbitPro;
446
- vertex: typeof vertexPro;
447
440
  whitebit: typeof whitebitPro;
448
441
  woo: typeof wooPro;
449
442
  woofipro: typeof woofiproPro;
@@ -503,7 +496,6 @@ declare const ccxt: {
503
496
  deribit: typeof deribit;
504
497
  derive: typeof derive;
505
498
  digifinex: typeof digifinex;
506
- ellipx: typeof ellipx;
507
499
  exmo: typeof exmo;
508
500
  fmfwio: typeof fmfwio;
509
501
  foxbit: typeof foxbit;
@@ -548,7 +540,6 @@ declare const ccxt: {
548
540
  tokocrypto: typeof tokocrypto;
549
541
  tradeogre: typeof tradeogre;
550
542
  upbit: typeof upbit;
551
- vertex: typeof vertex;
552
543
  wavesexchange: typeof wavesexchange;
553
544
  whitebit: typeof whitebit;
554
545
  woo: typeof woo;
@@ -558,5 +549,5 @@ declare const ccxt: {
558
549
  zaif: typeof zaif;
559
550
  zonda: typeof zonda;
560
551
  } & typeof functions & typeof errors;
561
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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, ConstructorArgs, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketMarginModes, MarketInterface, Trade, Order, OrderBook, OrderBooks, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, OpenInterests, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, LongShortRatio, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, exmo, fmfwio, foxbit, gate, gateio, gemini, hashkey, hibachi, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mercado, mexc, modetrade, myokx, ndax, novadax, oceanex, okcoin, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
552
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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, ConstructorArgs, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketMarginModes, MarketInterface, Trade, Order, OrderBook, OrderBooks, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, OpenInterests, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, LongShortRatio, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, exmo, fmfwio, foxbit, gate, gateio, gemini, hashkey, hibachi, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mercado, mexc, modetrade, myokx, ndax, novadax, oceanex, okcoin, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
562
553
  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, RestrictedLocation, 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.5.0';
41
+ const version = '4.5.2';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import alpaca from './src/alpaca.js';
@@ -94,7 +94,6 @@ import delta from './src/delta.js';
94
94
  import deribit from './src/deribit.js';
95
95
  import derive from './src/derive.js';
96
96
  import digifinex from './src/digifinex.js';
97
- import ellipx from './src/ellipx.js';
98
97
  import exmo from './src/exmo.js';
99
98
  import fmfwio from './src/fmfwio.js';
100
99
  import foxbit from './src/foxbit.js';
@@ -139,7 +138,6 @@ import timex from './src/timex.js';
139
138
  import tokocrypto from './src/tokocrypto.js';
140
139
  import tradeogre from './src/tradeogre.js';
141
140
  import upbit from './src/upbit.js';
142
- import vertex from './src/vertex.js';
143
141
  import wavesexchange from './src/wavesexchange.js';
144
142
  import whitebit from './src/whitebit.js';
145
143
  import woo from './src/woo.js';
@@ -217,7 +215,6 @@ import poloniexPro from './src/pro/poloniex.js';
217
215
  import probitPro from './src/pro/probit.js';
218
216
  import tradeogrePro from './src/pro/tradeogre.js';
219
217
  import upbitPro from './src/pro/upbit.js';
220
- import vertexPro from './src/pro/vertex.js';
221
218
  import whitebitPro from './src/pro/whitebit.js';
222
219
  import wooPro from './src/pro/woo.js';
223
220
  import woofiproPro from './src/pro/woofipro.js';
@@ -276,7 +273,6 @@ const exchanges = {
276
273
  'deribit': deribit,
277
274
  'derive': derive,
278
275
  'digifinex': digifinex,
279
- 'ellipx': ellipx,
280
276
  'exmo': exmo,
281
277
  'fmfwio': fmfwio,
282
278
  'foxbit': foxbit,
@@ -321,7 +317,6 @@ const exchanges = {
321
317
  'tokocrypto': tokocrypto,
322
318
  'tradeogre': tradeogre,
323
319
  'upbit': upbit,
324
- 'vertex': vertex,
325
320
  'wavesexchange': wavesexchange,
326
321
  'whitebit': whitebit,
327
322
  'woo': woo,
@@ -400,7 +395,6 @@ const pro = {
400
395
  'probit': probitPro,
401
396
  'tradeogre': tradeogrePro,
402
397
  'upbit': upbitPro,
403
- 'vertex': vertexPro,
404
398
  'whitebit': whitebitPro,
405
399
  'woo': wooPro,
406
400
  'woofipro': woofiproPro,
@@ -418,6 +412,6 @@ pro.exchanges = Object.keys(pro);
418
412
  pro['Exchange'] = Exchange; // now the same for rest and ts
419
413
  //-----------------------------------------------------------------------------
420
414
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
421
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, exmo, fmfwio, foxbit, gate, gateio, gemini, hashkey, hibachi, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mercado, mexc, modetrade, myokx, ndax, novadax, oceanex, okcoin, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
415
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, exmo, fmfwio, foxbit, gate, gateio, gemini, hashkey, hibachi, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mercado, mexc, modetrade, myokx, ndax, novadax, oceanex, okcoin, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
422
416
  export default ccxt;
423
417
  //-----------------------------------------------------------------------------
@@ -1632,7 +1632,7 @@ export default class ascendex extends Exchange {
1632
1632
  // "code": "0",
1633
1633
  // "data": {
1634
1634
  // "domain": "spot",
1635
- // "userUID": "U1479576458",
1635
+ // "userUID": "U1479576457",
1636
1636
  // "vipLevel": "0",
1637
1637
  // "fees": [
1638
1638
  // { symbol: 'HT/USDT', fee: { taker: '0.001', maker: "0.001" } },
@@ -461,6 +461,7 @@ export default class Exchange {
461
461
  watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
462
462
  unWatchOrderBookForSymbols(symbols: string[], params?: {}): Promise<any>;
463
463
  unWatchPositions(symbols?: Strings, params?: {}): Promise<any>;
464
+ unWatchTicker(symbol: string, params?: {}): Promise<any>;
464
465
  fetchDepositAddresses(codes?: Strings, params?: {}): Promise<DepositAddress[]>;
465
466
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
466
467
  fetchOrderBookWs(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
@@ -684,6 +685,7 @@ export default class Exchange {
684
685
  parseBidAsk(bidask: any, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): number[];
685
686
  safeCurrency(currencyId: Str, currency?: Currency): CurrencyInterface;
686
687
  safeMarket(marketId?: Str, market?: Market, delimiter?: Str, marketType?: Str): MarketInterface;
688
+ marketOrNull(symbol: string): MarketInterface;
687
689
  checkRequiredCredentials(error?: boolean): boolean;
688
690
  oath(): string;
689
691
  fetchBalance(params?: {}): Promise<Balances>;
@@ -1145,6 +1145,7 @@ export default class Exchange {
1145
1145
  }
1146
1146
  async close() {
1147
1147
  // test by running ts/src/pro/test/base/test.close.ts
1148
+ await this.sleep(0); // allow other futures to run
1148
1149
  const clients = Object.values(this.clients || {});
1149
1150
  const closedClients = [];
1150
1151
  for (let i = 0; i < clients.length; i++) {
@@ -1183,6 +1184,7 @@ export default class Exchange {
1183
1184
  }
1184
1185
  client.reject(new ExchangeError(this.id + ' nonce is behind the cache after ' + maxRetries.toString() + ' tries.'), messageHash);
1185
1186
  delete this.clients[client.url];
1187
+ this.orderbooks[symbol] = this.orderBook(); // clear the orderbook and its cache - issue https://github.com/ccxt/ccxt/issues/26753
1186
1188
  }
1187
1189
  catch (e) {
1188
1190
  client.reject(e, messageHash);
@@ -2194,6 +2196,9 @@ export default class Exchange {
2194
2196
  async unWatchPositions(symbols = undefined, params = {}) {
2195
2197
  throw new NotSupported(this.id + ' unWatchPositions() is not supported yet');
2196
2198
  }
2199
+ async unWatchTicker(symbol, params = {}) {
2200
+ throw new NotSupported(this.id + ' unWatchTicker() is not supported yet');
2201
+ }
2197
2202
  async fetchDepositAddresses(codes = undefined, params = {}) {
2198
2203
  throw new NotSupported(this.id + ' fetchDepositAddresses() is not supported yet');
2199
2204
  }
@@ -4683,6 +4688,12 @@ export default class Exchange {
4683
4688
  }
4684
4689
  return result;
4685
4690
  }
4691
+ marketOrNull(symbol) {
4692
+ if (symbol === undefined) {
4693
+ return undefined;
4694
+ }
4695
+ return this.market(symbol);
4696
+ }
4686
4697
  checkRequiredCredentials(error = true) {
4687
4698
  /**
4688
4699
  * @ignore
@@ -13,7 +13,6 @@ export default class binance extends Exchange {
13
13
  market(symbol: string): MarketInterface;
14
14
  safeMarket(marketId?: Str, market?: Market, delimiter?: Str, marketType?: Str): MarketInterface;
15
15
  costToPrecision(symbol: any, cost: any): string;
16
- currencyToPrecision(code: any, fee: any, networkCode?: any): string;
17
16
  nonce(): number;
18
17
  /**
19
18
  * @method
@@ -614,6 +613,7 @@ export default class binance extends Exchange {
614
613
  * @param {string[]} ids order ids
615
614
  * @param {string} [symbol] unified market symbol
616
615
  * @param {object} [params] extra parameters specific to the exchange API endpoint
616
+ * @param {string[]} [params.clientOrderIds] alternative to ids, array of client order ids
617
617
  *
618
618
  * EXCHANGE SPECIFIC PARAMETERS
619
619
  * @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
package/js/src/binance.js CHANGED
@@ -1288,6 +1288,7 @@ export default class binance extends Exchange {
1288
1288
  'defaultSubType': undefined,
1289
1289
  'hasAlreadyAuthenticatedSuccessfully': false,
1290
1290
  'warnOnFetchOpenOrdersWithoutSymbol': true,
1291
+ 'currencyToPrecisionRoundingMode': TRUNCATE,
1291
1292
  // not an error
1292
1293
  // https://github.com/ccxt/ccxt/issues/11268
1293
1294
  // https://github.com/ccxt/ccxt/pull/11624
@@ -2755,15 +2756,6 @@ export default class binance extends Exchange {
2755
2756
  costToPrecision(symbol, cost) {
2756
2757
  return this.decimalToPrecision(cost, TRUNCATE, this.markets[symbol]['precision']['quote'], this.precisionMode, this.paddingMode);
2757
2758
  }
2758
- currencyToPrecision(code, fee, networkCode = undefined) {
2759
- // info is available in currencies only if the user has configured his api keys
2760
- if (this.safeValue(this.currencies[code], 'precision') !== undefined) {
2761
- return this.decimalToPrecision(fee, TRUNCATE, this.currencies[code]['precision'], this.precisionMode, this.paddingMode);
2762
- }
2763
- else {
2764
- return this.numberToString(fee);
2765
- }
2766
- }
2767
2759
  nonce() {
2768
2760
  return this.milliseconds() - this.options['timeDifference'];
2769
2761
  }
@@ -6620,19 +6612,13 @@ export default class binance extends Exchange {
6620
6612
  }
6621
6613
  }
6622
6614
  if (quantityIsRequired) {
6623
- // portfolio margin has a different amount precision
6624
- if (isPortfolioMargin) {
6625
- request['quantity'] = this.parseToNumeric(amount);
6615
+ const marketAmountPrecision = this.safeString(market['precision'], 'amount');
6616
+ const isPrecisionAvailable = (marketAmountPrecision !== undefined);
6617
+ if (isPrecisionAvailable) {
6618
+ request['quantity'] = this.amountToPrecision(symbol, amount);
6626
6619
  }
6627
6620
  else {
6628
- const marketAmountPrecision = this.safeString(market['precision'], 'amount');
6629
- const isPrecisionAvailable = (marketAmountPrecision !== undefined);
6630
- if (isPrecisionAvailable) {
6631
- request['quantity'] = this.amountToPrecision(symbol, amount);
6632
- }
6633
- else {
6634
- request['quantity'] = this.parseToNumeric(amount); // some options don't have the precision available
6635
- }
6621
+ request['quantity'] = this.parseToNumeric(amount); // some options don't have the precision available
6636
6622
  }
6637
6623
  }
6638
6624
  if (priceIsRequired && !isPriceMatch) {
@@ -7830,6 +7816,7 @@ export default class binance extends Exchange {
7830
7816
  * @param {string[]} ids order ids
7831
7817
  * @param {string} [symbol] unified market symbol
7832
7818
  * @param {object} [params] extra parameters specific to the exchange API endpoint
7819
+ * @param {string[]} [params.clientOrderIds] alternative to ids, array of client order ids
7833
7820
  *
7834
7821
  * EXCHANGE SPECIFIC PARAMETERS
7835
7822
  * @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
@@ -7847,8 +7834,16 @@ export default class binance extends Exchange {
7847
7834
  }
7848
7835
  const request = {
7849
7836
  'symbol': market['id'],
7850
- 'orderidlist': ids,
7837
+ // 'orderidlist': ids,
7851
7838
  };
7839
+ const origClientOrderIdList = this.safeList2(params, 'origClientOrderIdList', 'clientOrderIds');
7840
+ if (origClientOrderIdList !== undefined) {
7841
+ params = this.omit(params, ['clientOrderIds']);
7842
+ request['origClientOrderIdList'] = origClientOrderIdList;
7843
+ }
7844
+ else {
7845
+ request['orderidlist'] = ids;
7846
+ }
7852
7847
  let response = undefined;
7853
7848
  if (market['linear']) {
7854
7849
  response = await this.fapiPrivateDeleteBatchOrders(this.extend(request, params));
@@ -9434,7 +9429,6 @@ export default class binance extends Exchange {
9434
9429
  const request = {
9435
9430
  'coin': currency['id'],
9436
9431
  'address': address,
9437
- 'amount': this.currencyToPrecision(code, amount),
9438
9432
  // issue sapiGetCapitalConfigGetall () to get networks for withdrawing USDT ERC20 vs USDT Omni
9439
9433
  // 'network': 'ETH', // 'BTC', 'TRX', etc, optional
9440
9434
  };
@@ -9448,6 +9442,7 @@ export default class binance extends Exchange {
9448
9442
  request['network'] = network;
9449
9443
  params = this.omit(params, 'network');
9450
9444
  }
9445
+ request['amount'] = this.currencyToPrecision(code, amount, network);
9451
9446
  const response = await this.sapiPostCapitalWithdrawApply(this.extend(request, params));
9452
9447
  // { id: '9a67628b16ba4988ae20d329333f16bc' }
9453
9448
  return this.parseTransaction(response, currency);
@@ -12064,8 +12059,8 @@ export default class binance extends Exchange {
12064
12059
  else if ((path === 'batchOrders') || (path.indexOf('sub-account') >= 0) || (path === 'capital/withdraw/apply') || (path.indexOf('staking') >= 0) || (path.indexOf('simple-earn') >= 0)) {
12065
12060
  if ((method === 'DELETE') && (path === 'batchOrders')) {
12066
12061
  const orderidlist = this.safeList(extendedParams, 'orderidlist', []);
12067
- const origclientorderidlist = this.safeList(extendedParams, 'origclientorderidlist', []);
12068
- extendedParams = this.omit(extendedParams, ['orderidlist', 'origclientorderidlist']);
12062
+ const origclientorderidlist = this.safeList2(extendedParams, 'origclientorderidlist', 'origClientOrderIdList', []);
12063
+ extendedParams = this.omit(extendedParams, ['orderidlist', 'origclientorderidlist', 'origClientOrderIdList']);
12069
12064
  query = this.rawencode(extendedParams);
12070
12065
  const orderidlistLength = orderidlist.length;
12071
12066
  const origclientorderidlistLength = origclientorderidlist.length;
@@ -12073,7 +12068,12 @@ export default class binance extends Exchange {
12073
12068
  query = query + '&' + 'orderidlist=%5B' + orderidlist.join('%2C') + '%5D';
12074
12069
  }
12075
12070
  if (origclientorderidlistLength > 0) {
12076
- query = query + '&' + 'origclientorderidlist=%5B' + origclientorderidlist.join('%2C') + '%5D';
12071
+ // wrap clientOrderids around ""
12072
+ const newClientOrderIds = [];
12073
+ for (let i = 0; i < origclientorderidlistLength; i++) {
12074
+ newClientOrderIds.push('%22' + origclientorderidlist[i] + '%22');
12075
+ }
12076
+ query = query + '&' + 'origclientorderidlist=%5B' + newClientOrderIds.join('%2C') + '%5D';
12077
12077
  }
12078
12078
  }
12079
12079
  else {
package/js/src/bitget.js CHANGED
@@ -1919,7 +1919,7 @@ export default class bitget extends Exchange {
1919
1919
  const res = this.safeDict(results, i);
1920
1920
  const data = this.safeList(res, 'data', []);
1921
1921
  const firstData = this.safeDict(data, 0, {});
1922
- const isBorrowable = this.safeString(firstData, 'isBorrowable');
1922
+ const isBorrowable = this.safeBool(firstData, 'isBorrowable');
1923
1923
  if (fetchMargins && isBorrowable !== undefined) {
1924
1924
  const keysList = Object.keys(this.indexBy(data, 'symbol'));
1925
1925
  this.options['crossMarginPairsData'] = keysList;
@@ -7709,7 +7709,7 @@ export default class bitget extends Exchange {
7709
7709
  // "requestTime": 1700802995406,
7710
7710
  // "data": [
7711
7711
  // {
7712
- // "userId": "7264631750",
7712
+ // "userId": "7264631751",
7713
7713
  // "symbol": "BTCUSDT",
7714
7714
  // "orderId": "1098394344925597696",
7715
7715
  // "tradeId": "1098394344974925824",
@@ -611,8 +611,8 @@ export default class coincatch extends Exchange {
611
611
  for (let j = 0; j < networks.length; j++) {
612
612
  const network = networks[j];
613
613
  const networkId = this.safeString(network, 'chain');
614
- const networkCode = this.networkCodeToId(networkId);
615
- parsedNetworks[networkId] = {
614
+ const networkCode = this.networkIdToCode(networkId);
615
+ parsedNetworks[networkCode] = {
616
616
  'id': networkId,
617
617
  'network': networkCode,
618
618
  'limits': {