ccxt 4.3.60 → 4.3.62

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 (77) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/binance.js +44 -34
  5. package/dist/cjs/src/bingx.js +41 -33
  6. package/dist/cjs/src/bybit.js +11 -1
  7. package/dist/cjs/src/hyperliquid.js +10 -2
  8. package/dist/cjs/src/mexc.js +2 -1
  9. package/dist/cjs/src/pro/alpaca.js +3 -3
  10. package/dist/cjs/src/pro/binance.js +2 -4
  11. package/dist/cjs/src/pro/bingx.js +2 -2
  12. package/dist/cjs/src/pro/bitfinex2.js +2 -2
  13. package/dist/cjs/src/pro/bitget.js +1 -1
  14. package/dist/cjs/src/pro/bitmex.js +1 -1
  15. package/dist/cjs/src/pro/bitopro.js +1 -1
  16. package/dist/cjs/src/pro/bybit.js +5 -5
  17. package/dist/cjs/src/pro/coinbaseexchange.js +2 -2
  18. package/dist/cjs/src/pro/coincheck.js +1 -1
  19. package/dist/cjs/src/pro/coinone.js +1 -1
  20. package/dist/cjs/src/pro/cryptocom.js +1 -1
  21. package/dist/cjs/src/pro/deribit.js +1 -1
  22. package/dist/cjs/src/pro/gate.js +2 -2
  23. package/dist/cjs/src/pro/hollaex.js +1 -1
  24. package/dist/cjs/src/pro/htx.js +1 -1
  25. package/dist/cjs/src/pro/hyperliquid.js +3 -3
  26. package/dist/cjs/src/pro/kraken.js +1 -1
  27. package/dist/cjs/src/pro/kucoin.js +3 -4
  28. package/dist/cjs/src/pro/mexc.js +1 -1
  29. package/dist/cjs/src/pro/okx.js +1 -1
  30. package/dist/cjs/src/pro/oxfun.js +1 -1
  31. package/dist/cjs/src/pro/phemex.js +1 -1
  32. package/dist/cjs/src/pro/upbit.js +1 -1
  33. package/dist/cjs/src/pro/vertex.js +2 -2
  34. package/dist/cjs/src/pro/whitebit.js +1 -1
  35. package/dist/cjs/src/pro/woo.js +1 -1
  36. package/dist/cjs/src/tradeogre.js +1 -1
  37. package/dist/cjs/src/vertex.js +10 -1
  38. package/dist/cjs/src/xt.js +1 -1
  39. package/js/ccxt.d.ts +1 -1
  40. package/js/ccxt.js +1 -1
  41. package/js/src/base/ws/Client.d.ts +1 -1
  42. package/js/src/binance.js +44 -34
  43. package/js/src/bingx.js +41 -33
  44. package/js/src/bybit.js +11 -1
  45. package/js/src/hyperliquid.js +10 -2
  46. package/js/src/mexc.js +2 -1
  47. package/js/src/pro/alpaca.js +3 -3
  48. package/js/src/pro/binance.js +2 -4
  49. package/js/src/pro/bingx.js +2 -2
  50. package/js/src/pro/bitfinex2.js +2 -2
  51. package/js/src/pro/bitget.js +1 -1
  52. package/js/src/pro/bitmex.js +1 -1
  53. package/js/src/pro/bitopro.js +1 -1
  54. package/js/src/pro/bybit.js +5 -5
  55. package/js/src/pro/coinbaseexchange.js +2 -2
  56. package/js/src/pro/coincheck.js +1 -1
  57. package/js/src/pro/coinone.js +1 -1
  58. package/js/src/pro/cryptocom.js +1 -1
  59. package/js/src/pro/deribit.js +1 -1
  60. package/js/src/pro/gate.js +2 -2
  61. package/js/src/pro/hollaex.js +1 -1
  62. package/js/src/pro/htx.js +1 -1
  63. package/js/src/pro/hyperliquid.js +3 -3
  64. package/js/src/pro/kraken.js +1 -1
  65. package/js/src/pro/kucoin.js +3 -4
  66. package/js/src/pro/mexc.js +1 -1
  67. package/js/src/pro/okx.js +1 -1
  68. package/js/src/pro/oxfun.js +1 -1
  69. package/js/src/pro/phemex.js +1 -1
  70. package/js/src/pro/upbit.js +1 -1
  71. package/js/src/pro/vertex.js +2 -2
  72. package/js/src/pro/whitebit.js +1 -1
  73. package/js/src/pro/woo.js +1 -1
  74. package/js/src/tradeogre.js +1 -1
  75. package/js/src/vertex.js +10 -1
  76. package/js/src/xt.js +1 -1
  77. package/package.json +1 -1
