ccxt 4.3.61 → 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 (71) 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 +1 -1
  7. package/dist/cjs/src/pro/alpaca.js +3 -3
  8. package/dist/cjs/src/pro/binance.js +2 -4
  9. package/dist/cjs/src/pro/bingx.js +2 -2
  10. package/dist/cjs/src/pro/bitfinex2.js +2 -2
  11. package/dist/cjs/src/pro/bitget.js +1 -1
  12. package/dist/cjs/src/pro/bitmex.js +1 -1
  13. package/dist/cjs/src/pro/bitopro.js +1 -1
  14. package/dist/cjs/src/pro/bybit.js +5 -5
  15. package/dist/cjs/src/pro/coinbaseexchange.js +2 -2
  16. package/dist/cjs/src/pro/coincheck.js +1 -1
  17. package/dist/cjs/src/pro/coinone.js +1 -1
  18. package/dist/cjs/src/pro/cryptocom.js +1 -1
  19. package/dist/cjs/src/pro/deribit.js +1 -1
  20. package/dist/cjs/src/pro/gate.js +2 -2
  21. package/dist/cjs/src/pro/hollaex.js +1 -1
  22. package/dist/cjs/src/pro/htx.js +1 -1
  23. package/dist/cjs/src/pro/hyperliquid.js +3 -3
  24. package/dist/cjs/src/pro/kraken.js +1 -1
  25. package/dist/cjs/src/pro/kucoin.js +1 -1
  26. package/dist/cjs/src/pro/mexc.js +1 -1
  27. package/dist/cjs/src/pro/okx.js +1 -1
  28. package/dist/cjs/src/pro/oxfun.js +1 -1
  29. package/dist/cjs/src/pro/phemex.js +1 -1
  30. package/dist/cjs/src/pro/upbit.js +1 -1
  31. package/dist/cjs/src/pro/vertex.js +2 -2
  32. package/dist/cjs/src/pro/whitebit.js +1 -1
  33. package/dist/cjs/src/pro/woo.js +1 -1
  34. package/dist/cjs/src/tradeogre.js +1 -1
  35. package/dist/cjs/src/xt.js +1 -1
  36. package/js/ccxt.d.ts +1 -1
  37. package/js/ccxt.js +1 -1
  38. package/js/src/base/ws/Client.d.ts +1 -1
  39. package/js/src/binance.js +44 -34
  40. package/js/src/bingx.js +41 -33
  41. package/js/src/bybit.js +1 -1
  42. package/js/src/pro/alpaca.js +3 -3
  43. package/js/src/pro/binance.js +2 -4
  44. package/js/src/pro/bingx.js +2 -2
  45. package/js/src/pro/bitfinex2.js +2 -2
  46. package/js/src/pro/bitget.js +1 -1
  47. package/js/src/pro/bitmex.js +1 -1
  48. package/js/src/pro/bitopro.js +1 -1
  49. package/js/src/pro/bybit.js +5 -5
  50. package/js/src/pro/coinbaseexchange.js +2 -2
  51. package/js/src/pro/coincheck.js +1 -1
  52. package/js/src/pro/coinone.js +1 -1
  53. package/js/src/pro/cryptocom.js +1 -1
  54. package/js/src/pro/deribit.js +1 -1
  55. package/js/src/pro/gate.js +2 -2
  56. package/js/src/pro/hollaex.js +1 -1
  57. package/js/src/pro/htx.js +1 -1
  58. package/js/src/pro/hyperliquid.js +3 -3
  59. package/js/src/pro/kraken.js +1 -1
  60. package/js/src/pro/kucoin.js +1 -1
  61. package/js/src/pro/mexc.js +1 -1
  62. package/js/src/pro/okx.js +1 -1
  63. package/js/src/pro/oxfun.js +1 -1
  64. package/js/src/pro/phemex.js +1 -1
  65. package/js/src/pro/upbit.js +1 -1
  66. package/js/src/pro/vertex.js +2 -2
  67. package/js/src/pro/whitebit.js +1 -1
  68. package/js/src/pro/woo.js +1 -1
  69. package/js/src/tradeogre.js +1 -1
  70. package/js/src/xt.js +1 -1
  71. package/package.json +1 -1
