ccxt 4.5.10 → 4.5.12

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 (113) hide show
  1. package/README.md +32 -33
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -6
  4. package/dist/cjs/src/apex.js +9 -0
  5. package/dist/cjs/src/base/Exchange.js +15 -3
  6. package/dist/cjs/src/base/functions/throttle.js +1 -1
  7. package/dist/cjs/src/binance.js +1 -1
  8. package/dist/cjs/src/bingx.js +1 -1
  9. package/dist/cjs/src/bitfinex.js +4 -2
  10. package/dist/cjs/src/bitget.js +20 -2
  11. package/dist/cjs/src/bitmart.js +2 -2
  12. package/dist/cjs/src/btcmarkets.js +4 -2
  13. package/dist/cjs/src/bybit.js +28 -7
  14. package/dist/cjs/src/coinbase.js +1 -0
  15. package/dist/cjs/src/coincatch.js +2 -1
  16. package/dist/cjs/src/deribit.js +21 -19
  17. package/dist/cjs/src/kraken.js +4 -0
  18. package/dist/cjs/src/krakenfutures.js +26 -5
  19. package/dist/cjs/src/kucoin.js +1 -1
  20. package/dist/cjs/src/latoken.js +1 -0
  21. package/dist/cjs/src/mexc.js +1 -0
  22. package/dist/cjs/src/okx.js +18 -9
  23. package/dist/cjs/src/onetrading.js +2 -1
  24. package/dist/cjs/src/phemex.js +1 -0
  25. package/dist/cjs/src/pro/alpaca.js +17 -1
  26. package/dist/cjs/src/pro/apex.js +17 -0
  27. package/dist/cjs/src/pro/binance.js +5 -5
  28. package/dist/cjs/src/pro/bitget.js +10 -3
  29. package/dist/cjs/src/pro/coinbase.js +8 -7
  30. package/dist/cjs/src/pro/htx.js +22 -3
  31. package/dist/cjs/src/pro/hyperliquid.js +4 -0
  32. package/dist/cjs/src/pro/kraken.js +282 -458
  33. package/dist/cjs/src/pro/mexc.js +16 -11
  34. package/dist/cjs/src/pro/woo.js +48 -4
  35. package/dist/cjs/src/probit.js +1 -1
  36. package/dist/cjs/src/woo.js +20 -2
  37. package/dist/cjs/src/xt.js +1 -1
  38. package/js/ccxt.d.ts +2 -8
  39. package/js/ccxt.js +2 -6
  40. package/js/src/abstract/coinbase.d.ts +1 -0
  41. package/js/src/abstract/coinbaseadvanced.d.ts +1 -0
  42. package/js/src/abstract/phemex.d.ts +1 -0
  43. package/js/src/abstract/xt.d.ts +1 -1
  44. package/js/src/apex.js +9 -0
  45. package/js/src/base/Exchange.d.ts +5 -2
  46. package/js/src/base/Exchange.js +15 -3
  47. package/js/src/base/functions/throttle.js +1 -1
  48. package/js/src/binance.js +1 -1
  49. package/js/src/bingx.js +1 -1
  50. package/js/src/bitfinex.d.ts +1 -1
  51. package/js/src/bitfinex.js +4 -2
  52. package/js/src/bitget.d.ts +15 -2
  53. package/js/src/bitget.js +20 -2
  54. package/js/src/bithumb.d.ts +1 -1
  55. package/js/src/bitmart.js +2 -2
  56. package/js/src/bitmex.d.ts +1 -1
  57. package/js/src/bitopro.d.ts +1 -1
  58. package/js/src/bitso.d.ts +1 -1
  59. package/js/src/bittrade.d.ts +1 -1
  60. package/js/src/blofin.d.ts +1 -1
  61. package/js/src/btcmarkets.d.ts +1 -1
  62. package/js/src/btcmarkets.js +4 -2
  63. package/js/src/bybit.d.ts +1 -1
  64. package/js/src/bybit.js +28 -7
  65. package/js/src/coinbase.d.ts +1 -1
  66. package/js/src/coinbase.js +1 -0
  67. package/js/src/coincatch.js +2 -1
  68. package/js/src/coinex.d.ts +1 -1
  69. package/js/src/cryptocom.d.ts +1 -1
  70. package/js/src/deribit.js +21 -19
  71. package/js/src/digifinex.d.ts +1 -1
  72. package/js/src/hibachi.d.ts +1 -1
  73. package/js/src/htx.d.ts +1 -1
  74. package/js/src/hyperliquid.d.ts +1 -1
  75. package/js/src/kraken.d.ts +1 -1
  76. package/js/src/kraken.js +4 -0
  77. package/js/src/krakenfutures.js +26 -5
  78. package/js/src/kucoin.js +1 -1
  79. package/js/src/kucoinfutures.d.ts +1 -1
  80. package/js/src/latoken.js +1 -0
  81. package/js/src/mexc.d.ts +1 -1
  82. package/js/src/mexc.js +1 -0
  83. package/js/src/oceanex.d.ts +1 -1
  84. package/js/src/okx.d.ts +1 -1
  85. package/js/src/okx.js +18 -9
  86. package/js/src/onetrading.d.ts +1 -1
  87. package/js/src/onetrading.js +2 -1
  88. package/js/src/phemex.js +1 -0
  89. package/js/src/pro/alpaca.js +17 -1
  90. package/js/src/pro/apex.d.ts +2 -0
  91. package/js/src/pro/apex.js +18 -1
  92. package/js/src/pro/binance.js +5 -5
  93. package/js/src/pro/bitget.d.ts +1 -0
  94. package/js/src/pro/bitget.js +10 -3
  95. package/js/src/pro/bitvavo.d.ts +2 -2
  96. package/js/src/pro/coinbase.js +8 -7
  97. package/js/src/pro/htx.js +22 -3
  98. package/js/src/pro/hyperliquid.js +4 -0
  99. package/js/src/pro/kraken.d.ts +7 -8
  100. package/js/src/pro/kraken.js +282 -458
  101. package/js/src/pro/mexc.js +16 -11
  102. package/js/src/pro/woo.js +48 -4
  103. package/js/src/probit.js +1 -1
  104. package/js/src/timex.d.ts +1 -1
  105. package/js/src/woo.js +20 -2
  106. package/js/src/xt.js +1 -1
  107. package/package.json +1 -1
  108. package/js/src/abstract/okcoin.d.ts +0 -77
  109. package/js/src/abstract/okcoin.js +0 -11
  110. package/js/src/okcoin.d.ts +0 -346
  111. package/js/src/okcoin.js +0 -3214
  112. package/js/src/pro/okcoin.d.ts +0 -91
  113. package/js/src/pro/okcoin.js +0 -763