@@ -987,13 +987,12 @@ class kucoin extends kucoin$1 {
987
987
  * @param {int} [limit] the maximum number of trade structures to retrieve
988
988
  * @param {object} [params] extra parameters specific to the exchange API endpoint
989
989
  * @param {string} [params.method] '/spotMarket/tradeOrders' or '/spot/tradeFills' default is '/spotMarket/tradeOrders'
990
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
990
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
991
991
  */
992
992
  await this.loadMarkets();
993
993
  const url = await this.negotiate(true);
994
- const options = this.safeDict(this.options, 'watchMyTrades');
995
- const defaultMethod = this.safeString(params, 'method', '/spotMarket/tradeOrders');
996
- const topic = (defaultMethod !== undefined) ? defaultMethod : this.safeString(options, 'method');
994
+ let topic = undefined;
995
+ [topic, params] = this.handleOptionAndParams(params, 'watchMyTrades', 'method', '/spotMarket/tradeOrders');
997
996
  const request = {
998
997
  'privateChannel': true,
999
998
  };
@@ -614,7 +614,7 @@ class mexc extends mexc$1 {
614
614
  * @param {int} [since] the earliest time in ms to fetch trades for
615
615
  * @param {int} [limit] the maximum number of trade structures to retrieve
616
616
  * @param {object} [params] extra parameters specific to the exchange API endpoint
617
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
617
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
618
618
  */
619
619
  await this.loadMarkets();
620
620
  let messageHash = 'myTrades';
@@ -1223,7 +1223,7 @@ class okx extends okx$1 {
1223
1223
  * @param {bool} [params.stop] true if fetching trigger or conditional trades
1224
1224
  * @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
1225
1225
  * @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
1226
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
1226
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
1227
1227
  */
1228
1228
  // By default, receive order updates from any instrument type
1229
1229
  let type = undefined;
@@ -77,7 +77,7 @@ class oxfun extends oxfun$1 {
77
77
  * @param {int} [limit] the maximum number of trade structures to retrieve
78
78
  * @param {object} [params] extra parameters specific to the exchange API endpoint
79
79
  * @param {int|string} [params.tag] If given it will be echoed in the reply and the max size of tag is 32
80
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
80
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
81
81
  */
82
82
  return await this.watchTradesForSymbols([symbol], since, limit, params);
83
83
  }
@@ -730,7 +730,7 @@ class phemex extends phemex$1 {
730
730
  * @param {int} [since] the earliest time in ms to fetch trades for
731
731
  * @param {int} [limit] the maximum number of trade structures to retrieve
732
732
  * @param {object} [params] extra parameters specific to the exchange API endpoint
733
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
733
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
734
734
  */
735
735
  await this.loadMarkets();
736
736
  let market = undefined;
@@ -306,7 +306,7 @@ class upbit extends upbit$1 {
306
306
  * @param {int} [since] the earliest time in ms to fetch orders for
307
307
  * @param {int} [limit] the maximum number of order structures to retrieve
308
308
  * @param {object} [params] extra parameters specific to the exchange API endpoint
309
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
309
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
310
310
  */
311
311
  await this.loadMarkets();
312
312
  const channel = 'myOrder';
@@ -84,7 +84,7 @@ class vertex extends vertex$1 {
84
84
  * @param {int} [since] the earliest time in ms to fetch trades for
85
85
  * @param {int} [limit] the maximum number of trade structures to retrieve
86
86
  * @param {object} [params] extra parameters specific to the exchange API endpoint
87
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
87
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
88
88
  */
89
89
  await this.loadMarkets();
90
90
  const market = this.market(symbol);
@@ -145,7 +145,7 @@ class vertex extends vertex$1 {
145
145
  * @param {int} [limit] the maximum number of order structures to retrieve
146
146
  * @param {object} [params] extra parameters specific to the exchange API endpoint
147
147
  * @param {string} [params.user] user address, will default to this.walletAddress if not provided
148
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
148
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
149
149
  */
150
150
  if (symbol === undefined) {
151
151
  throw new errors.ArgumentsRequired(this.id + ' watchMyTrades requires a symbol.');
@@ -475,7 +475,7 @@ class whitebit extends whitebit$1 {
475
475
  * @param {int} [since] the earliest time in ms to fetch orders for
476
476
  * @param {int} [limit] the maximum number of order structures to retrieve
477
477
  * @param {object} [params] extra parameters specific to the exchange API endpoint
478
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
478
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
479
479
  */
480
480
  if (symbol === undefined) {
481
481
  throw new errors.ArgumentsRequired(this.id + ' watchOrders() requires a symbol argument');
@@ -376,7 +376,7 @@ class woo extends woo$1 {
376
376
  * @param {int} [since] the earliest time in ms to fetch trades for
377
377
  * @param {int} [limit] the maximum number of trade structures to retrieve
378
378
  * @param {object} [params] extra parameters specific to the exchange API endpoint
379
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
379
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
380
380
  */
381
381
  await this.loadMarkets();
382
382
  const market = this.market(symbol);
@@ -215,7 +215,7 @@ class tradeogre extends tradeogre$1 {
215
215
  'inverse': undefined,
216
216
  'contractSize': undefined,
217
217
  'taker': this.fees['trading']['taker'],
218
- 'maker': this.fees['trading']['taker'],
218
+ 'maker': this.fees['trading']['maker'],
219
219
  'expiry': undefined,
220
220
  'expiryDatetime': undefined,
221
221
  'strike': undefined,
@@ -396,7 +396,16 @@ class vertex extends vertex$1 {
396
396
  'withdraw': this.safeBool(data, 'can_withdraw'),
397
397
  'networks': undefined,
398
398
  'fee': undefined,
399
- 'limits': undefined,
399
+ 'limits': {
400
+ 'amount': {
401
+ 'min': undefined,
402
+ 'max': undefined,
403
+ },
404
+ 'withdraw': {
405
+ 'min': undefined,
406
+ 'max': undefined,
407
+ },
408
+ },
400
409
  };
401
410
  }
402
411
  return result;
@@ -4781,7 +4781,7 @@ class xt extends xt$1 {
4781
4781
  if (isUndefinedBody) {
4782
4782
  if (urlencoded) {
4783
4783
  url += '?' + urlencoded;
4784
- payloadString += '#' + method + '#' + payload + '#' + urlencoded;
4784
+ payloadString += '#' + method + '#' + payload + '#' + this.rawencode(this.keysort(query));
4785
4785
  }
4786
4786
  else {
4787
4787
  payloadString += '#' + method + '#' + payload;
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, TransferEntries, LeverageTiers } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
7
- declare const version = "4.3.59";
7
+ declare const version = "4.3.61";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
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, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.60';
41
+ const version = '4.3.62';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -5,7 +5,7 @@ export default class Client {
5
5
  disconnected: ReturnType<typeof Future>;
6
6
  futures: Dictionary<any>;
7
7
  rejections: Dictionary<any>;
8
- messageQueue: Dictionary<string, any>;
8
+ messageQueue: Dictionary<any>;
9
9
  useMessageQueue: boolean;
10
10
  keepAlive: number;
11
11
  connection: any;
package/js/src/binance.js CHANGED
@@ -9787,40 +9787,45 @@ export default class binance extends Exchange {
9787
9787
  if (marginMode === 'cross') {
9788
9788
  // calculate collateral
9789
9789
  const precision = this.safeDict(market, 'precision', {});
9790
- if (linear) {
9791
- // walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts
9792
- let onePlusMaintenanceMarginPercentageString = undefined;
9793
- let entryPriceSignString = entryPriceString;
9794
- if (side === 'short') {
9795
- onePlusMaintenanceMarginPercentageString = Precise.stringAdd('1', maintenanceMarginPercentageString);
9796
- entryPriceSignString = Precise.stringMul('-1', entryPriceSignString);
9797
- }
9798
- else {
9799
- onePlusMaintenanceMarginPercentageString = Precise.stringAdd('-1', maintenanceMarginPercentageString);
9800
- }
9801
- const inner = Precise.stringMul(liquidationPriceString, onePlusMaintenanceMarginPercentageString);
9802
- const leftSide = Precise.stringAdd(inner, entryPriceSignString);
9803
- const quotePrecision = this.precisionFromString(this.safeString2(precision, 'quote', 'price'));
9804
- if (quotePrecision !== undefined) {
9805
- collateralString = Precise.stringDiv(Precise.stringMul(leftSide, contractsAbs), '1', quotePrecision);
9806
- }
9807
- }
9808
- else {
9809
- // walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)
9810
- let onePlusMaintenanceMarginPercentageString = undefined;
9811
- let entryPriceSignString = entryPriceString;
9812
- if (side === 'short') {
9813
- onePlusMaintenanceMarginPercentageString = Precise.stringSub('1', maintenanceMarginPercentageString);
9790
+ const basePrecisionValue = this.safeString(precision, 'base');
9791
+ const quotePrecisionValue = this.safeString2(precision, 'quote', 'price');
9792
+ const precisionIsUndefined = (basePrecisionValue === undefined) && (quotePrecisionValue === undefined);
9793
+ if (!precisionIsUndefined) {
9794
+ if (linear) {
9795
+ // walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts
9796
+ let onePlusMaintenanceMarginPercentageString = undefined;
9797
+ let entryPriceSignString = entryPriceString;
9798
+ if (side === 'short') {
9799
+ onePlusMaintenanceMarginPercentageString = Precise.stringAdd('1', maintenanceMarginPercentageString);
9800
+ entryPriceSignString = Precise.stringMul('-1', entryPriceSignString);
9801
+ }
9802
+ else {
9803
+ onePlusMaintenanceMarginPercentageString = Precise.stringAdd('-1', maintenanceMarginPercentageString);
9804
+ }
9805
+ const inner = Precise.stringMul(liquidationPriceString, onePlusMaintenanceMarginPercentageString);
9806
+ const leftSide = Precise.stringAdd(inner, entryPriceSignString);
9807
+ const quotePrecision = this.precisionFromString(this.safeString2(precision, 'quote', 'price'));
9808
+ if (quotePrecision !== undefined) {
9809
+ collateralString = Precise.stringDiv(Precise.stringMul(leftSide, contractsAbs), '1', quotePrecision);
9810
+ }
9814
9811
  }
9815
9812
  else {
9816
- onePlusMaintenanceMarginPercentageString = Precise.stringSub('-1', maintenanceMarginPercentageString);
9817
- entryPriceSignString = Precise.stringMul('-1', entryPriceSignString);
9818
- }
9819
- const leftSide = Precise.stringMul(contractsAbs, contractSizeString);
9820
- const rightSide = Precise.stringSub(Precise.stringDiv('1', entryPriceSignString), Precise.stringDiv(onePlusMaintenanceMarginPercentageString, liquidationPriceString));
9821
- const basePrecision = this.precisionFromString(this.safeString(precision, 'base'));
9822
- if (basePrecision !== undefined) {
9823
- collateralString = Precise.stringDiv(Precise.stringMul(leftSide, rightSide), '1', basePrecision);
9813
+ // walletBalance = (contracts * contractSize) * (±1/entryPrice -1 - mmp) / liquidationPrice)
9814
+ let onePlusMaintenanceMarginPercentageString = undefined;
9815
+ let entryPriceSignString = entryPriceString;
9816
+ if (side === 'short') {
9817
+ onePlusMaintenanceMarginPercentageString = Precise.stringSub('1', maintenanceMarginPercentageString);
9818
+ }
9819
+ else {
9820
+ onePlusMaintenanceMarginPercentageString = Precise.stringSub('-1', maintenanceMarginPercentageString);
9821
+ entryPriceSignString = Precise.stringMul('-1', entryPriceSignString);
9822
+ }
9823
+ const leftSide = Precise.stringMul(contractsAbs, contractSizeString);
9824
+ const rightSide = Precise.stringSub(Precise.stringDiv('1', entryPriceSignString), Precise.stringDiv(onePlusMaintenanceMarginPercentageString, liquidationPriceString));
9825
+ const basePrecision = this.precisionFromString(this.safeString(precision, 'base'));
9826
+ if (basePrecision !== undefined) {
9827
+ collateralString = Precise.stringDiv(Precise.stringMul(leftSide, rightSide), '1', basePrecision);
9828
+ }
9824
9829
  }
9825
9830
  }
9826
9831
  }
@@ -10452,9 +10457,10 @@ export default class binance extends Exchange {
10452
10457
  //
10453
10458
  const result = [];
10454
10459
  for (let i = 0; i < response.length; i++) {
10455
- const parsed = this.parsePositionRisk(response[i]);
10456
- const entryPrice = this.safeString(parsed, 'entryPrice');
10460
+ const rawPosition = response[i];
10461
+ const entryPrice = this.safeString(rawPosition, 'entryPrice');
10457
10462
  if ((entryPrice !== '0') && (entryPrice !== '0.0') && (entryPrice !== '0.00000000')) {
10463
+ const parsed = this.parsePositionRisk(response[i]);
10458
10464
  result.push(parsed);
10459
10465
  }
10460
10466
  }
@@ -12175,6 +12181,9 @@ export default class binance extends Exchange {
12175
12181
  const request = {};
12176
12182
  if (market['option']) {
12177
12183
  request['underlyingAsset'] = market['baseId'];
12184
+ if (market['expiry'] === undefined) {
12185
+ throw new NotSupported(this.id + ' fetchOpenInterest does not support ' + symbol);
12186
+ }
12178
12187
  request['expiration'] = this.yymmdd(market['expiry']);
12179
12188
  }
12180
12189
  else {
@@ -12221,6 +12230,7 @@ export default class binance extends Exchange {
12221
12230
  // ]
12222
12231
  //
12223
12232
  if (market['option']) {
12233
+ symbol = market['symbol'];
12224
12234
  const result = this.parseOpenInterests(response, market);
12225
12235
  for (let i = 0; i < result.length; i++) {
12226
12236
  const item = result[i];
package/js/src/bingx.js CHANGED
@@ -522,37 +522,40 @@ export default class bingx extends Exchange {
522
522
  const response = await this.walletsV1PrivateGetCapitalConfigGetall(params);
523
523
  //
524
524
  // {
525
- // "code": 0,
526
- // "timestamp": 1688045966616,
527
- // "data": [
525
+ // "code": 0,
526
+ // "timestamp": 1702623271477,
527
+ // "data": [
528
+ // {
529
+ // "coin": "BTC",
530
+ // "name": "BTC",
531
+ // "networkList": [
528
532
  // {
529
- // "coin": "BTC",
530
533
  // "name": "BTC",
531
- // "networkList": [
532
- // {
533
- // "name": "BTC",
534
- // "network": "BTC",
535
- // "isDefault": true,
536
- // "minConfirm": "2",
537
- // "withdrawEnable": true,
538
- // "withdrawFee": "0.00035",
539
- // "withdrawMax": "1.62842",
540
- // "withdrawMin": "0.0005"
541
- // },
542
- // {
543
- // "name": "BTC",
544
- // "network": "BEP20",
545
- // "isDefault": false,
546
- // "minConfirm": "15",
547
- // "withdrawEnable": true,
548
- // "withdrawFee": "0.00001",
549
- // "withdrawMax": "1.62734",
550
- // "withdrawMin": "0.0001"
551
- // }
552
- // ]
553
- // },
554
- // ...
555
- // ],
534
+ // "network": "BTC",
535
+ // "isDefault": true,
536
+ // "minConfirm": 2,
537
+ // "withdrawEnable": true,
538
+ // "depositEnable": true,
539
+ // "withdrawFee": "0.0006",
540
+ // "withdrawMax": "1.17522",
541
+ // "withdrawMin": "0.0005",
542
+ // "depositMin": "0.0002"
543
+ // },
544
+ // {
545
+ // "name": "BTC",
546
+ // "network": "BEP20",
547
+ // "isDefault": false,
548
+ // "minConfirm": 15,
549
+ // "withdrawEnable": true,
550
+ // "depositEnable": true,
551
+ // "withdrawFee": "0.0000066",
552
+ // "withdrawMax": "1.17522",
553
+ // "withdrawMin": "0.0000066",
554
+ // "depositMin": "0.0002"
555
+ // }
556
+ // ]
557
+ // }
558
+ // ]
556
559
  // }
557
560
  //
558
561
  const data = this.safeList(response, 'data', []);
@@ -566,6 +569,7 @@ export default class bingx extends Exchange {
566
569
  const networks = {};
567
570
  let fee = undefined;
568
571
  let active = undefined;
572
+ let depositEnabled = undefined;
569
573
  let withdrawEnabled = undefined;
570
574
  let defaultLimits = {};
571
575
  for (let j = 0; j < networkList.length; j++) {
@@ -573,13 +577,17 @@ export default class bingx extends Exchange {
573
577
  const network = this.safeString(rawNetwork, 'network');
574
578
  const networkCode = this.networkIdToCode(network);
575
579
  const isDefault = this.safeBool(rawNetwork, 'isDefault');
580
+ depositEnabled = this.safeBool(rawNetwork, 'depositEnable');
576
581
  withdrawEnabled = this.safeBool(rawNetwork, 'withdrawEnable');
577
582
  const limits = {
578
- 'amounts': { 'min': this.safeNumber(rawNetwork, 'withdrawMin'), 'max': this.safeNumber(rawNetwork, 'withdrawMax') },
583
+ 'withdraw': {
584
+ 'min': this.safeNumber(rawNetwork, 'withdrawMin'),
585
+ 'max': this.safeNumber(rawNetwork, 'withdrawMax'),
586
+ },
579
587
  };
580
588
  if (isDefault) {
581
589
  fee = this.safeNumber(rawNetwork, 'withdrawFee');
582
- active = withdrawEnabled;
590
+ active = depositEnabled || withdrawEnabled;
583
591
  defaultLimits = limits;
584
592
  }
585
593
  networks[networkCode] = {
@@ -588,7 +596,7 @@ export default class bingx extends Exchange {
588
596
  'network': networkCode,
589
597
  'fee': fee,
590
598
  'active': active,
591
- 'deposit': undefined,
599
+ 'deposit': depositEnabled,
592
600
  'withdraw': withdrawEnabled,
593
601
  'precision': undefined,
594
602
  'limits': limits,
@@ -601,7 +609,7 @@ export default class bingx extends Exchange {
601
609
  'precision': undefined,
602
610
  'name': name,
603
611
  'active': active,
604
- 'deposit': undefined,
612
+ 'deposit': depositEnabled,
605
613
  'withdraw': withdrawEnabled,
606
614
  'networks': networks,
607
615
  'fee': fee,
package/js/src/bybit.js CHANGED
@@ -4346,6 +4346,11 @@ export default class bybit extends Exchange {
4346
4346
  }
4347
4347
  await this.loadMarkets();
4348
4348
  const market = this.market(symbol);
4349
+ const types = await this.isUnifiedEnabled();
4350
+ const enableUnifiedAccount = types[1];
4351
+ if (!enableUnifiedAccount) {
4352
+ throw new NotSupported(this.id + ' cancelOrders() supports UTA accounts only');
4353
+ }
4349
4354
  let category = undefined;
4350
4355
  [category, params] = this.getBybitType('cancelOrders', market, params);
4351
4356
  if (category === 'inverse') {
@@ -4454,6 +4459,11 @@ export default class bybit extends Exchange {
4454
4459
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4455
4460
  */
4456
4461
  await this.loadMarkets();
4462
+ const types = await this.isUnifiedEnabled();
4463
+ const enableUnifiedAccount = types[1];
4464
+ if (!enableUnifiedAccount) {
4465
+ throw new NotSupported(this.id + ' cancelOrdersForSymbols() supports UTA accounts only');
4466
+ }
4457
4467
  const ordersRequests = [];
4458
4468
  let category = undefined;
4459
4469
  for (let i = 0; i < orders.length; i++) {
@@ -6307,6 +6317,7 @@ export default class bybit extends Exchange {
6307
6317
  * @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
6308
6318
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
6309
6319
  */
6320
+ await this.loadMarkets();
6310
6321
  let symbol = undefined;
6311
6322
  if ((symbols !== undefined) && Array.isArray(symbols)) {
6312
6323
  const symbolsLength = symbols.length;
@@ -6322,7 +6333,6 @@ export default class bybit extends Exchange {
6322
6333
  symbol = symbols;
6323
6334
  symbols = [this.symbol(symbol)];
6324
6335
  }
6325
- await this.loadMarkets();
6326
6336
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
6327
6337
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
6328
6338
  const request = {};
@@ -251,8 +251,16 @@ export default class hyperliquid extends Exchange {
251
251
  'withdraw': undefined,
252
252
  'networks': undefined,
253
253
  'fee': undefined,
254
- // 'fees': fees,
255
- 'limits': undefined,
254
+ 'limits': {
255
+ 'amount': {
256
+ 'min': undefined,
257
+ 'max': undefined,
258
+ },
259
+ 'withdraw': {
260
+ 'min': undefined,
261
+ 'max': undefined,
262
+ },
263
+ },
256
264
  };
257
265
  }
258
266
  return result;
package/js/src/mexc.js CHANGED
@@ -5236,9 +5236,10 @@ export default class mexc extends Exchange {
5236
5236
  * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
5237
5237
  */
5238
5238
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
5239
- const networks = this.safeValue(this.options, 'networks', {});
5239
+ const networks = this.safeDict(this.options, 'networks', {});
5240
5240
  let network = this.safeString2(params, 'network', 'netWork'); // this line allows the user to specify either ERC20 or ETH
5241
5241
  network = this.safeString(networks, network, network); // handle ETH > ERC-20 alias
5242
+ network = this.networkCodeToId(network);
5242
5243
  this.checkAddress(address);
5243
5244
  await this.loadMarkets();
5244
5245
  const currency = this.currency(code);
@@ -266,7 +266,7 @@ export default class alpaca extends alpacaRest {
266
266
  * @param {int} [since] the earliest time in ms to fetch orders for
267
267
  * @param {int} [limit] the maximum number of trade structures to retrieve
268
268
  * @param {object} [params] extra parameters specific to the exchange API endpoint
269
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
269
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
270
270
  */
271
271
  const url = this.urls['api']['ws']['crypto'];
272
272
  await this.authenticate(url);
@@ -319,7 +319,7 @@ export default class alpaca extends alpacaRest {
319
319
  * @param {int} [limit] the maximum number of trade structures to retrieve
320
320
  * @param {object} [params] extra parameters specific to the exchange API endpoint
321
321
  * @param {boolean} [params.unifiedMargin] use unified margin account
322
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
322
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
323
323
  */
324
324
  const url = this.urls['api']['ws']['trading'];
325
325
  await this.authenticate(url);
@@ -350,7 +350,7 @@ export default class alpaca extends alpacaRest {
350
350
  * @param {int} [since] the earliest time in ms to fetch orders for
351
351
  * @param {int} [limit] the maximum number of order structures to retrieve
352
352
  * @param {object} [params] extra parameters specific to the exchange API endpoint
353
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
353
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
354
354
  */
355
355
  const url = this.urls['api']['ws']['trading'];
356
356
  await this.authenticate(url);
@@ -714,10 +714,8 @@ export default class binance extends binanceRest {
714
714
  client.resolve(orderbook, messageHash);
715
715
  }
716
716
  async fetchOrderBookSnapshot(client, message, subscription) {
717
- const name = this.safeString(subscription, 'name');
718
717
  const symbol = this.safeString(subscription, 'symbol');
719
- const market = this.market(symbol);
720
- const messageHash = market['lowercaseId'] + '@' + name;
718
+ const messageHash = 'orderbook::' + symbol;
721
719
  try {
722
720
  const defaultLimit = this.safeInteger(this.options, 'watchOrderBookLimit', 1000);
723
721
  const type = this.safeValue(subscription, 'type');
@@ -3556,7 +3554,7 @@ export default class binance extends binanceRest {
3556
3554
  * @param {int} [limit] the maximum number of order structures to retrieve
3557
3555
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3558
3556
  * @param {boolean} [params.portfolioMargin] set to true if you would like to watch trades in a portfolio margin account
3559
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
3557
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3560
3558
  */
3561
3559
  await this.loadMarkets();
3562
3560
  let type = undefined;
@@ -444,7 +444,7 @@ export default class bingx extends bingxRest {
444
444
  * @param {int} [since] the earliest time in ms to fetch orders for
445
445
  * @param {int} [limit] the maximum number of order structures to retrieve
446
446
  * @param {object} [params] extra parameters specific to the exchange API endpoint
447
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
447
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
448
448
  */
449
449
  await this.loadMarkets();
450
450
  const market = this.market(symbol);
@@ -891,7 +891,7 @@ export default class bingx extends bingxRest {
891
891
  * @param {int} [since] the earliest time in ms to trades orders for
892
892
  * @param {int} [limit] the maximum number of trades structures to retrieve
893
893
  * @param {object} [params] extra parameters specific to the exchange API endpoint
894
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
894
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
895
895
  */
896
896
  await this.loadMarkets();
897
897
  await this.authenticate();
@@ -213,7 +213,7 @@ export default class bitfinex2 extends bitfinex2Rest {
213
213
  * @param {int} [since] the earliest time in ms to fetch trades for
214
214
  * @param {int} [limit] the maximum number of trade structures to retrieve
215
215
  * @param {object} [params] extra parameters specific to the exchange API endpoint
216
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
216
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
217
217
  */
218
218
  await this.loadMarkets();
219
219
  let messageHash = 'myTrade';
@@ -894,7 +894,7 @@ export default class bitfinex2 extends bitfinex2Rest {
894
894
  * @param {int} [since] the earliest time in ms to fetch orders for
895
895
  * @param {int} [limit] the maximum number of order structures to retrieve
896
896
  * @param {object} [params] extra parameters specific to the exchange API endpoint
897
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
897
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
898
898
  */
899
899
  await this.loadMarkets();
900
900
  let messageHash = 'orders';
@@ -972,7 +972,7 @@ export default class bitget extends bitgetRest {
972
972
  * @param {string} [params.marginMode] 'isolated' or 'cross' for watching spot margin orders]
973
973
  * @param {string} [params.type] 'spot', 'swap'
974
974
  * @param {string} [params.subType] 'linear', 'inverse'
975
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
975
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
976
976
  */
977
977
  await this.loadMarkets();
978
978
  let market = undefined;
@@ -1149,7 +1149,7 @@ export default class bitmex extends bitmexRest {
1149
1149
  * @param {int} [since] the earliest time in ms to fetch trades for
1150
1150
  * @param {int} [limit] the maximum number of trade structures to retrieve
1151
1151
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1152
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
1152
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
1153
1153
  */
1154
1154
  await this.loadMarkets();
1155
1155
  await this.authenticate();
@@ -187,7 +187,7 @@ export default class bitopro extends bitoproRest {
187
187
  * @param {int} [since] the earliest time in ms to fetch trades for
188
188
  * @param {int} [limit] the maximum number of trade structures to retrieve
189
189
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
190
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
191
191
  */
192
192
  this.checkRequiredCredentials();
193
193
  await this.loadMarkets();