package/dist/cjs/ccxt.js CHANGED
@@ -191,7 +191,7 @@ var xt$1 = require('./src/pro/xt.js');
191
191
 
192
192
  //-----------------------------------------------------------------------------
193
193
  // this is updated by vss.js when building
194
- const version = '4.3.61';
194
+ const version = '4.3.62';
195
195
  Exchange["default"].ccxtVersion = version;
196
196
  const exchanges = {
197
197
  'ace': ace,
@@ -9784,40 +9784,45 @@ class binance extends binance$1 {
9784
9784
  if (marginMode === 'cross') {
9785
9785
  // calculate collateral
9786
9786
  const precision = this.safeDict(market, 'precision', {});
9787
- if (linear) {
9788
- // walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts
9789
- let onePlusMaintenanceMarginPercentageString = undefined;
9790
- let entryPriceSignString = entryPriceString;
9791
- if (side === 'short') {
9792
- onePlusMaintenanceMarginPercentageString = Precise["default"].stringAdd('1', maintenanceMarginPercentageString);
9793
- entryPriceSignString = Precise["default"].stringMul('-1', entryPriceSignString);
9794
- }
9795
- else {
9796
- onePlusMaintenanceMarginPercentageString = Precise["default"].stringAdd('-1', maintenanceMarginPercentageString);
9797
- }
9798
- const inner = Precise["default"].stringMul(liquidationPriceString, onePlusMaintenanceMarginPercentageString);
9799
- const leftSide = Precise["default"].stringAdd(inner, entryPriceSignString);
9800
- const quotePrecision = this.precisionFromString(this.safeString2(precision, 'quote', 'price'));
9801
- if (quotePrecision !== undefined) {
9802
- collateralString = Precise["default"].stringDiv(Precise["default"].stringMul(leftSide, contractsAbs), '1', quotePrecision);
9803
- }
9804
- }
9805
- else {
9806
- // walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)
9807
- let onePlusMaintenanceMarginPercentageString = undefined;
9808
- let entryPriceSignString = entryPriceString;
9809
- if (side === 'short') {
9810
- onePlusMaintenanceMarginPercentageString = Precise["default"].stringSub('1', maintenanceMarginPercentageString);
9787
+ const basePrecisionValue = this.safeString(precision, 'base');
9788
+ const quotePrecisionValue = this.safeString2(precision, 'quote', 'price');
9789
+ const precisionIsUndefined = (basePrecisionValue === undefined) && (quotePrecisionValue === undefined);
9790
+ if (!precisionIsUndefined) {
9791
+ if (linear) {
9792
+ // walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts
9793
+ let onePlusMaintenanceMarginPercentageString = undefined;
9794
+ let entryPriceSignString = entryPriceString;
9795
+ if (side === 'short') {
9796
+ onePlusMaintenanceMarginPercentageString = Precise["default"].stringAdd('1', maintenanceMarginPercentageString);
9797
+ entryPriceSignString = Precise["default"].stringMul('-1', entryPriceSignString);
9798
+ }
9799
+ else {
9800
+ onePlusMaintenanceMarginPercentageString = Precise["default"].stringAdd('-1', maintenanceMarginPercentageString);
9801
+ }
9802
+ const inner = Precise["default"].stringMul(liquidationPriceString, onePlusMaintenanceMarginPercentageString);
9803
+ const leftSide = Precise["default"].stringAdd(inner, entryPriceSignString);
9804
+ const quotePrecision = this.precisionFromString(this.safeString2(precision, 'quote', 'price'));
9805
+ if (quotePrecision !== undefined) {
9806
+ collateralString = Precise["default"].stringDiv(Precise["default"].stringMul(leftSide, contractsAbs), '1', quotePrecision);
9807
+ }
9811
9808
  }
9812
9809
  else {
9813
- onePlusMaintenanceMarginPercentageString = Precise["default"].stringSub('-1', maintenanceMarginPercentageString);
9814
- entryPriceSignString = Precise["default"].stringMul('-1', entryPriceSignString);
9815
- }
9816
- const leftSide = Precise["default"].stringMul(contractsAbs, contractSizeString);
9817
- const rightSide = Precise["default"].stringSub(Precise["default"].stringDiv('1', entryPriceSignString), Precise["default"].stringDiv(onePlusMaintenanceMarginPercentageString, liquidationPriceString));
9818
- const basePrecision = this.precisionFromString(this.safeString(precision, 'base'));
9819
- if (basePrecision !== undefined) {
9820
- collateralString = Precise["default"].stringDiv(Precise["default"].stringMul(leftSide, rightSide), '1', basePrecision);
9810
+ // walletBalance = (contracts * contractSize) * (±1/entryPrice -1 - mmp) / liquidationPrice)
9811
+ let onePlusMaintenanceMarginPercentageString = undefined;
9812
+ let entryPriceSignString = entryPriceString;
9813
+ if (side === 'short') {
9814
+ onePlusMaintenanceMarginPercentageString = Precise["default"].stringSub('1', maintenanceMarginPercentageString);
9815
+ }
9816
+ else {
9817
+ onePlusMaintenanceMarginPercentageString = Precise["default"].stringSub('-1', maintenanceMarginPercentageString);
9818
+ entryPriceSignString = Precise["default"].stringMul('-1', entryPriceSignString);
9819
+ }
9820
+ const leftSide = Precise["default"].stringMul(contractsAbs, contractSizeString);
9821
+ const rightSide = Precise["default"].stringSub(Precise["default"].stringDiv('1', entryPriceSignString), Precise["default"].stringDiv(onePlusMaintenanceMarginPercentageString, liquidationPriceString));
9822
+ const basePrecision = this.precisionFromString(this.safeString(precision, 'base'));
9823
+ if (basePrecision !== undefined) {
9824
+ collateralString = Precise["default"].stringDiv(Precise["default"].stringMul(leftSide, rightSide), '1', basePrecision);
9825
+ }
9821
9826
  }
9822
9827
  }
9823
9828
  }
@@ -10449,9 +10454,10 @@ class binance extends binance$1 {
10449
10454
  //
10450
10455
  const result = [];
10451
10456
  for (let i = 0; i < response.length; i++) {
10452
- const parsed = this.parsePositionRisk(response[i]);
10453
- const entryPrice = this.safeString(parsed, 'entryPrice');
10457
+ const rawPosition = response[i];
10458
+ const entryPrice = this.safeString(rawPosition, 'entryPrice');
10454
10459
  if ((entryPrice !== '0') && (entryPrice !== '0.0') && (entryPrice !== '0.00000000')) {
10460
+ const parsed = this.parsePositionRisk(response[i]);
10455
10461
  result.push(parsed);
10456
10462
  }
10457
10463
  }
@@ -12172,6 +12178,9 @@ class binance extends binance$1 {
12172
12178
  const request = {};
12173
12179
  if (market['option']) {
12174
12180
  request['underlyingAsset'] = market['baseId'];
12181
+ if (market['expiry'] === undefined) {
12182
+ throw new errors.NotSupported(this.id + ' fetchOpenInterest does not support ' + symbol);
12183
+ }
12175
12184
  request['expiration'] = this.yymmdd(market['expiry']);
12176
12185
  }
12177
12186
  else {
@@ -12218,6 +12227,7 @@ class binance extends binance$1 {
12218
12227
  // ]
12219
12228
  //
12220
12229
  if (market['option']) {
12230
+ symbol = market['symbol'];
12221
12231
  const result = this.parseOpenInterests(response, market);
12222
12232
  for (let i = 0; i < result.length; i++) {
12223
12233
  const item = result[i];
@@ -519,37 +519,40 @@ class bingx extends bingx$1 {
519
519
  const response = await this.walletsV1PrivateGetCapitalConfigGetall(params);
520
520
  //
521
521
  // {
522
- // "code": 0,
523
- // "timestamp": 1688045966616,
524
- // "data": [
522
+ // "code": 0,
523
+ // "timestamp": 1702623271477,
524
+ // "data": [
525
+ // {
526
+ // "coin": "BTC",
527
+ // "name": "BTC",
528
+ // "networkList": [
525
529
  // {
526
- // "coin": "BTC",
527
530
  // "name": "BTC",
528
- // "networkList": [
529
- // {
530
- // "name": "BTC",
531
- // "network": "BTC",
532
- // "isDefault": true,
533
- // "minConfirm": "2",
534
- // "withdrawEnable": true,
535
- // "withdrawFee": "0.00035",
536
- // "withdrawMax": "1.62842",
537
- // "withdrawMin": "0.0005"
538
- // },
539
- // {
540
- // "name": "BTC",
541
- // "network": "BEP20",
542
- // "isDefault": false,
543
- // "minConfirm": "15",
544
- // "withdrawEnable": true,
545
- // "withdrawFee": "0.00001",
546
- // "withdrawMax": "1.62734",
547
- // "withdrawMin": "0.0001"
548
- // }
549
- // ]
550
- // },
551
- // ...
552
- // ],
531
+ // "network": "BTC",
532
+ // "isDefault": true,
533
+ // "minConfirm": 2,
534
+ // "withdrawEnable": true,
535
+ // "depositEnable": true,
536
+ // "withdrawFee": "0.0006",
537
+ // "withdrawMax": "1.17522",
538
+ // "withdrawMin": "0.0005",
539
+ // "depositMin": "0.0002"
540
+ // },
541
+ // {
542
+ // "name": "BTC",
543
+ // "network": "BEP20",
544
+ // "isDefault": false,
545
+ // "minConfirm": 15,
546
+ // "withdrawEnable": true,
547
+ // "depositEnable": true,
548
+ // "withdrawFee": "0.0000066",
549
+ // "withdrawMax": "1.17522",
550
+ // "withdrawMin": "0.0000066",
551
+ // "depositMin": "0.0002"
552
+ // }
553
+ // ]
554
+ // }
555
+ // ]
553
556
  // }
554
557
  //
555
558
  const data = this.safeList(response, 'data', []);
@@ -563,6 +566,7 @@ class bingx extends bingx$1 {
563
566
  const networks = {};
564
567
  let fee = undefined;
565
568
  let active = undefined;
569
+ let depositEnabled = undefined;
566
570
  let withdrawEnabled = undefined;
567
571
  let defaultLimits = {};
568
572
  for (let j = 0; j < networkList.length; j++) {
@@ -570,13 +574,17 @@ class bingx extends bingx$1 {
570
574
  const network = this.safeString(rawNetwork, 'network');
571
575
  const networkCode = this.networkIdToCode(network);
572
576
  const isDefault = this.safeBool(rawNetwork, 'isDefault');
577
+ depositEnabled = this.safeBool(rawNetwork, 'depositEnable');
573
578
  withdrawEnabled = this.safeBool(rawNetwork, 'withdrawEnable');
574
579
  const limits = {
575
- 'amounts': { 'min': this.safeNumber(rawNetwork, 'withdrawMin'), 'max': this.safeNumber(rawNetwork, 'withdrawMax') },
580
+ 'withdraw': {
581
+ 'min': this.safeNumber(rawNetwork, 'withdrawMin'),
582
+ 'max': this.safeNumber(rawNetwork, 'withdrawMax'),
583
+ },
576
584
  };
577
585
  if (isDefault) {
578
586
  fee = this.safeNumber(rawNetwork, 'withdrawFee');
579
- active = withdrawEnabled;
587
+ active = depositEnabled || withdrawEnabled;
580
588
  defaultLimits = limits;
581
589
  }
582
590
  networks[networkCode] = {
@@ -585,7 +593,7 @@ class bingx extends bingx$1 {
585
593
  'network': networkCode,
586
594
  'fee': fee,
587
595
  'active': active,
588
- 'deposit': undefined,
596
+ 'deposit': depositEnabled,
589
597
  'withdraw': withdrawEnabled,
590
598
  'precision': undefined,
591
599
  'limits': limits,
@@ -598,7 +606,7 @@ class bingx extends bingx$1 {
598
606
  'precision': undefined,
599
607
  'name': name,
600
608
  'active': active,
601
- 'deposit': undefined,
609
+ 'deposit': depositEnabled,
602
610
  'withdraw': withdrawEnabled,
603
611
  'networks': networks,
604
612
  'fee': fee,
@@ -6314,6 +6314,7 @@ class bybit extends bybit$1 {
6314
6314
  * @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
6315
6315
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
6316
6316
  */
6317
+ await this.loadMarkets();
6317
6318
  let symbol = undefined;
6318
6319
  if ((symbols !== undefined) && Array.isArray(symbols)) {
6319
6320
  const symbolsLength = symbols.length;
@@ -6329,7 +6330,6 @@ class bybit extends bybit$1 {
6329
6330
  symbol = symbols;
6330
6331
  symbols = [this.symbol(symbol)];
6331
6332
  }
6332
- await this.loadMarkets();
6333
6333
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
6334
6334
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
6335
6335
  const request = {};
@@ -263,7 +263,7 @@ class alpaca extends alpaca$1 {
263
263
  * @param {int} [since] the earliest time in ms to fetch orders for
264
264
  * @param {int} [limit] the maximum number of trade structures to retrieve
265
265
  * @param {object} [params] extra parameters specific to the exchange API endpoint
266
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
266
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
267
267
  */
268
268
  const url = this.urls['api']['ws']['crypto'];
269
269
  await this.authenticate(url);
@@ -316,7 +316,7 @@ class alpaca extends alpaca$1 {
316
316
  * @param {int} [limit] the maximum number of trade structures to retrieve
317
317
  * @param {object} [params] extra parameters specific to the exchange API endpoint
318
318
  * @param {boolean} [params.unifiedMargin] use unified margin account
319
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
319
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
320
320
  */
321
321
  const url = this.urls['api']['ws']['trading'];
322
322
  await this.authenticate(url);
@@ -347,7 +347,7 @@ class alpaca extends alpaca$1 {
347
347
  * @param {int} [since] the earliest time in ms to fetch orders for
348
348
  * @param {int} [limit] the maximum number of order structures to retrieve
349
349
  * @param {object} [params] extra parameters specific to the exchange API endpoint
350
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
350
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
351
351
  */
352
352
  const url = this.urls['api']['ws']['trading'];
353
353
  await this.authenticate(url);
@@ -711,10 +711,8 @@ class binance extends binance$1 {
711
711
  client.resolve(orderbook, messageHash);
712
712
  }
713
713
  async fetchOrderBookSnapshot(client, message, subscription) {
714
- const name = this.safeString(subscription, 'name');
715
714
  const symbol = this.safeString(subscription, 'symbol');
716
- const market = this.market(symbol);
717
- const messageHash = market['lowercaseId'] + '@' + name;
715
+ const messageHash = 'orderbook::' + symbol;
718
716
  try {
719
717
  const defaultLimit = this.safeInteger(this.options, 'watchOrderBookLimit', 1000);
720
718
  const type = this.safeValue(subscription, 'type');
@@ -3553,7 +3551,7 @@ class binance extends binance$1 {
3553
3551
  * @param {int} [limit] the maximum number of order structures to retrieve
3554
3552
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3555
3553
  * @param {boolean} [params.portfolioMargin] set to true if you would like to watch trades in a portfolio margin account
3556
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
3554
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3557
3555
  */
3558
3556
  await this.loadMarkets();
3559
3557
  let type = undefined;
@@ -441,7 +441,7 @@ class bingx extends bingx$1 {
441
441
  * @param {int} [since] the earliest time in ms to fetch orders for
442
442
  * @param {int} [limit] the maximum number of order structures to retrieve
443
443
  * @param {object} [params] extra parameters specific to the exchange API endpoint
444
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
444
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
445
445
  */
446
446
  await this.loadMarkets();
447
447
  const market = this.market(symbol);
@@ -888,7 +888,7 @@ class bingx extends bingx$1 {
888
888
  * @param {int} [since] the earliest time in ms to trades orders for
889
889
  * @param {int} [limit] the maximum number of trades structures to retrieve
890
890
  * @param {object} [params] extra parameters specific to the exchange API endpoint
891
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
891
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
892
892
  */
893
893
  await this.loadMarkets();
894
894
  await this.authenticate();
@@ -210,7 +210,7 @@ class bitfinex2 extends bitfinex2$1 {
210
210
  * @param {int} [since] the earliest time in ms to fetch trades for
211
211
  * @param {int} [limit] the maximum number of trade structures to retrieve
212
212
  * @param {object} [params] extra parameters specific to the exchange API endpoint
213
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
213
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
214
214
  */
215
215
  await this.loadMarkets();
216
216
  let messageHash = 'myTrade';
@@ -891,7 +891,7 @@ class bitfinex2 extends bitfinex2$1 {
891
891
  * @param {int} [since] the earliest time in ms to fetch orders for
892
892
  * @param {int} [limit] the maximum number of order structures to retrieve
893
893
  * @param {object} [params] extra parameters specific to the exchange API endpoint
894
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
894
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
895
895
  */
896
896
  await this.loadMarkets();
897
897
  let messageHash = 'orders';
@@ -969,7 +969,7 @@ class bitget extends bitget$1 {
969
969
  * @param {string} [params.marginMode] 'isolated' or 'cross' for watching spot margin orders]
970
970
  * @param {string} [params.type] 'spot', 'swap'
971
971
  * @param {string} [params.subType] 'linear', 'inverse'
972
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
972
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
973
973
  */
974
974
  await this.loadMarkets();
975
975
  let market = undefined;
@@ -1144,7 +1144,7 @@ class bitmex extends bitmex$1 {
1144
1144
  * @param {int} [since] the earliest time in ms to fetch trades for
1145
1145
  * @param {int} [limit] the maximum number of trade structures to retrieve
1146
1146
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1147
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
1147
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
1148
1148
  */
1149
1149
  await this.loadMarkets();
1150
1150
  await this.authenticate();
@@ -184,7 +184,7 @@ class bitopro extends bitopro$1 {
184
184
  * @param {int} [since] the earliest time in ms to fetch trades for
185
185
  * @param {int} [limit] the maximum number of trade structures to retrieve
186
186
  * @param {object} [params] extra parameters specific to the exchange API endpoint
187
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
187
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
188
188
  */
189
189
  this.checkRequiredCredentials();
190
190
  await this.loadMarkets();
@@ -760,7 +760,7 @@ class bybit extends bybit$1 {
760
760
  * @param {int} [since] the earliest time in ms to fetch trades for
761
761
  * @param {int} [limit] the maximum number of trade structures to retrieve
762
762
  * @param {object} [params] extra parameters specific to the exchange API endpoint
763
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
763
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
764
764
  */
765
765
  return await this.watchTradesForSymbols([symbol], since, limit, params);
766
766
  }
@@ -937,7 +937,7 @@ class bybit extends bybit$1 {
937
937
  * @param {int} [limit] the maximum number of order structures to retrieve
938
938
  * @param {object} [params] extra parameters specific to the exchange API endpoint
939
939
  * @param {boolean} [params.unifiedMargin] use unified margin account
940
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
940
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
941
941
  */
942
942
  const method = 'watchMyTrades';
943
943
  let messageHash = 'myTrades';
@@ -1254,7 +1254,7 @@ class bybit extends bybit$1 {
1254
1254
  const rawLiquidation = this.safeDict(message, 'data', {});
1255
1255
  const marketId = this.safeString(rawLiquidation, 'symbol');
1256
1256
  const market = this.safeMarket(marketId, undefined, '', 'contract');
1257
- const symbol = this.safeSymbol(marketId);
1257
+ const symbol = market['symbol'];
1258
1258
  const liquidation = this.parseWsLiquidation(rawLiquidation, market);
1259
1259
  let liquidations = this.safeValue(this.liquidations, symbol);
1260
1260
  if (liquidations === undefined) {
@@ -1281,7 +1281,7 @@ class bybit extends bybit$1 {
1281
1281
  const timestamp = this.safeInteger(liquidation, 'updatedTime');
1282
1282
  return this.safeLiquidation({
1283
1283
  'info': liquidation,
1284
- 'symbol': this.safeSymbol(marketId, market),
1284
+ 'symbol': market['symbol'],
1285
1285
  'contracts': this.safeNumber(liquidation, 'size'),
1286
1286
  'contractSize': this.safeNumber(market, 'contractSize'),
1287
1287
  'price': this.safeNumber(liquidation, 'price'),
@@ -1301,7 +1301,7 @@ class bybit extends bybit$1 {
1301
1301
  * @param {int} [since] the earliest time in ms to fetch orders for
1302
1302
  * @param {int} [limit] the maximum number of order structures to retrieve
1303
1303
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1304
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
1304
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1305
1305
  */
1306
1306
  await this.loadMarkets();
1307
1307
  const method = 'watchOrders';
@@ -198,7 +198,7 @@ class coinbaseexchange extends coinbaseexchange$1 {
198
198
  * @param {int} [since] the earliest time in ms to fetch trades for
199
199
  * @param {int} [limit] the maximum number of trade structures to retrieve
200
200
  * @param {object} [params] extra parameters specific to the exchange API endpoint
201
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
201
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
202
202
  */
203
203
  if (symbol === undefined) {
204
204
  throw new errors.ArgumentsRequired(this.id + ' watchMyTrades() requires a symbol argument');
@@ -223,7 +223,7 @@ class coinbaseexchange extends coinbaseexchange$1 {
223
223
  * @param {int} [since] the earliest time in ms to fetch trades for
224
224
  * @param {int} [limit] the maximum number of trade structures to retrieve
225
225
  * @param {object} [params] extra parameters specific to the exchange API endpoint
226
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
226
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
227
227
  */
228
228
  symbols = this.marketSymbols(symbols, undefined, false);
229
229
  await this.loadMarkets();
@@ -111,7 +111,7 @@ class coincheck extends coincheck$1 {
111
111
  * @param {int} [since] the earliest time in ms to fetch trades for
112
112
  * @param {int} [limit] the maximum number of trade structures to retrieve
113
113
  * @param {object} [params] extra parameters specific to the exchange API endpoint
114
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
114
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
115
115
  */
116
116
  await this.loadMarkets();
117
117
  const market = this.market(symbol);
@@ -254,7 +254,7 @@ class coinone extends coinone$1 {
254
254
  * @param {int} [since] the earliest time in ms to fetch trades for
255
255
  * @param {int} [limit] the maximum number of trade structures to retrieve
256
256
  * @param {object} [params] extra parameters specific to the exchange API endpoint
257
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
257
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
258
258
  */
259
259
  await this.loadMarkets();
260
260
  const market = this.market(symbol);
@@ -327,7 +327,7 @@ class cryptocom extends cryptocom$1 {
327
327
  * @param {int} [since] the earliest time in ms to fetch trades for
328
328
  * @param {int} [limit] the maximum number of trade structures to retrieve
329
329
  * @param {object} [params] extra parameters specific to the exchange API endpoint
330
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
330
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
331
331
  */
332
332
  await this.loadMarkets();
333
333
  let market = undefined;
@@ -561,7 +561,7 @@ class deribit extends deribit$1 {
561
561
  * @param {int} [since] the earliest time in ms to fetch orders for
562
562
  * @param {int} [limit] the maximum number of order structures to retrieve
563
563
  * @param {object} [params] extra parameters specific to the exchange API endpoint
564
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
564
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
565
565
  */
566
566
  await this.loadMarkets();
567
567
  await this.authenticate(params);
@@ -842,7 +842,7 @@ class gate extends gate$1 {
842
842
  * @param {int} [since] the earliest time in ms to fetch trades for
843
843
  * @param {int} [limit] the maximum number of trade structures to retrieve
844
844
  * @param {object} [params] extra parameters specific to the exchange API endpoint
845
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
845
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
846
846
  */
847
847
  await this.loadMarkets();
848
848
  let subType = undefined;
@@ -1190,7 +1190,7 @@ class gate extends gate$1 {
1190
1190
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1191
1191
  * @param {string} [params.type] spot, margin, swap, future, or option. Required if listening to all symbols.
1192
1192
  * @param {boolean} [params.isInverse] if future, listen to inverse or linear contracts
1193
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
1193
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1194
1194
  */
1195
1195
  await this.loadMarkets();
1196
1196
  let market = undefined;
@@ -173,7 +173,7 @@ class hollaex extends hollaex$1 {
173
173
  * @param {int} [since] the earliest time in ms to fetch trades for
174
174
  * @param {int} [limit] the maximum number of trade structures to retrieve
175
175
  * @param {object} [params] extra parameters specific to the exchange API endpoint
176
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
176
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
177
177
  */
178
178
  await this.loadMarkets();
179
179
  let messageHash = 'usertrade';
@@ -668,7 +668,7 @@ class htx extends htx$1 {
668
668
  * @param {int} [since] the earliest time in ms to fetch trades for
669
669
  * @param {int} [limit] the maximum number of trade structures to retrieve
670
670
  * @param {object} [params] extra parameters specific to the exchange API endpoint
671
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
671
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
672
672
  */
673
673
  this.checkRequiredCredentials();
674
674
  await this.loadMarkets();
@@ -128,7 +128,7 @@ class hyperliquid extends hyperliquid$1 {
128
128
  * @param {int} [limit] the maximum number of order structures to retrieve
129
129
  * @param {object} [params] extra parameters specific to the exchange API endpoint
130
130
  * @param {string} [params.user] user address, will default to this.walletAddress if not provided
131
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
131
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
132
132
  */
133
133
  let userAddress = undefined;
134
134
  [userAddress, params] = this.handlePublicAddress('watchMyTrades', params);
@@ -219,7 +219,7 @@ class hyperliquid extends hyperliquid$1 {
219
219
  * @param {int} [since] the earliest time in ms to fetch trades for
220
220
  * @param {int} [limit] the maximum number of trade structures to retrieve
221
221
  * @param {object} [params] extra parameters specific to the exchange API endpoint
222
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
222
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
223
223
  */
224
224
  await this.loadMarkets();
225
225
  const market = this.market(symbol);
@@ -419,7 +419,7 @@ class hyperliquid extends hyperliquid$1 {
419
419
  * @param {int} [limit] the maximum number of order structures to retrieve
420
420
  * @param {object} [params] extra parameters specific to the exchange API endpoint
421
421
  * @param {string} [params.user] user address, will default to this.walletAddress if not provided
422
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
422
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
423
423
  */
424
424
  await this.loadMarkets();
425
425
  let userAddress = undefined;
@@ -881,7 +881,7 @@ class kraken extends kraken$1 {
881
881
  * @param {int} [since] the earliest time in ms to fetch trades for
882
882
  * @param {int} [limit] the maximum number of trade structures to retrieve
883
883
  * @param {object} [params] extra parameters specific to the exchange API endpoint
884
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
884
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
885
885
  */
886
886
  return await this.watchPrivate('ownTrades', symbol, since, limit, params);
887
887
  }
@@ -987,7 +987,7 @@ 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);
@@ -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;