@@ -113,7 +113,7 @@ class mexc extends mexc$1["default"] {
113
113
  // "symbol": "BTC_USDT",
114
114
  // "data": {
115
115
  // "symbol": "BTC_USDT",
116
- // "lastPrice": 76376.2,
116
+ // "lastPrice": 76376.1,
117
117
  // "riseFallRate": -0.0006,
118
118
  // "fairPrice": 76374.4,
119
119
  // "indexPrice": 76385.8,
@@ -998,14 +998,16 @@ class mexc extends mexc$1["default"] {
998
998
  // swap
999
999
  // {
1000
1000
  // "symbol": "BTC_USDT",
1001
- // "data": {
1002
- // "p": 27307.3,
1003
- // "v": 5,
1004
- // "T": 2,
1005
- // "O": 3,
1006
- // "M": 1,
1007
- // "t": 1680055941870
1008
- // },
1001
+ // "data": [
1002
+ // {
1003
+ // "p": 114350.4,
1004
+ // "v": 4,
1005
+ // "T": 2,
1006
+ // "O": 3,
1007
+ // "M": 2,
1008
+ // "t": 1760368563597
1009
+ // }
1010
+ // ],
1009
1011
  // "channel": "push.deal",
1010
1012
  // "ts": 1680055941870
1011
1013
  // }
@@ -1020,8 +1022,11 @@ class mexc extends mexc$1["default"] {
1020
1022
  stored = new Cache.ArrayCache(limit);
1021
1023
  this.trades[symbol] = stored;
1022
1024
  }
1023
- const d = this.safeDictN(message, ['d', 'data', 'publicAggreDeals']);
1024
- const trades = this.safeList2(d, 'deals', 'dealsList', [d]);
1025
+ const d = this.safeDictN(message, ['d', 'publicAggreDeals']);
1026
+ let trades = this.safeList2(d, 'deals', 'dealsList', [d]);
1027
+ if (d === undefined) {
1028
+ trades = this.safeList(message, 'data', []);
1029
+ }
1025
1030
  for (let j = 0; j < trades.length; j++) {
1026
1031
  let parsedTrade = undefined;
1027
1032
  if (market['spot']) {
@@ -976,8 +976,50 @@ class woo extends woo$1["default"] {
976
976
  // "reduceOnly": false,
977
977
  // "maker": false
978
978
  // }
979
+ // {
980
+ // "symbol": "SPOT_BTC_USDT",
981
+ // "rootAlgoOrderId": 2573778,
982
+ // "parentAlgoOrderId": 0,
983
+ // "algoOrderId": 2573778,
984
+ // "clientOrderId": 0,
985
+ // "orderTag": "default",
986
+ // "algoType": "STOP_LOSS",
987
+ // "side": "SELL",
988
+ // "quantity": 0.00011,
989
+ // "triggerPrice": 98566.67,
990
+ // "triggerStatus": "USELESS",
991
+ // "price": 0,
992
+ // "type": "MARKET",
993
+ // "triggerTradePrice": 0,
994
+ // "triggerTime": 0,
995
+ // "tradeId": 0,
996
+ // "executedPrice": 0,
997
+ // "executedQuantity": 0,
998
+ // "fee": 0,
999
+ // "reason": "",
1000
+ // "feeAsset": "",
1001
+ // "totalExecutedQuantity": 0,
1002
+ // "averageExecutedPrice": 0,
1003
+ // "totalFee": 0,
1004
+ // "timestamp": 1761030467426,
1005
+ // "visibleQuantity": 0,
1006
+ // "reduceOnly": false,
1007
+ // "triggerPriceType": "MARKET_PRICE",
1008
+ // "positionSide": "BOTH",
1009
+ // "feeCurrency": "",
1010
+ // "totalRebate": 0.0,
1011
+ // "rebateCurrency": "",
1012
+ // "triggered": false,
1013
+ // "maker": false,
1014
+ // "activated": false,
1015
+ // "isTriggered": false,
1016
+ // "isMaker": false,
1017
+ // "isActivated": false,
1018
+ // "rootAlgoStatus": "NEW",
1019
+ // "algoStatus": "NEW"
1020
+ // }
979
1021
  //
980
- const orderId = this.safeString(order, 'orderId');
1022
+ const orderId = this.safeString2(order, 'orderId', 'algoOrderId');
981
1023
  const marketId = this.safeString(order, 'symbol');
982
1024
  market = this.market(marketId);
983
1025
  const symbol = market['symbol'];
@@ -1001,10 +1043,11 @@ class woo extends woo$1["default"] {
1001
1043
  if (amount >= totalExecQuantity) {
1002
1044
  remaining -= totalExecQuantity;
1003
1045
  }
1004
- const rawStatus = this.safeString(order, 'status');
1046
+ const rawStatus = this.safeString2(order, 'status', 'algoStatus');
1005
1047
  const status = this.parseOrderStatus(rawStatus);
1006
1048
  const trades = undefined;
1007
1049
  const clientOrderId = this.safeString(order, 'clientOrderId');
1050
+ const triggerPrice = this.safeString(order, 'triggerPrice');
1008
1051
  return this.safeOrder({
1009
1052
  'info': order,
1010
1053
  'symbol': symbol,
@@ -1018,8 +1061,9 @@ class woo extends woo$1["default"] {
1018
1061
  'postOnly': undefined,
1019
1062
  'side': side,
1020
1063
  'price': price,
1021
- 'stopPrice': undefined,
1022
- 'triggerPrice': undefined,
1064
+ 'stopPrice': triggerPrice,
1065
+ 'triggerPrice': triggerPrice,
1066
+ 'reduceOnly': this.safeBool(order, 'reduceOnly'),
1023
1067
  'amount': amount,
1024
1068
  'cost': undefined,
1025
1069
  'average': avgPrice,
@@ -858,7 +858,7 @@ class probit extends probit$1["default"] {
858
858
  // "data":[
859
859
  // {
860
860
  // "id":"ETH-BTC:3331886",
861
- // "price":"0.022981",
861
+ // "price":"0.022982",
862
862
  // "quantity":"12.337",
863
863
  // "time":"2020-04-12T20:55:42.371Z",
864
864
  // "side":"sell",
@@ -1994,7 +1994,16 @@ class woo extends woo$1["default"] {
1994
1994
  // "positionSide": "BOTH"
1995
1995
  // }
1996
1996
  //
1997
- let timestamp = this.safeTimestamp(order, 'createdTime');
1997
+ let timestamp = undefined;
1998
+ const timestrampString = this.safeString(order, 'createdTime');
1999
+ if (timestrampString !== undefined) {
2000
+ if (timestrampString.indexOf('.') >= 0) {
2001
+ timestamp = this.safeTimestamp(order, 'createdTime'); // algo orders
2002
+ }
2003
+ else {
2004
+ timestamp = this.safeInteger(order, 'createdTime'); // regular orders
2005
+ }
2006
+ }
1998
2007
  if (timestamp === undefined) {
1999
2008
  timestamp = this.safeInteger(order, 'timestamp');
2000
2009
  }
@@ -2015,7 +2024,16 @@ class woo extends woo$1["default"] {
2015
2024
  const fee = this.safeNumber(order, 'totalFee');
2016
2025
  const feeCurrency = this.safeString(order, 'feeAsset');
2017
2026
  const triggerPrice = this.safeNumber(order, 'triggerPrice');
2018
- const lastUpdateTimestamp = this.safeTimestamp(order, 'updatedTime');
2027
+ const lastUpdateTimestampString = this.safeString(order, 'updatedTime');
2028
+ let lastUpdateTimestamp = undefined;
2029
+ if (lastUpdateTimestampString !== undefined) {
2030
+ if (lastUpdateTimestampString.indexOf('.') >= 0) {
2031
+ lastUpdateTimestamp = this.safeTimestamp(order, 'updatedTime'); // algo orders
2032
+ }
2033
+ else {
2034
+ lastUpdateTimestamp = this.safeInteger(order, 'updatedTime'); // regular orders
2035
+ }
2036
+ }
2019
2037
  return this.safeOrder({
2020
2038
  'id': orderId,
2021
2039
  'clientOrderId': clientOrderId,
@@ -337,7 +337,7 @@ class xt extends xt$1["default"] {
337
337
  'user/account/api-key': 1,
338
338
  },
339
339
  'delete': {
340
- 'user/account/{apikeyId}': 1,
340
+ 'user/account/{apiKeyId}': 1,
341
341
  },
342
342
  },
343
343
  },
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.9";
7
+ declare const version = "4.5.11";
8
8
  import alpaca from './src/alpaca.js';
9
9
  import apex from './src/apex.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -88,7 +88,6 @@ import myokx from './src/myokx.js';
88
88
  import ndax from './src/ndax.js';
89
89
  import novadax from './src/novadax.js';
90
90
  import oceanex from './src/oceanex.js';
91
- import okcoin from './src/okcoin.js';
92
91
  import okx from './src/okx.js';
93
92
  import okxus from './src/okxus.js';
94
93
  import onetrading from './src/onetrading.js';
@@ -168,7 +167,6 @@ import mexcPro from './src/pro/mexc.js';
168
167
  import modetradePro from './src/pro/modetrade.js';
169
168
  import myokxPro from './src/pro/myokx.js';
170
169
  import ndaxPro from './src/pro/ndax.js';
171
- import okcoinPro from './src/pro/okcoin.js';
172
170
  import okxPro from './src/pro/okx.js';
173
171
  import okxusPro from './src/pro/okxus.js';
174
172
  import onetradingPro from './src/pro/onetrading.js';
@@ -268,7 +266,6 @@ declare const exchanges: {
268
266
  ndax: typeof ndax;
269
267
  novadax: typeof novadax;
270
268
  oceanex: typeof oceanex;
271
- okcoin: typeof okcoin;
272
269
  okx: typeof okx;
273
270
  okxus: typeof okxus;
274
271
  onetrading: typeof onetrading;
@@ -350,7 +347,6 @@ declare const pro: {
350
347
  modetrade: typeof modetradePro;
351
348
  myokx: typeof myokxPro;
352
349
  ndax: typeof ndaxPro;
353
- okcoin: typeof okcoinPro;
354
350
  okx: typeof okxPro;
355
351
  okxus: typeof okxusPro;
356
352
  onetrading: typeof onetradingPro;
@@ -430,7 +426,6 @@ declare const ccxt: {
430
426
  modetrade: typeof modetradePro;
431
427
  myokx: typeof myokxPro;
432
428
  ndax: typeof ndaxPro;
433
- okcoin: typeof okcoinPro;
434
429
  okx: typeof okxPro;
435
430
  okxus: typeof okxusPro;
436
431
  onetrading: typeof onetradingPro;
@@ -531,7 +526,6 @@ declare const ccxt: {
531
526
  ndax: typeof ndax;
532
527
  novadax: typeof novadax;
533
528
  oceanex: typeof oceanex;
534
- okcoin: typeof okcoin;
535
529
  okx: typeof okx;
536
530
  okxus: typeof okxus;
537
531
  onetrading: typeof onetrading;
@@ -555,5 +549,5 @@ declare const ccxt: {
555
549
  zaif: typeof zaif;
556
550
  zonda: typeof zonda;
557
551
  } & typeof functions & typeof errors;
558
- 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, backpack, 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, toobit, upbit, 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, backpack, 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, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, toobit, upbit, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
559
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.9';
41
+ const version = '4.5.11';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import alpaca from './src/alpaca.js';
@@ -124,7 +124,6 @@ import myokx from './src/myokx.js';
124
124
  import ndax from './src/ndax.js';
125
125
  import novadax from './src/novadax.js';
126
126
  import oceanex from './src/oceanex.js';
127
- import okcoin from './src/okcoin.js';
128
127
  import okx from './src/okx.js';
129
128
  import okxus from './src/okxus.js';
130
129
  import onetrading from './src/onetrading.js';
@@ -205,7 +204,6 @@ import mexcPro from './src/pro/mexc.js';
205
204
  import modetradePro from './src/pro/modetrade.js';
206
205
  import myokxPro from './src/pro/myokx.js';
207
206
  import ndaxPro from './src/pro/ndax.js';
208
- import okcoinPro from './src/pro/okcoin.js';
209
207
  import okxPro from './src/pro/okx.js';
210
208
  import okxusPro from './src/pro/okxus.js';
211
209
  import onetradingPro from './src/pro/onetrading.js';
@@ -305,7 +303,6 @@ const exchanges = {
305
303
  'ndax': ndax,
306
304
  'novadax': novadax,
307
305
  'oceanex': oceanex,
308
- 'okcoin': okcoin,
309
306
  'okx': okx,
310
307
  'okxus': okxus,
311
308
  'onetrading': onetrading,
@@ -387,7 +384,6 @@ const pro = {
387
384
  'modetrade': modetradePro,
388
385
  'myokx': myokxPro,
389
386
  'ndax': ndaxPro,
390
- 'okcoin': okcoinPro,
391
387
  'okx': okxPro,
392
388
  'okxus': okxusPro,
393
389
  'onetrading': onetradingPro,
@@ -416,6 +412,6 @@ pro.exchanges = Object.keys(pro);
416
412
  pro['Exchange'] = Exchange; // now the same for rest and ts
417
413
  //-----------------------------------------------------------------------------
418
414
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
419
- 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, backpack, 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, toobit, upbit, 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, backpack, 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, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, toobit, upbit, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
420
416
  export default ccxt;
421
417
  //-----------------------------------------------------------------------------
@@ -76,6 +76,7 @@ interface Exchange {
76
76
  v3PrivateGetBrokerageIntxPositionsPortfolioUuidSymbol(params?: {}): Promise<implicitReturnType>;
77
77
  v3PrivateGetBrokeragePaymentMethods(params?: {}): Promise<implicitReturnType>;
78
78
  v3PrivateGetBrokeragePaymentMethodsPaymentMethodId(params?: {}): Promise<implicitReturnType>;
79
+ v3PrivateGetBrokerageKeyPermissions(params?: {}): Promise<implicitReturnType>;
79
80
  v3PrivatePostBrokerageOrders(params?: {}): Promise<implicitReturnType>;
80
81
  v3PrivatePostBrokerageOrdersBatchCancel(params?: {}): Promise<implicitReturnType>;
81
82
  v3PrivatePostBrokerageOrdersEdit(params?: {}): Promise<implicitReturnType>;
@@ -76,6 +76,7 @@ interface coinbase {
76
76
  v3PrivateGetBrokerageIntxPositionsPortfolioUuidSymbol(params?: {}): Promise<implicitReturnType>;
77
77
  v3PrivateGetBrokeragePaymentMethods(params?: {}): Promise<implicitReturnType>;
78
78
  v3PrivateGetBrokeragePaymentMethodsPaymentMethodId(params?: {}): Promise<implicitReturnType>;
79
+ v3PrivateGetBrokerageKeyPermissions(params?: {}): Promise<implicitReturnType>;
79
80
  v3PrivatePostBrokerageOrders(params?: {}): Promise<implicitReturnType>;
80
81
  v3PrivatePostBrokerageOrdersBatchCancel(params?: {}): Promise<implicitReturnType>;
81
82
  v3PrivatePostBrokerageOrdersEdit(params?: {}): Promise<implicitReturnType>;
@@ -39,6 +39,7 @@ interface Exchange {
39
39
  privateGetAccountsAccountPositions(params?: {}): Promise<implicitReturnType>;
40
40
  privateGetGAccountsAccountPositions(params?: {}): Promise<implicitReturnType>;
41
41
  privateGetGAccountsPositions(params?: {}): Promise<implicitReturnType>;
42
+ privateGetGAccountsRiskUnit(params?: {}): Promise<implicitReturnType>;
42
43
  privateGetApiDataFuturesFundingFees(params?: {}): Promise<implicitReturnType>;
43
44
  privateGetApiDataGFuturesFundingFees(params?: {}): Promise<implicitReturnType>;
44
45
  privateGetApiDataFuturesOrders(params?: {}): Promise<implicitReturnType>;
@@ -153,7 +153,7 @@ interface Exchange {
153
153
  privateUserPostUserAccount(params?: {}): Promise<implicitReturnType>;
154
154
  privateUserPostUserAccountApiKey(params?: {}): Promise<implicitReturnType>;
155
155
  privateUserPutUserAccountApiKey(params?: {}): Promise<implicitReturnType>;
156
- privateUserDeleteUserAccountApikeyId(params?: {}): Promise<implicitReturnType>;
156
+ privateUserDeleteUserAccountApiKeyId(params?: {}): Promise<implicitReturnType>;
157
157
  }
158
158
  declare abstract class Exchange extends _Exchange {
159
159
  }
package/js/src/apex.js CHANGED
@@ -36,6 +36,7 @@ export default class apex extends Exchange {
36
36
  'addMargin': false,
37
37
  'borrowCrossMargin': false,
38
38
  'borrowIsolatedMargin': false,
39
+ 'borrowMargin': false,
39
40
  'cancelAllOrders': true,
40
41
  'cancelAllOrdersAfter': false,
41
42
  'cancelOrder': true,
@@ -54,10 +55,14 @@ export default class apex extends Exchange {
54
55
  'createTriggerOrder': true,
55
56
  'editOrder': false,
56
57
  'fetchAccounts': true,
58
+ 'fetchAllGreeks': false,
57
59
  'fetchBalance': true,
58
60
  'fetchBorrowInterest': false,
61
+ 'fetchBorrowRate': false,
59
62
  'fetchBorrowRateHistories': false,
60
63
  'fetchBorrowRateHistory': false,
64
+ 'fetchBorrowRates': false,
65
+ 'fetchBorrowRatesPerSymbol': false,
61
66
  'fetchCanceledAndClosedOrders': false,
62
67
  'fetchCanceledOrders': false,
63
68
  'fetchClosedOrders': false,
@@ -73,6 +78,7 @@ export default class apex extends Exchange {
73
78
  'fetchFundingRate': false,
74
79
  'fetchFundingRateHistory': true,
75
80
  'fetchFundingRates': false,
81
+ 'fetchGreeks': false,
76
82
  'fetchIndexOHLCV': false,
77
83
  'fetchIsolatedBorrowRate': false,
78
84
  'fetchIsolatedBorrowRates': false,
@@ -91,6 +97,8 @@ export default class apex extends Exchange {
91
97
  'fetchOpenInterestHistory': false,
92
98
  'fetchOpenInterests': false,
93
99
  'fetchOpenOrders': true,
100
+ 'fetchOption': false,
101
+ 'fetchOptionChain': false,
94
102
  'fetchOrder': true,
95
103
  'fetchOrderBook': true,
96
104
  'fetchOrders': true,
@@ -108,6 +116,7 @@ export default class apex extends Exchange {
108
116
  'fetchTradingFees': false,
109
117
  'fetchTransfer': true,
110
118
  'fetchTransfers': true,
119
+ 'fetchVolatilityHistory': false,
111
120
  'fetchWithdrawal': false,
112
121
  'fetchWithdrawals': false,
113
122
  'reduceMargin': false,
@@ -355,7 +355,7 @@ export default class Exchange {
355
355
  */
356
356
  loadMarkets(reload?: boolean, params?: object): Promise<Dictionary<Market>>;
357
357
  fetchCurrencies(params?: {}): Promise<Currencies>;
358
- fetchCurrenciesWs(params?: {}): Promise<unknown>;
358
+ fetchCurrenciesWs(params?: {}): Promise<Currencies>;
359
359
  fetchMarkets(params?: {}): Promise<Market[]>;
360
360
  fetchMarketsWs(params?: {}): Promise<Market[]>;
361
361
  checkRequiredDependencies(): void;
@@ -467,6 +467,8 @@ export default class Exchange {
467
467
  unWatchOrderBookForSymbols(symbols: string[], params?: {}): Promise<any>;
468
468
  unWatchPositions(symbols?: Strings, params?: {}): Promise<any>;
469
469
  unWatchTicker(symbol: string, params?: {}): Promise<any>;
470
+ unWatchMarkPrice(symbol: string, params?: {}): Promise<any>;
471
+ unWatchMarkPrices(symbols?: Strings, params?: {}): Promise<any>;
470
472
  fetchDepositAddresses(codes?: Strings, params?: {}): Promise<DepositAddress[]>;
471
473
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
472
474
  fetchOrderBookWs(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
@@ -767,12 +769,13 @@ export default class Exchange {
767
769
  createOrderWs(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
768
770
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
769
771
  cancelOrderWs(id: string, symbol?: Str, params?: {}): Promise<Order>;
772
+ cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<Order[]>;
770
773
  cancelOrdersWs(ids: string[], symbol?: Str, params?: {}): Promise<Order[]>;
771
774
  cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
772
775
  cancelAllOrdersAfter(timeout: Int, params?: {}): Promise<{}>;
773
776
  cancelOrdersForSymbols(orders: CancellationRequest[], params?: {}): Promise<Order[]>;
774
777
  cancelAllOrdersWs(symbol?: Str, params?: {}): Promise<Order[]>;
775
- cancelUnifiedOrder(order: any, params?: {}): Promise<{}>;
778
+ cancelUnifiedOrder(order: Order, params?: {}): Promise<{}>;
776
779
  fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
777
780
  fetchOrdersWs(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
778
781
  fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
@@ -2248,6 +2248,12 @@ export default class Exchange {
2248
2248
  async unWatchTicker(symbol, params = {}) {
2249
2249
  throw new NotSupported(this.id + ' unWatchTicker() is not supported yet');
2250
2250
  }
2251
+ async unWatchMarkPrice(symbol, params = {}) {
2252
+ throw new NotSupported(this.id + ' unWatchMarkPrice() is not supported yet');
2253
+ }
2254
+ async unWatchMarkPrices(symbols = undefined, params = {}) {
2255
+ throw new NotSupported(this.id + ' unWatchMarkPrices() is not supported yet');
2256
+ }
2251
2257
  async fetchDepositAddresses(codes = undefined, params = {}) {
2252
2258
  throw new NotSupported(this.id + ' fetchDepositAddresses() is not supported yet');
2253
2259
  }
@@ -2535,7 +2541,7 @@ export default class Exchange {
2535
2541
  'delay': 0.001,
2536
2542
  'capacity': 1,
2537
2543
  'cost': 1,
2538
- 'maxCapacity': 1000,
2544
+ 'maxCapacity': this.safeInteger(this.options, 'maxRequestsQueue', 1000),
2539
2545
  'refillRate': refillRate,
2540
2546
  };
2541
2547
  const existingBucket = (this.tokenBucket === undefined) ? {} : this.tokenBucket;
@@ -2663,6 +2669,9 @@ export default class Exchange {
2663
2669
  if (this.features === undefined) {
2664
2670
  return defaultValue;
2665
2671
  }
2672
+ if (marketType === undefined) {
2673
+ return defaultValue; // marketType is required
2674
+ }
2666
2675
  // if marketType (e.g. 'option') does not exist in features
2667
2676
  if (!(marketType in this.features)) {
2668
2677
  return defaultValue; // unsupported marketType, check "exchange.features" for details
@@ -2689,7 +2698,7 @@ export default class Exchange {
2689
2698
  }
2690
2699
  // if user wanted only marketType and didn't provide methodName, eg: featureIsSupported('spot')
2691
2700
  if (methodName === undefined) {
2692
- return methodsContainer;
2701
+ return (defaultValue !== undefined) ? defaultValue : methodsContainer;
2693
2702
  }
2694
2703
  if (!(methodName in methodsContainer)) {
2695
2704
  return defaultValue; // unsupported method, check "exchange.features" for details');
@@ -2700,7 +2709,7 @@ export default class Exchange {
2700
2709
  }
2701
2710
  // if user wanted only method and didn't provide `paramName`, eg: featureIsSupported('swap', 'linear', 'createOrder')
2702
2711
  if (paramName === undefined) {
2703
- return methodDict;
2712
+ return (defaultValue !== undefined) ? defaultValue : methodDict;
2704
2713
  }
2705
2714
  const splited = paramName.split('.'); // can be only parent key (`stopLoss`) or with child (`stopLoss.triggerPrice`)
2706
2715
  const parentKey = splited[0];
@@ -5690,6 +5699,9 @@ export default class Exchange {
5690
5699
  async cancelOrderWs(id, symbol = undefined, params = {}) {
5691
5700
  throw new NotSupported(this.id + ' cancelOrderWs() is not supported yet');
5692
5701
  }
5702
+ async cancelOrders(ids, symbol = undefined, params = {}) {
5703
+ throw new NotSupported(this.id + ' cancelOrders() is not supported yet');
5704
+ }
5693
5705
  async cancelOrdersWs(ids, symbol = undefined, params = {}) {
5694
5706
  throw new NotSupported(this.id + ' cancelOrdersWs() is not supported yet');
5695
5707
  }
@@ -52,7 +52,7 @@ class Throttler {
52
52
  resolver = resolve;
53
53
  });
54
54
  if (this.queue.length > this.config['maxCapacity']) {
55
- throw new Error('throttle queue is over maxCapacity (' + this.config['maxCapacity'].toString() + '), see https://github.com/ccxt/ccxt/issues/11645#issuecomment-1195695526');
55
+ throw new Error('throttle queue is over maxCapacity (' + this.config['maxCapacity'].toString() + '), see https://docs.ccxt.com/#/README?id=maximum-requests-capacity');
56
56
  }
57
57
  cost = (cost === undefined) ? this.config['cost'] : cost;
58
58
  this.queue.push({ resolver, cost });
package/js/src/binance.js CHANGED
@@ -247,7 +247,7 @@ export default class binance extends Exchange {
247
247
  },
248
248
  'www': 'https://www.binance.com',
249
249
  'referral': {
250
- 'url': 'https://accounts.binance.com/en/register?ref=D7YA7CLY',
250
+ 'url': 'https://accounts.binance.com/register?ref=CCXTCOM',
251
251
  'discount': 0.1,
252
252
  },
253
253
  'doc': [
package/js/src/bingx.js CHANGED
@@ -5892,7 +5892,7 @@ export default class bingx extends Exchange {
5892
5892
  this.checkAddress(address);
5893
5893
  await this.loadMarkets();
5894
5894
  const currency = this.currency(code);
5895
- const walletType = this.safeInteger(params, 'walletType', 1);
5895
+ const walletType = this.safeInteger(params, 'walletType', 15);
5896
5896
  const request = {
5897
5897
  'coin': currency['id'],
5898
5898
  'address': address,
@@ -201,7 +201,7 @@ export default class bitfinex extends Exchange {
201
201
  * @param {object} [params] extra parameters specific to the exchange API endpoint
202
202
  * @returns {object} an array of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
203
203
  */
204
- cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<Order[]>;
204
+ cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<Order[]>;
205
205
  /**
206
206
  * @method
207
207
  * @name bitfinex#fetchOpenOrder
@@ -1984,11 +1984,13 @@ export default class bitfinex extends Exchange {
1984
1984
  */
1985
1985
  async cancelOrders(ids, symbol = undefined, params = {}) {
1986
1986
  await this.loadMarkets();
1987
+ const numericIds = [];
1987
1988
  for (let i = 0; i < ids.length; i++) {
1988
- ids[i] = this.parseToNumeric(ids[i]);
1989
+ // numericIds[i] = this.parseToNumeric (ids[i]);
1990
+ numericIds.push(this.parseToNumeric(ids[i]));
1989
1991
  }
1990
1992
  const request = {
1991
- 'id': ids,
1993
+ 'id': numericIds,
1992
1994
  };
1993
1995
  let market = undefined;
1994
1996
  if (symbol !== undefined) {
@@ -6,7 +6,20 @@ import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory
6
6
  */
7
7
  export default class bitget extends Exchange {
8
8
  describe(): any;
9
- setSandboxMode(enabled: any): void;
9
+ /**
10
+ * @method
11
+ * @name bitget#setSandboxMode
12
+ * @description enables or disables demo trading mode, if enabled will send PAPTRADING=1 in headers
13
+ * @param enabled
14
+ */
15
+ setSandboxMode(enabled: boolean): void;
16
+ /**
17
+ * @method
18
+ * @name bitget#enableDemoTrading
19
+ * @description enables or disables demo trading mode, if enabled will send PAPTRADING=1 in headers
20
+ * @param enabled
21
+ */
22
+ enableDemoTrading(enabled: boolean): void;
10
23
  handleProductTypeAndParams(market?: any, params?: {}): {}[];
11
24
  /**
12
25
  * @method
@@ -423,7 +436,7 @@ export default class bitget extends Exchange {
423
436
  * @param {boolean} [params.uta] set to true for the unified trading account (uta), defaults to false
424
437
  * @returns {object} an array of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
425
438
  */
426
- cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<Order[]>;
439
+ cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<Order[]>;
427
440
  /**
428
441
  * @method
429
442
  * @name bitget#cancelAllOrders
package/js/src/bitget.js CHANGED
@@ -1779,9 +1779,24 @@ export default class bitget extends Exchange {
1779
1779
  },
1780
1780
  });
1781
1781
  }
1782
+ /**
1783
+ * @method
1784
+ * @name bitget#setSandboxMode
1785
+ * @description enables or disables demo trading mode, if enabled will send PAPTRADING=1 in headers
1786
+ * @param enabled
1787
+ */
1782
1788
  setSandboxMode(enabled) {
1783
1789
  this.options['sandboxMode'] = enabled;
1784
1790
  }
1791
+ /**
1792
+ * @method
1793
+ * @name bitget#enableDemoTrading
1794
+ * @description enables or disables demo trading mode, if enabled will send PAPTRADING=1 in headers
1795
+ * @param enabled
1796
+ */
1797
+ enableDemoTrading(enabled) {
1798
+ this.setSandboxMode(enabled);
1799
+ }
1785
1800
  handleProductTypeAndParams(market = undefined, params = {}) {
1786
1801
  let subType = undefined;
1787
1802
  [subType, params] = this.handleSubTypeAndParams('handleProductTypeAndParams', undefined, params);
@@ -7981,7 +7996,10 @@ export default class bitget extends Exchange {
7981
7996
  let market = undefined;
7982
7997
  if (symbols !== undefined) {
7983
7998
  const first = this.safeString(symbols, 0);
7984
- market = this.market(first);
7999
+ // symbols can be undefined or []
8000
+ if (first !== undefined) {
8001
+ market = this.market(first);
8002
+ }
7985
8003
  }
7986
8004
  let productType = undefined;
7987
8005
  [productType, params] = this.handleProductTypeAndParams(market, params);
@@ -7996,7 +8014,7 @@ export default class bitget extends Exchange {
7996
8014
  }
7997
8015
  else if (method === 'privateMixGetV2MixPositionAllPosition') {
7998
8016
  let marginCoin = this.safeString(params, 'marginCoin', 'USDT');
7999
- if (symbols !== undefined) {
8017
+ if (market !== undefined) {
8000
8018
  marginCoin = market['settleId'];
8001
8019
  }
8002
8020
  else if (productType === 'USDT-FUTURES') {
@@ -138,7 +138,7 @@ export default class bithumb extends Exchange {
138
138
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
139
139
  */
140
140
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
141
- cancelUnifiedOrder(order: any, params?: {}): Promise<Order>;
141
+ cancelUnifiedOrder(order: Order, params?: {}): Promise<Order>;
142
142
  /**
143
143
  * @method
144
144
  * @name bithumb#withdraw