ccxt 4.2.70 → 4.2.72

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 (50) hide show
  1. package/README.md +4 -4
  2. package/build.sh +1 -1
  3. package/dist/ccxt.browser.js +979 -195
  4. package/dist/ccxt.browser.min.js +2 -2
  5. package/dist/cjs/ccxt.js +3 -1
  6. package/dist/cjs/src/ascendex.js +149 -2
  7. package/dist/cjs/src/bitget.js +14 -6
  8. package/dist/cjs/src/coinbase.js +108 -89
  9. package/dist/cjs/src/digifinex.js +2 -1
  10. package/dist/cjs/src/hyperliquid.js +1 -1
  11. package/dist/cjs/src/kraken.js +1 -0
  12. package/dist/cjs/src/mexc.js +9 -0
  13. package/dist/cjs/src/pro/bingx.js +29 -6
  14. package/dist/cjs/src/pro/hitbtc.js +16 -7
  15. package/dist/cjs/src/pro/hyperliquid.js +556 -0
  16. package/js/ccxt.d.ts +4 -1
  17. package/js/ccxt.js +3 -1
  18. package/js/src/abstract/coinbase.d.ts +2 -0
  19. package/js/src/ascendex.d.ts +5 -1
  20. package/js/src/ascendex.js +149 -2
  21. package/js/src/base/Exchange.d.ts +56 -56
  22. package/js/src/base/types.d.ts +58 -48
  23. package/js/src/binance.d.ts +1 -1
  24. package/js/src/bitfinex2.d.ts +1 -1
  25. package/js/src/bitget.js +14 -6
  26. package/js/src/bitrue.d.ts +3 -3
  27. package/js/src/cex.d.ts +1 -1
  28. package/js/src/coinbase.d.ts +1 -1
  29. package/js/src/coinbase.js +108 -89
  30. package/js/src/digifinex.js +2 -1
  31. package/js/src/gate.d.ts +1 -1
  32. package/js/src/htx.d.ts +1 -1
  33. package/js/src/hyperliquid.js +1 -1
  34. package/js/src/idex.d.ts +1 -1
  35. package/js/src/kraken.js +1 -0
  36. package/js/src/kucoinfutures.d.ts +1 -1
  37. package/js/src/mexc.js +9 -0
  38. package/js/src/poloniexfutures.d.ts +2 -2
  39. package/js/src/pro/bingx.d.ts +1 -0
  40. package/js/src/pro/bingx.js +29 -6
  41. package/js/src/pro/bitvavo.d.ts +8 -8
  42. package/js/src/pro/bybit.d.ts +1 -1
  43. package/js/src/pro/cex.d.ts +5 -5
  44. package/js/src/pro/coinbase.d.ts +2 -2
  45. package/js/src/pro/hitbtc.js +16 -7
  46. package/js/src/pro/hyperliquid.d.ts +23 -0
  47. package/js/src/pro/hyperliquid.js +557 -0
  48. package/js/src/pro/poloniex.d.ts +3 -3
  49. package/package.json +1 -1
  50. package/skip-tests.json +33 -58
@@ -3713,9 +3713,11 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
3713
3713
  'fetchFundingRateHistory': false,
3714
3714
  'fetchFundingRates': true,
3715
3715
  'fetchIndexOHLCV': false,
3716
- 'fetchLeverage': false,
3716
+ 'fetchLeverage': 'emulated',
3717
+ 'fetchLeverages': true,
3717
3718
  'fetchLeverageTiers': true,
3718
- 'fetchMarginMode': false,
3719
+ 'fetchMarginMode': 'emulated',
3720
+ 'fetchMarginModes': true,
3719
3721
  'fetchMarketLeverageTiers': 'emulated',
3720
3722
  'fetchMarkets': true,
3721
3723
  'fetchMarkOHLCV': false,
@@ -6931,6 +6933,151 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
6931
6933
  'amount': this.safeNumber(income, 'paymentInUSDT'),
6932
6934
  };
6933
6935
  }
6936
+ async fetchMarginModes(symbols = undefined, params = {}) {
6937
+ /**
6938
+ * @method
6939
+ * @name ascendex#fetchMarginMode
6940
+ * @description fetches the set margin mode of the user
6941
+ * @see https://ascendex.github.io/ascendex-futures-pro-api-v2/#position
6942
+ * @param {string[]} [symbols] a list of unified market symbols
6943
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
6944
+ * @returns {object} a list of [margin mode structures]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
6945
+ */
6946
+ await this.loadMarkets();
6947
+ await this.loadAccounts();
6948
+ const account = this.safeValue(this.accounts, 0, {});
6949
+ const accountGroup = this.safeString(account, 'id');
6950
+ const request = {
6951
+ 'account-group': accountGroup,
6952
+ };
6953
+ const response = await this.v2PrivateAccountGroupGetFuturesPosition(this.extend(request, params));
6954
+ //
6955
+ // {
6956
+ // "code": 0,
6957
+ // "data": {
6958
+ // "accountId": "fut2ODPhGiY71Pl4vtXnOZ00ssgD7QGn",
6959
+ // "ac": "FUTURES",
6960
+ // "collaterals": [
6961
+ // {
6962
+ // "asset": "USDT",
6963
+ // "balance": "44.570287262",
6964
+ // "referencePrice": "1",
6965
+ // "discountFactor": "1"
6966
+ // }
6967
+ // ],
6968
+ // "contracts": [
6969
+ // {
6970
+ // "symbol": "BTC-PERP",
6971
+ // "side": "LONG",
6972
+ // "position": "0.0001",
6973
+ // "referenceCost": "-3.12277254",
6974
+ // "unrealizedPnl": "-0.001700233",
6975
+ // "realizedPnl": "0",
6976
+ // "avgOpenPrice": "31209",
6977
+ // "marginType": "isolated",
6978
+ // "isolatedMargin": "1.654972977",
6979
+ // "leverage": "2",
6980
+ // "takeProfitPrice": "0",
6981
+ // "takeProfitTrigger": "market",
6982
+ // "stopLossPrice": "0",
6983
+ // "stopLossTrigger": "market",
6984
+ // "buyOpenOrderNotional": "0",
6985
+ // "sellOpenOrderNotional": "0",
6986
+ // "markPrice": "31210.723063672",
6987
+ // "indexPrice": "31223.148857925"
6988
+ // },
6989
+ // ]
6990
+ // }
6991
+ // }
6992
+ //
6993
+ const data = this.safeDict(response, 'data', {});
6994
+ const marginModes = this.safeList(data, 'contracts', []);
6995
+ return this.parseMarginModes(marginModes, symbols, 'symbol');
6996
+ }
6997
+ parseMarginMode(marginMode, market = undefined) {
6998
+ const marketId = this.safeString(marginMode, 'symbol');
6999
+ const marginType = this.safeString(marginMode, 'marginType');
7000
+ const margin = (marginType === 'crossed') ? 'cross' : 'isolated';
7001
+ return {
7002
+ 'info': marginMode,
7003
+ 'symbol': this.safeSymbol(marketId, market),
7004
+ 'marginMode': margin,
7005
+ };
7006
+ }
7007
+ async fetchLeverages(symbols = undefined, params = {}) {
7008
+ /**
7009
+ * @method
7010
+ * @name ascendex#fetchLeverages
7011
+ * @description fetch the set leverage for all contract markets
7012
+ * @see https://ascendex.github.io/ascendex-futures-pro-api-v2/#position
7013
+ * @param {string[]} [symbols] a list of unified market symbols
7014
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7015
+ * @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
7016
+ */
7017
+ await this.loadMarkets();
7018
+ await this.loadAccounts();
7019
+ const account = this.safeValue(this.accounts, 0, {});
7020
+ const accountGroup = this.safeString(account, 'id');
7021
+ const request = {
7022
+ 'account-group': accountGroup,
7023
+ };
7024
+ const response = await this.v2PrivateAccountGroupGetFuturesPosition(this.extend(request, params));
7025
+ //
7026
+ // {
7027
+ // "code": 0,
7028
+ // "data": {
7029
+ // "accountId": "fut2ODPhGiY71Pl4vtXnOZ00ssgD7QGn",
7030
+ // "ac": "FUTURES",
7031
+ // "collaterals": [
7032
+ // {
7033
+ // "asset": "USDT",
7034
+ // "balance": "44.570287262",
7035
+ // "referencePrice": "1",
7036
+ // "discountFactor": "1"
7037
+ // }
7038
+ // ],
7039
+ // "contracts": [
7040
+ // {
7041
+ // "symbol": "BTC-PERP",
7042
+ // "side": "LONG",
7043
+ // "position": "0.0001",
7044
+ // "referenceCost": "-3.12277254",
7045
+ // "unrealizedPnl": "-0.001700233",
7046
+ // "realizedPnl": "0",
7047
+ // "avgOpenPrice": "31209",
7048
+ // "marginType": "isolated",
7049
+ // "isolatedMargin": "1.654972977",
7050
+ // "leverage": "2",
7051
+ // "takeProfitPrice": "0",
7052
+ // "takeProfitTrigger": "market",
7053
+ // "stopLossPrice": "0",
7054
+ // "stopLossTrigger": "market",
7055
+ // "buyOpenOrderNotional": "0",
7056
+ // "sellOpenOrderNotional": "0",
7057
+ // "markPrice": "31210.723063672",
7058
+ // "indexPrice": "31223.148857925"
7059
+ // },
7060
+ // ]
7061
+ // }
7062
+ // }
7063
+ //
7064
+ const data = this.safeDict(response, 'data', {});
7065
+ const leverages = this.safeList(data, 'contracts', []);
7066
+ return this.parseLeverages(leverages, symbols, 'symbol');
7067
+ }
7068
+ parseLeverage(leverage, market = undefined) {
7069
+ const marketId = this.safeString(leverage, 'symbol');
7070
+ const leverageValue = this.safeInteger(leverage, 'leverage');
7071
+ const marginType = this.safeString(leverage, 'marginType');
7072
+ const marginMode = (marginType === 'crossed') ? 'cross' : 'isolated';
7073
+ return {
7074
+ 'info': leverage,
7075
+ 'symbol': this.safeSymbol(marketId, market),
7076
+ 'marginMode': marginMode,
7077
+ 'longLeverage': leverageValue,
7078
+ 'shortLeverage': leverageValue,
7079
+ };
7080
+ }
6934
7081
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
6935
7082
  const version = api[0];
6936
7083
  const access = api[1];
@@ -51217,11 +51364,13 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
51217
51364
  * @description fetch all open positions
51218
51365
  * @see https://www.bitget.com/api-doc/contract/position/get-all-position
51219
51366
  * @see https://www.bitget.com/api-doc/contract/position/Get-History-Position
51220
- * @param {string[]|undefined} symbols list of unified market symbols
51367
+ * @param {string[]} [symbols] list of unified market symbols
51221
51368
  * @param {object} [params] extra parameters specific to the exchange API endpoint
51222
51369
  * @param {string} [params.marginCoin] the settle currency of the positions, needs to match the productType
51223
51370
  * @param {string} [params.productType] 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
51224
51371
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
51372
+ * @param {boolean} [params.useHistoryEndpoint] default false, when true will use the historic endpoint to fetch positions
51373
+ * @param {string} [params.method] either (default) 'privateMixGetV2MixPositionAllPosition' or 'privateMixGetV2MixPositionHistoryPosition'
51225
51374
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
51226
51375
  */
51227
51376
  await this.loadMarkets();
@@ -51230,8 +51379,14 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
51230
51379
  if (paginate) {
51231
51380
  return await this.fetchPaginatedCallCursor('fetchPositions', undefined, undefined, undefined, params, 'endId', 'idLessThan');
51232
51381
  }
51233
- const fetchPositionsOptions = this.safeValue(this.options, 'fetchPositions', {});
51234
- const method = this.safeString(fetchPositionsOptions, 'method', 'privateMixGetV2MixPositionAllPosition');
51382
+ let method = undefined;
51383
+ const useHistoryEndpoint = this.safeBool(params, 'useHistoryEndpoint', false);
51384
+ if (useHistoryEndpoint) {
51385
+ method = 'privateMixGetV2MixPositionHistoryPosition';
51386
+ }
51387
+ else {
51388
+ [method, params] = this.handleOptionAndParams(params, 'fetchPositions', 'method', 'privateMixGetV2MixPositionAllPosition');
51389
+ }
51235
51390
  let market = undefined;
51236
51391
  if (symbols !== undefined) {
51237
51392
  const first = this.safeString(symbols, 0);
@@ -51347,11 +51502,11 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
51347
51502
  //
51348
51503
  let position = [];
51349
51504
  if (!isHistory) {
51350
- position = this.safeValue(response, 'data', []);
51505
+ position = this.safeList(response, 'data', []);
51351
51506
  }
51352
51507
  else {
51353
- const data = this.safeValue(response, 'data', {});
51354
- position = this.safeValue(data, 'list', []);
51508
+ const data = this.safeDict(response, 'data', {});
51509
+ position = this.safeList(data, 'list', []);
51355
51510
  }
51356
51511
  const result = [];
51357
51512
  for (let i = 0; i < position.length; i++) {
@@ -93276,6 +93431,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93276
93431
  'brokerage/intx/portfolio/{portfolio_uuid}': 1,
93277
93432
  'brokerage/intx/positions/{portfolio_uuid}': 1,
93278
93433
  'brokerage/intx/positions/{portfolio_uuid}/{symbol}': 1,
93434
+ 'brokerage/payment_methods': 1,
93435
+ 'brokerage/payment_methods/{payment_method_id}': 1,
93279
93436
  },
93280
93437
  'post': {
93281
93438
  'brokerage/orders': 1,
@@ -93428,7 +93585,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93428
93585
  // }
93429
93586
  // }
93430
93587
  //
93431
- response = this.safeValue(response, 'data', {});
93588
+ response = this.safeDict(response, 'data', {});
93432
93589
  }
93433
93590
  else {
93434
93591
  response = await this.v3PublicGetBrokerageTime(params);
@@ -93520,7 +93677,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93520
93677
  const accounts = this.safeList(response, 'data', []);
93521
93678
  const length = accounts.length;
93522
93679
  const lastIndex = length - 1;
93523
- const last = this.safeValue(accounts, lastIndex);
93680
+ const last = this.safeDict(accounts, lastIndex);
93524
93681
  if ((cursor !== undefined) && (cursor !== '')) {
93525
93682
  last['next_starting_after'] = cursor;
93526
93683
  accounts[lastIndex] = last;
@@ -93571,7 +93728,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93571
93728
  const accounts = this.safeList(response, 'accounts', []);
93572
93729
  const length = accounts.length;
93573
93730
  const lastIndex = length - 1;
93574
- const last = this.safeValue(accounts, lastIndex);
93731
+ const last = this.safeDict(accounts, lastIndex);
93575
93732
  const cursor = this.safeString(response, 'cursor');
93576
93733
  if ((cursor !== undefined) && (cursor !== '')) {
93577
93734
  last['cursor'] = cursor;
@@ -93635,9 +93792,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93635
93792
  // }
93636
93793
  // }
93637
93794
  //
93638
- const active = this.safeValue(account, 'active');
93795
+ const active = this.safeBool(account, 'active');
93639
93796
  const currencyIdV3 = this.safeString(account, 'currency');
93640
- const currency = this.safeValue(account, 'currency', {});
93797
+ const currency = this.safeDict(account, 'currency', {});
93641
93798
  const currencyId = this.safeString(currency, 'code', currencyIdV3);
93642
93799
  const typeV3 = this.safeString(account, 'name');
93643
93800
  const typeV2 = this.safeString(account, 'type');
@@ -93714,7 +93871,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93714
93871
  // }
93715
93872
  // }
93716
93873
  //
93717
- const data = this.safeValue(response, 'data', {});
93874
+ const data = this.safeDict(response, 'data', {});
93718
93875
  const tag = this.safeString(data, 'destination_tag');
93719
93876
  const address = this.safeString(data, 'address');
93720
93877
  return {
@@ -93928,24 +94085,24 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93928
94085
  let amountAndCurrencyObject = undefined;
93929
94086
  let feeObject = undefined;
93930
94087
  if (transactionType === 'send') {
93931
- const network = this.safeValue(transaction, 'network', {});
93932
- amountAndCurrencyObject = this.safeValue(network, 'transaction_amount', {});
93933
- feeObject = this.safeValue(network, 'transaction_fee', {});
94088
+ const network = this.safeDict(transaction, 'network', {});
94089
+ amountAndCurrencyObject = this.safeDict(network, 'transaction_amount', {});
94090
+ feeObject = this.safeDict(network, 'transaction_fee', {});
93934
94091
  }
93935
94092
  else {
93936
- amountAndCurrencyObject = this.safeValue(transaction, 'subtotal', {});
93937
- feeObject = this.safeValue(transaction, 'fee', {});
94093
+ amountAndCurrencyObject = this.safeDict(transaction, 'subtotal', {});
94094
+ feeObject = this.safeDict(transaction, 'fee', {});
93938
94095
  }
93939
94096
  let status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
93940
94097
  if (status === undefined) {
93941
- const committed = this.safeValue(transaction, 'committed');
94098
+ const committed = this.safeBool(transaction, 'committed');
93942
94099
  status = committed ? 'ok' : 'pending';
93943
94100
  }
93944
94101
  const id = this.safeString(transaction, 'id');
93945
94102
  const currencyId = this.safeString(amountAndCurrencyObject, 'currency');
93946
94103
  const feeCurrencyId = this.safeString(feeObject, 'currency');
93947
- const datetime = this.safeValue(transaction, 'created_at');
93948
- const toObject = this.safeValue(transaction, 'to', {});
94104
+ const datetime = this.safeString(transaction, 'created_at');
94105
+ const toObject = this.safeDict(transaction, 'to', {});
93949
94106
  const toAddress = this.safeString(toObject, 'address');
93950
94107
  return {
93951
94108
  'info': transaction,
@@ -93964,7 +94121,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93964
94121
  'amount': this.safeNumber(amountAndCurrencyObject, 'amount'),
93965
94122
  'currency': this.safeCurrencyCode(currencyId, currency),
93966
94123
  'status': status,
93967
- 'updated': this.parse8601(this.safeValue(transaction, 'updated_at')),
94124
+ 'updated': this.parse8601(this.safeString(transaction, 'updated_at')),
93968
94125
  'fee': {
93969
94126
  'cost': this.safeNumber(feeObject, 'amount'),
93970
94127
  'currency': this.safeCurrencyCode(feeCurrencyId),
@@ -94034,10 +94191,10 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94034
94191
  // }
94035
94192
  //
94036
94193
  let symbol = undefined;
94037
- const totalObject = this.safeValue(trade, 'total', {});
94038
- const amountObject = this.safeValue(trade, 'amount', {});
94039
- const subtotalObject = this.safeValue(trade, 'subtotal', {});
94040
- const feeObject = this.safeValue(trade, 'fee', {});
94194
+ const totalObject = this.safeDict(trade, 'total', {});
94195
+ const amountObject = this.safeDict(trade, 'amount', {});
94196
+ const subtotalObject = this.safeDict(trade, 'subtotal', {});
94197
+ const feeObject = this.safeDict(trade, 'fee', {});
94041
94198
  const marketId = this.safeString(trade, 'product_id');
94042
94199
  market = this.safeMarket(marketId, market, '-');
94043
94200
  if (market !== undefined) {
@@ -94052,7 +94209,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94052
94209
  symbol = base + '/' + quote;
94053
94210
  }
94054
94211
  }
94055
- const sizeInQuote = this.safeValue(trade, 'size_in_quote');
94212
+ const sizeInQuote = this.safeBool(trade, 'size_in_quote');
94056
94213
  const v3Price = this.safeString(trade, 'price');
94057
94214
  let v3Cost = undefined;
94058
94215
  let v3Amount = this.safeString(trade, 'size');
@@ -94121,11 +94278,11 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94121
94278
  }
94122
94279
  async fetchMarketsV2(params = {}) {
94123
94280
  const response = await this.fetchCurrenciesFromCache(params);
94124
- const currencies = this.safeValue(response, 'currencies', {});
94125
- const exchangeRates = this.safeValue(response, 'exchangeRates', {});
94126
- const data = this.safeValue(currencies, 'data', []);
94281
+ const currencies = this.safeDict(response, 'currencies', {});
94282
+ const exchangeRates = this.safeDict(response, 'exchangeRates', {});
94283
+ const data = this.safeList(currencies, 'data', []);
94127
94284
  const dataById = this.indexBy(data, 'id');
94128
- const rates = this.safeValue(this.safeValue(exchangeRates, 'data', {}), 'rates', {});
94285
+ const rates = this.safeDict(this.safeDict(exchangeRates, 'data', {}), 'rates', {});
94129
94286
  const baseIds = Object.keys(rates);
94130
94287
  const result = [];
94131
94288
  for (let i = 0; i < baseIds.length; i++) {
@@ -94247,8 +94404,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94247
94404
  // "coinbase_pro_fees": 0
94248
94405
  // }
94249
94406
  //
94250
- const feeTier = this.safeValue(fees, 'fee_tier', {});
94251
- const data = this.safeValue(response, 'products', []);
94407
+ const feeTier = this.safeDict(fees, 'fee_tier', {});
94408
+ const data = this.safeList(response, 'products', []);
94252
94409
  const result = [];
94253
94410
  for (let i = 0; i < data.length; i++) {
94254
94411
  const market = data[i];
@@ -94258,8 +94415,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94258
94415
  const base = this.safeCurrencyCode(baseId);
94259
94416
  const quote = this.safeCurrencyCode(quoteId);
94260
94417
  const marketType = this.safeStringLower(market, 'product_type');
94261
- const tradingDisabled = this.safeValue(market, 'trading_disabled');
94262
- const stablePairs = this.safeValue(this.options, 'stablePairs', []);
94418
+ const tradingDisabled = this.safeBool(market, 'trading_disabled');
94419
+ const stablePairs = this.safeList(this.options, 'stablePairs', []);
94263
94420
  result.push({
94264
94421
  'id': id,
94265
94422
  'symbol': base + '/' + quote,
@@ -94315,7 +94472,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94315
94472
  return result;
94316
94473
  }
94317
94474
  async fetchCurrenciesFromCache(params = {}) {
94318
- const options = this.safeValue(this.options, 'fetchCurrencies', {});
94475
+ const options = this.safeDict(this.options, 'fetchCurrencies', {});
94319
94476
  const timestamp = this.safeInteger(options, 'timestamp');
94320
94477
  const expires = this.safeInteger(options, 'expires', 1000);
94321
94478
  const now = this.milliseconds();
@@ -94371,7 +94528,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94371
94528
  * @returns {object} an associative dictionary of currencies
94372
94529
  */
94373
94530
  const response = await this.fetchCurrenciesFromCache(params);
94374
- const currencies = this.safeValue(response, 'currencies', {});
94531
+ const currencies = this.safeDict(response, 'currencies', {});
94375
94532
  //
94376
94533
  // fiat
94377
94534
  //
@@ -94488,8 +94645,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94488
94645
  // }
94489
94646
  // }
94490
94647
  //
94491
- const data = this.safeValue(response, 'data', {});
94492
- const rates = this.safeValue(data, 'rates', {});
94648
+ const data = this.safeDict(response, 'data', {});
94649
+ const rates = this.safeDict(data, 'rates', {});
94493
94650
  const quoteId = this.safeString(data, 'currency');
94494
94651
  const result = {};
94495
94652
  const baseIds = Object.keys(rates);
@@ -94548,7 +94705,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94548
94705
  // "num_products": 549
94549
94706
  // }
94550
94707
  //
94551
- const data = this.safeValue(response, 'products', []);
94708
+ const data = this.safeList(response, 'products', []);
94552
94709
  const result = {};
94553
94710
  for (let i = 0; i < data.length; i++) {
94554
94711
  const entry = data[i];
@@ -94596,9 +94753,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94596
94753
  //
94597
94754
  // {"data":{"base":"BTC","currency":"USD","amount":"48691.23"}}
94598
94755
  //
94599
- const spotData = this.safeValue(spot, 'data', {});
94600
- const askData = this.safeValue(ask, 'data', {});
94601
- const bidData = this.safeValue(bid, 'data', {});
94756
+ const spotData = this.safeDict(spot, 'data', {});
94757
+ const askData = this.safeDict(ask, 'data', {});
94758
+ const bidData = this.safeDict(bid, 'data', {});
94602
94759
  const bidAskLast = {
94603
94760
  'bid': this.safeNumber(bidData, 'amount'),
94604
94761
  'ask': this.safeNumber(askData, 'amount'),
@@ -94632,7 +94789,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94632
94789
  // "best_ask": "28208.62"
94633
94790
  // }
94634
94791
  //
94635
- const data = this.safeValue(response, 'trades', []);
94792
+ const data = this.safeList(response, 'trades', []);
94636
94793
  const ticker = this.parseTicker(data[0], market);
94637
94794
  ticker['bid'] = this.safeNumber(response, 'best_bid');
94638
94795
  ticker['ask'] = this.safeNumber(response, 'best_ask');
@@ -94724,8 +94881,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94724
94881
  let bidVolume = undefined;
94725
94882
  let askVolume = undefined;
94726
94883
  if (('bids' in ticker)) {
94727
- const bids = this.safeValue(ticker, 'bids', []);
94728
- const asks = this.safeValue(ticker, 'asks', []);
94884
+ const bids = this.safeList(ticker, 'bids', []);
94885
+ const asks = this.safeList(ticker, 'asks', []);
94729
94886
  bid = this.safeNumber(bids[0], 'price');
94730
94887
  bidVolume = this.safeNumber(bids[0], 'size');
94731
94888
  ask = this.safeNumber(asks[0], 'price');
@@ -94758,21 +94915,21 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94758
94915
  }, market);
94759
94916
  }
94760
94917
  parseCustomBalance(response, params = {}) {
94761
- const balances = this.safeValue2(response, 'data', 'accounts', []);
94762
- const accounts = this.safeValue(params, 'type', this.options['accounts']);
94763
- const v3Accounts = this.safeValue(params, 'type', this.options['v3Accounts']);
94918
+ const balances = this.safeList2(response, 'data', 'accounts', []);
94919
+ const accounts = this.safeList(params, 'type', this.options['accounts']);
94920
+ const v3Accounts = this.safeList(params, 'type', this.options['v3Accounts']);
94764
94921
  const result = { 'info': response };
94765
94922
  for (let b = 0; b < balances.length; b++) {
94766
94923
  const balance = balances[b];
94767
94924
  const type = this.safeString(balance, 'type');
94768
94925
  if (this.inArray(type, accounts)) {
94769
- const value = this.safeValue(balance, 'balance');
94926
+ const value = this.safeDict(balance, 'balance');
94770
94927
  if (value !== undefined) {
94771
94928
  const currencyId = this.safeString(value, 'currency');
94772
94929
  const code = this.safeCurrencyCode(currencyId);
94773
94930
  const total = this.safeString(value, 'amount');
94774
94931
  const free = total;
94775
- let account = this.safeValue(result, code);
94932
+ let account = this.safeDict(result, code);
94776
94933
  if (account === undefined) {
94777
94934
  account = this.account();
94778
94935
  account['free'] = free;
@@ -94786,15 +94943,15 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94786
94943
  }
94787
94944
  }
94788
94945
  else if (this.inArray(type, v3Accounts)) {
94789
- const available = this.safeValue(balance, 'available_balance');
94790
- const hold = this.safeValue(balance, 'hold');
94946
+ const available = this.safeDict(balance, 'available_balance');
94947
+ const hold = this.safeDict(balance, 'hold');
94791
94948
  if (available !== undefined && hold !== undefined) {
94792
94949
  const currencyId = this.safeString(available, 'currency');
94793
94950
  const code = this.safeCurrencyCode(currencyId);
94794
94951
  const used = this.safeString(hold, 'value');
94795
94952
  const free = this.safeString(available, 'value');
94796
94953
  const total = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(used, free);
94797
- let account = this.safeValue(result, code);
94954
+ let account = this.safeDict(result, code);
94798
94955
  if (account === undefined) {
94799
94956
  account = this.account();
94800
94957
  account['free'] = free;
@@ -95202,7 +95359,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95202
95359
  // }
95203
95360
  // }
95204
95361
  //
95205
- const amountInfo = this.safeValue(item, 'amount', {});
95362
+ const amountInfo = this.safeDict(item, 'amount', {});
95206
95363
  let amount = this.safeString(amountInfo, 'amount');
95207
95364
  let direction = undefined;
95208
95365
  if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(amount, '0')) {
@@ -95224,9 +95381,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95224
95381
  // let txid = undefined;
95225
95382
  //
95226
95383
  let fee = undefined;
95227
- const networkInfo = this.safeValue(item, 'network', {});
95384
+ const networkInfo = this.safeDict(item, 'network', {});
95228
95385
  // txid = network['hash']; // txid does not belong to the unified ledger structure
95229
- const feeInfo = this.safeValue(networkInfo, 'transaction_fee');
95386
+ const feeInfo = this.safeDict(networkInfo, 'transaction_fee');
95230
95387
  if (feeInfo !== undefined) {
95231
95388
  const feeCurrencyId = this.safeString(feeInfo, 'currency');
95232
95389
  const feeCurrencyCode = this.safeCurrencyCode(feeCurrencyId, currency);
@@ -95236,7 +95393,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95236
95393
  'currency': feeCurrencyCode,
95237
95394
  };
95238
95395
  }
95239
- const timestamp = this.parse8601(this.safeValue(item, 'created_at'));
95396
+ const timestamp = this.parse8601(this.safeString(item, 'created_at'));
95240
95397
  const id = this.safeString(item, 'id');
95241
95398
  const type = this.parseLedgerEntryType(this.safeString(item, 'type'));
95242
95399
  const status = this.parseLedgerEntryStatus(this.safeString(item, 'status'));
@@ -95368,7 +95525,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95368
95525
  const isStopLoss = stopLossPrice !== undefined;
95369
95526
  const isTakeProfit = takeProfitPrice !== undefined;
95370
95527
  const timeInForce = this.safeString(params, 'timeInForce');
95371
- const postOnly = (timeInForce === 'PO') ? true : this.safeValue2(params, 'postOnly', 'post_only', false);
95528
+ const postOnly = (timeInForce === 'PO') ? true : this.safeBool2(params, 'postOnly', 'post_only', false);
95372
95529
  const endTime = this.safeString(params, 'end_time');
95373
95530
  let stopDirection = this.safeString(params, 'stop_direction');
95374
95531
  if (type === 'limit') {
@@ -95438,6 +95595,14 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95438
95595
  },
95439
95596
  };
95440
95597
  }
95598
+ else if (timeInForce === 'IOC') {
95599
+ request['order_configuration'] = {
95600
+ 'sor_limit_ioc': {
95601
+ 'base_size': this.amountToPrecision(symbol, amount),
95602
+ 'limit_price': this.priceToPrecision(symbol, price),
95603
+ },
95604
+ };
95605
+ }
95441
95606
  else {
95442
95607
  request['order_configuration'] = {
95443
95608
  'limit_limit_gtc': {
@@ -95491,7 +95656,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95491
95656
  }
95492
95657
  }
95493
95658
  params = this.omit(params, ['timeInForce', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'stopPrice', 'stop_price', 'stopDirection', 'stop_direction', 'clientOrderId', 'postOnly', 'post_only', 'end_time']);
95494
- const preview = this.safeValue2(params, 'preview', 'test', false);
95659
+ const preview = this.safeBool2(params, 'preview', 'test', false);
95495
95660
  let response = undefined;
95496
95661
  if (preview) {
95497
95662
  params = this.omit(params, ['preview', 'test']);
@@ -95538,9 +95703,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95538
95703
  // }
95539
95704
  // }
95540
95705
  //
95541
- const success = this.safeValue(response, 'success');
95706
+ const success = this.safeBool(response, 'success');
95542
95707
  if (success !== true) {
95543
- const errorResponse = this.safeValue(response, 'error_response');
95708
+ const errorResponse = this.safeDict(response, 'error_response');
95544
95709
  const errorTitle = this.safeString(errorResponse, 'error');
95545
95710
  const errorMessage = this.safeString(errorResponse, 'message');
95546
95711
  if (errorResponse !== undefined) {
@@ -95549,7 +95714,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95549
95714
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(errorMessage);
95550
95715
  }
95551
95716
  }
95552
- const data = this.safeValue(response, 'success_response', {});
95717
+ const data = this.safeDict(response, 'success_response', {});
95553
95718
  return this.parseOrder(data, market);
95554
95719
  }
95555
95720
  parseOrder(order, market = undefined) {
@@ -95620,29 +95785,39 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95620
95785
  if (symbol !== undefined) {
95621
95786
  market = this.market(symbol);
95622
95787
  }
95623
- const orderConfiguration = this.safeValue(order, 'order_configuration', {});
95624
- const limitGTC = this.safeValue(orderConfiguration, 'limit_limit_gtc');
95625
- const limitGTD = this.safeValue(orderConfiguration, 'limit_limit_gtd');
95626
- const stopLimitGTC = this.safeValue(orderConfiguration, 'stop_limit_stop_limit_gtc');
95627
- const stopLimitGTD = this.safeValue(orderConfiguration, 'stop_limit_stop_limit_gtd');
95628
- const marketIOC = this.safeValue(orderConfiguration, 'market_market_ioc');
95629
- const isLimit = ((limitGTC !== undefined) || (limitGTD !== undefined));
95788
+ const orderConfiguration = this.safeDict(order, 'order_configuration', {});
95789
+ const limitGTC = this.safeDict(orderConfiguration, 'limit_limit_gtc');
95790
+ const limitGTD = this.safeDict(orderConfiguration, 'limit_limit_gtd');
95791
+ const limitIOC = this.safeDict(orderConfiguration, 'sor_limit_ioc');
95792
+ const stopLimitGTC = this.safeDict(orderConfiguration, 'stop_limit_stop_limit_gtc');
95793
+ const stopLimitGTD = this.safeDict(orderConfiguration, 'stop_limit_stop_limit_gtd');
95794
+ const marketIOC = this.safeDict(orderConfiguration, 'market_market_ioc');
95795
+ const isLimit = ((limitGTC !== undefined) || (limitGTD !== undefined) || (limitIOC !== undefined));
95630
95796
  const isStop = ((stopLimitGTC !== undefined) || (stopLimitGTD !== undefined));
95631
95797
  let price = undefined;
95632
95798
  let amount = undefined;
95633
95799
  let postOnly = undefined;
95634
95800
  let triggerPrice = undefined;
95635
95801
  if (isLimit) {
95636
- const target = (limitGTC !== undefined) ? limitGTC : limitGTD;
95802
+ let target = undefined;
95803
+ if (limitGTC !== undefined) {
95804
+ target = limitGTC;
95805
+ }
95806
+ else if (limitGTD !== undefined) {
95807
+ target = limitGTD;
95808
+ }
95809
+ else {
95810
+ target = limitIOC;
95811
+ }
95637
95812
  price = this.safeString(target, 'limit_price');
95638
95813
  amount = this.safeString(target, 'base_size');
95639
- postOnly = this.safeValue(target, 'post_only');
95814
+ postOnly = this.safeBool(target, 'post_only');
95640
95815
  }
95641
95816
  else if (isStop) {
95642
95817
  const stopTarget = (stopLimitGTC !== undefined) ? stopLimitGTC : stopLimitGTD;
95643
95818
  price = this.safeString(stopTarget, 'limit_price');
95644
95819
  amount = this.safeString(stopTarget, 'base_size');
95645
- postOnly = this.safeValue(stopTarget, 'post_only');
95820
+ postOnly = this.safeBool(stopTarget, 'post_only');
95646
95821
  triggerPrice = this.safeString(stopTarget, 'stop_price');
95647
95822
  }
95648
95823
  else {
@@ -95728,7 +95903,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95728
95903
  */
95729
95904
  await this.loadMarkets();
95730
95905
  const orders = await this.cancelOrders([id], symbol, params);
95731
- return this.safeValue(orders, 0, {});
95906
+ return this.safeDict(orders, 0, {});
95732
95907
  }
95733
95908
  async cancelOrders(ids, symbol = undefined, params = {}) {
95734
95909
  /**
@@ -95761,9 +95936,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95761
95936
  // ]
95762
95937
  // }
95763
95938
  //
95764
- const orders = this.safeValue(response, 'results', []);
95939
+ const orders = this.safeList(response, 'results', []);
95765
95940
  for (let i = 0; i < orders.length; i++) {
95766
- const success = this.safeValue(orders[i], 'success');
95941
+ const success = this.safeBool(orders[i], 'success');
95767
95942
  if (success !== true) {
95768
95943
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' cancelOrders() has failed, check your arguments and parameters');
95769
95944
  }
@@ -95797,7 +95972,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95797
95972
  if (price !== undefined) {
95798
95973
  request['price'] = this.priceToPrecision(symbol, price);
95799
95974
  }
95800
- const preview = this.safeValue2(params, 'preview', 'test', false);
95975
+ const preview = this.safeBool2(params, 'preview', 'test', false);
95801
95976
  let response = undefined;
95802
95977
  if (preview) {
95803
95978
  params = this.omit(params, ['preview', 'test']);
@@ -95876,7 +96051,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95876
96051
  // }
95877
96052
  // }
95878
96053
  //
95879
- const order = this.safeValue(response, 'order', {});
96054
+ const order = this.safeDict(response, 'order', {});
95880
96055
  return this.parseOrder(order, market);
95881
96056
  }
95882
96057
  async fetchOrders(symbol = undefined, since = undefined, limit = 100, params = {}) {
@@ -95913,7 +96088,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95913
96088
  if (since !== undefined) {
95914
96089
  request['start_date'] = this.iso8601(since);
95915
96090
  }
95916
- const until = this.safeValueN(params, ['until', 'till']);
96091
+ const until = this.safeIntegerN(params, ['until', 'till']);
95917
96092
  if (until !== undefined) {
95918
96093
  params = this.omit(params, ['until', 'till']);
95919
96094
  request['end_date'] = this.iso8601(until);
@@ -95961,8 +96136,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95961
96136
  // "cursor": ""
95962
96137
  // }
95963
96138
  //
95964
- const orders = this.safeValue(response, 'orders', []);
95965
- const first = this.safeValue(orders, 0);
96139
+ const orders = this.safeList(response, 'orders', []);
96140
+ const first = this.safeDict(orders, 0);
95966
96141
  const cursor = this.safeString(response, 'cursor');
95967
96142
  if ((cursor !== undefined) && (cursor !== '')) {
95968
96143
  first['cursor'] = cursor;
@@ -95989,7 +96164,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95989
96164
  if (since !== undefined) {
95990
96165
  request['start_date'] = this.iso8601(since);
95991
96166
  }
95992
- const until = this.safeValueN(params, ['until', 'till']);
96167
+ const until = this.safeIntegerN(params, ['until', 'till']);
95993
96168
  if (until !== undefined) {
95994
96169
  params = this.omit(params, ['until', 'till']);
95995
96170
  request['end_date'] = this.iso8601(until);
@@ -96037,8 +96212,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
96037
96212
  // "cursor": ""
96038
96213
  // }
96039
96214
  //
96040
- const orders = this.safeValue(response, 'orders', []);
96041
- const first = this.safeValue(orders, 0);
96215
+ const orders = this.safeList(response, 'orders', []);
96216
+ const first = this.safeDict(orders, 0);
96042
96217
  const cursor = this.safeString(response, 'cursor');
96043
96218
  if ((cursor !== undefined) && (cursor !== '')) {
96044
96219
  first['cursor'] = cursor;
@@ -96132,7 +96307,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
96132
96307
  'product_id': market['id'],
96133
96308
  'granularity': this.safeString(this.timeframes, timeframe, timeframe),
96134
96309
  };
96135
- const until = this.safeValueN(params, ['until', 'till', 'end']);
96310
+ const until = this.safeIntegerN(params, ['until', 'till', 'end']);
96136
96311
  params = this.omit(params, ['until', 'till']);
96137
96312
  const duration = this.parseTimeframe(timeframe);
96138
96313
  const requestedDuration = limit * duration;
@@ -96166,7 +96341,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
96166
96341
  // ]
96167
96342
  // }
96168
96343
  //
96169
- const candles = this.safeValue(response, 'candles', []);
96344
+ const candles = this.safeList(response, 'candles', []);
96170
96345
  return this.parseOHLCVs(candles, market, timeframe, since, limit);
96171
96346
  }
96172
96347
  parseOHLCV(ohlcv, market = undefined) {
@@ -96239,7 +96414,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
96239
96414
  // ]
96240
96415
  // }
96241
96416
  //
96242
- const trades = this.safeValue(response, 'trades', []);
96417
+ const trades = this.safeList(response, 'trades', []);
96243
96418
  return this.parseTrades(trades, market, since, limit);
96244
96419
  }
96245
96420
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -96276,7 +96451,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
96276
96451
  if (since !== undefined) {
96277
96452
  request['start_sequence_timestamp'] = this.iso8601(since);
96278
96453
  }
96279
- const until = this.safeValueN(params, ['until', 'till']);
96454
+ const until = this.safeIntegerN(params, ['until', 'till']);
96280
96455
  if (until !== undefined) {
96281
96456
  params = this.omit(params, ['until', 'till']);
96282
96457
  request['end_sequence_timestamp'] = this.iso8601(until);
@@ -96305,8 +96480,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
96305
96480
  // "cursor": ""
96306
96481
  // }
96307
96482
  //
96308
- const trades = this.safeValue(response, 'fills', []);
96309
- const first = this.safeValue(trades, 0);
96483
+ const trades = this.safeList(response, 'fills', []);
96484
+ const first = this.safeDict(trades, 0);
96310
96485
  const cursor = this.safeString(response, 'cursor');
96311
96486
  if ((cursor !== undefined) && (cursor !== '')) {
96312
96487
  first['cursor'] = cursor;
@@ -96398,7 +96573,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
96398
96573
  // ]
96399
96574
  // }
96400
96575
  //
96401
- const tickers = this.safeValue(response, 'pricebooks', []);
96576
+ const tickers = this.safeList(response, 'pricebooks', []);
96402
96577
  return this.parseTickers(tickers, symbols);
96403
96578
  }
96404
96579
  async withdraw(code, amount, address, tag = undefined, params = {}) {
@@ -96492,7 +96667,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
96492
96667
  // }
96493
96668
  // }
96494
96669
  //
96495
- const data = this.safeValue(response, 'data', {});
96670
+ const data = this.safeDict(response, 'data', {});
96496
96671
  return this.parseTransaction(data, currency);
96497
96672
  }
96498
96673
  async fetchDepositAddressesByNetwork(code, params = {}) {
@@ -96765,7 +96940,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
96765
96940
  // }
96766
96941
  // }
96767
96942
  //
96768
- const data = this.safeValue(response, 'data', {});
96943
+ const data = this.safeDict(response, 'data', {});
96769
96944
  return this.parseTransaction(data);
96770
96945
  }
96771
96946
  sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
@@ -96865,7 +97040,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
96865
97040
  this.throwBroadlyMatchedException(this.exceptions['broad'], errorMessage, feedback);
96866
97041
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(feedback);
96867
97042
  }
96868
- const errors = this.safeValue(response, 'errors');
97043
+ const errors = this.safeList(response, 'errors');
96869
97044
  if (errors !== undefined) {
96870
97045
  if (Array.isArray(errors)) {
96871
97046
  const numErrors = errors.length;
@@ -96881,8 +97056,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
96881
97056
  }
96882
97057
  }
96883
97058
  const advancedTrade = this.options['advanced'];
96884
- const data = this.safeValue(response, 'data');
96885
- if ((data === undefined) && (!advancedTrade)) {
97059
+ if (!('data' in response) && (!advancedTrade)) {
96886
97060
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' failed due to a malformed response ' + this.json(response));
96887
97061
  }
96888
97062
  return undefined;
@@ -127783,7 +127957,8 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
127783
127957
  else if (limit !== undefined) {
127784
127958
  const endTime = this.seconds();
127785
127959
  const duration = this.parseTimeframe(timeframe);
127786
- request['start_time'] = this.sum(endTime, -limit * duration);
127960
+ const auxLimit = limit; // in c# -limit is mutating the arg
127961
+ request['start_time'] = this.sum(endTime, -auxLimit * duration);
127787
127962
  }
127788
127963
  response = await this.publicSpotGetKline(this.extend(request, params));
127789
127964
  }
@@ -159290,7 +159465,7 @@ class hyperliquid extends _abstract_hyperliquid_js__WEBPACK_IMPORTED_MODULE_0__/
159290
159465
  'version': 'v1',
159291
159466
  'rateLimit': 50,
159292
159467
  'certified': false,
159293
- 'pro': false,
159468
+ 'pro': true,
159294
159469
  'has': {
159295
159470
  'CORS': undefined,
159296
159471
  'spot': false,
@@ -166606,6 +166781,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
166606
166781
  const lastTrade = trades[length - 1];
166607
166782
  const lastTradeId = this.safeString(result, 'last');
166608
166783
  lastTrade.push(lastTradeId);
166784
+ trades[length - 1] = lastTrade;
166609
166785
  return this.parseTrades(trades, market, since, limit);
166610
166786
  }
166611
166787
  parseBalance(response) {
@@ -188069,6 +188245,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
188069
188245
  'createMarketSellOrderWithCost': false,
188070
188246
  'createOrder': true,
188071
188247
  'createOrders': true,
188248
+ 'createPostOnlyOrder': true,
188072
188249
  'createReduceOnlyOrder': true,
188073
188250
  'deposit': undefined,
188074
188251
  'editOrder': undefined,
@@ -190235,6 +190412,14 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190235
190412
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190236
190413
  * @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
190237
190414
  * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
190415
+ * @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
190416
+ * @param {bool} [params.reduceOnly] *contract only* indicates if this order is to reduce the size of a position
190417
+ *
190418
+ * EXCHANGE SPECIFIC PARAMETERS
190419
+ * @param {int} [params.leverage] *contract only* leverage is necessary on isolated margin
190420
+ * @param {long} [params.positionId] *contract only* it is recommended to fill in this parameter when closing a position
190421
+ * @param {string} [params.externalOid] *contract only* external order ID
190422
+ * @param {int} [params.positionMode] *contract only* 1:hedge, 2:one-way, default: the user's current config
190238
190423
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
190239
190424
  */
190240
190425
  await this.loadMarkets();
@@ -227758,21 +227943,44 @@ class bingx extends _bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
227758
227943
  }
227759
227944
  return true;
227760
227945
  }
227761
- async authenticate(params = {}) {
227762
- const time = this.milliseconds();
227946
+ async keepAliveListenKey(params = {}) {
227763
227947
  const listenKey = this.safeString(this.options, 'listenKey');
227764
227948
  if (listenKey === undefined) {
227765
- const response = await this.userAuthPrivatePostUserDataStream();
227766
- this.options['listenKey'] = this.safeString(response, 'listenKey');
227767
- this.options['lastAuthenticatedTime'] = time;
227949
+ // A network error happened: we can't renew a listen key that does not exist.
227950
+ return;
227951
+ }
227952
+ try {
227953
+ await this.userAuthPrivatePutUserDataStream({ 'listenKey': listenKey }); // extend the expiry
227954
+ }
227955
+ catch (error) {
227956
+ const types = ['spot', 'swap'];
227957
+ for (let i = 0; i < types.length; i++) {
227958
+ const type = types[i];
227959
+ const url = this.urls['api']['ws'][type] + '?listenKey=' + listenKey;
227960
+ const client = this.client(url);
227961
+ const messageHashes = Object.keys(client.futures);
227962
+ for (let j = 0; j < messageHashes.length; j++) {
227963
+ const messageHash = messageHashes[j];
227964
+ client.reject(error, messageHash);
227965
+ }
227966
+ }
227967
+ this.options['listenKey'] = undefined;
227968
+ this.options['lastAuthenticatedTime'] = 0;
227768
227969
  return;
227769
227970
  }
227971
+ // whether or not to schedule another listenKey keepAlive request
227972
+ const listenKeyRefreshRate = this.safeInteger(this.options, 'listenKeyRefreshRate', 3600000);
227973
+ this.delay(listenKeyRefreshRate, this.keepAliveListenKey, params);
227974
+ }
227975
+ async authenticate(params = {}) {
227976
+ const time = this.milliseconds();
227770
227977
  const lastAuthenticatedTime = this.safeInteger(this.options, 'lastAuthenticatedTime', 0);
227771
227978
  const listenKeyRefreshRate = this.safeInteger(this.options, 'listenKeyRefreshRate', 3600000); // 1 hour
227772
227979
  if (time - lastAuthenticatedTime > listenKeyRefreshRate) {
227773
- const response = await this.userAuthPrivatePutUserDataStream({ 'listenKey': listenKey }); // extend the expiry
227980
+ const response = await this.userAuthPrivatePostUserDataStream();
227774
227981
  this.options['listenKey'] = this.safeString(response, 'listenKey');
227775
227982
  this.options['lastAuthenticatedTime'] = time;
227983
+ this.delay(listenKeyRefreshRate, this.keepAliveListenKey, params);
227776
227984
  }
227777
227985
  }
227778
227986
  async pong(client, message) {
@@ -251096,7 +251304,10 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
251096
251304
  // }
251097
251305
  // }
251098
251306
  //
251099
- const data = this.safeValue2(message, 'snapshot', 'update', {});
251307
+ const snapshot = this.safeDict(message, 'snapshot');
251308
+ const update = this.safeDict(message, 'update');
251309
+ const data = snapshot ? snapshot : update;
251310
+ const type = snapshot ? 'snapshot' : 'update';
251100
251311
  const marketIds = Object.keys(data);
251101
251312
  for (let i = 0; i < marketIds.length; i++) {
251102
251313
  const marketId = marketIds[i];
@@ -251105,17 +251316,23 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
251105
251316
  const item = data[marketId];
251106
251317
  const messageHash = 'orderbooks::' + symbol;
251107
251318
  if (!(symbol in this.orderbooks)) {
251108
- const subscription = this.safeValue(client.subscriptions, messageHash, {});
251319
+ const subscription = this.safeDict(client.subscriptions, messageHash, {});
251109
251320
  const limit = this.safeInteger(subscription, 'limit');
251110
251321
  this.orderbooks[symbol] = this.orderBook({}, limit);
251111
251322
  }
251323
+ const orderbook = this.orderbooks[symbol];
251112
251324
  const timestamp = this.safeInteger(item, 't');
251113
251325
  const nonce = this.safeInteger(item, 's');
251114
- const orderbook = this.orderbooks[symbol];
251115
- const asks = this.safeValue(item, 'a', []);
251116
- const bids = this.safeValue(item, 'b', []);
251117
- this.handleDeltas(orderbook['asks'], asks);
251118
- this.handleDeltas(orderbook['bids'], bids);
251326
+ if (type === 'snapshot') {
251327
+ const parsedSnapshot = this.parseOrderBook(item, symbol, timestamp, 'b', 'a');
251328
+ orderbook.reset(parsedSnapshot);
251329
+ }
251330
+ else {
251331
+ const asks = this.safeList(item, 'a', []);
251332
+ const bids = this.safeList(item, 'b', []);
251333
+ this.handleDeltas(orderbook['asks'], asks);
251334
+ this.handleDeltas(orderbook['bids'], bids);
251335
+ }
251119
251336
  orderbook['timestamp'] = timestamp;
251120
251337
  orderbook['datetime'] = this.iso8601(timestamp);
251121
251338
  orderbook['nonce'] = nonce;
@@ -255780,6 +255997,570 @@ class huobijp extends _huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
255780
255997
  }
255781
255998
 
255782
255999
 
256000
+ /***/ }),
256001
+
256002
+ /***/ 8354:
256003
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
256004
+
256005
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
256006
+ /* harmony export */ Z: () => (/* binding */ hyperliquid)
256007
+ /* harmony export */ });
256008
+ /* harmony import */ var _hyperliquid_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5959);
256009
+ /* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
256010
+ /* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3020);
256011
+ // ---------------------------------------------------------------------------
256012
+
256013
+
256014
+
256015
+ // ---------------------------------------------------------------------------
256016
+ class hyperliquid extends _hyperliquid_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
256017
+ describe() {
256018
+ return this.deepExtend(super.describe(), {
256019
+ 'has': {
256020
+ 'ws': true,
256021
+ 'watchBalance': false,
256022
+ 'watchMyTrades': true,
256023
+ 'watchOHLCV': true,
256024
+ 'watchOrderBook': true,
256025
+ 'watchOrders': true,
256026
+ 'watchTicker': false,
256027
+ 'watchTickers': false,
256028
+ 'watchTrades': true,
256029
+ 'watchPosition': false,
256030
+ },
256031
+ 'urls': {
256032
+ 'api': {
256033
+ 'ws': {
256034
+ 'public': 'wss://api.hyperliquid.xyz/ws',
256035
+ },
256036
+ },
256037
+ 'test': {
256038
+ 'ws': {
256039
+ 'public': 'wss://api.hyperliquid-testnet.xyz/ws',
256040
+ },
256041
+ },
256042
+ },
256043
+ 'options': {},
256044
+ 'streaming': {
256045
+ 'ping': this.ping,
256046
+ 'keepAlive': 20000,
256047
+ },
256048
+ 'exceptions': {
256049
+ 'ws': {
256050
+ 'exact': {},
256051
+ },
256052
+ },
256053
+ });
256054
+ }
256055
+ async watchOrderBook(symbol, limit = undefined, params = {}) {
256056
+ /**
256057
+ * @method
256058
+ * @name hyperliquid#watchOrderBook
256059
+ * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
256060
+ * @param {string} symbol unified symbol of the market to fetch the order book for
256061
+ * @param {int} [limit] the maximum amount of order book entries to return
256062
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
256063
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
256064
+ */
256065
+ await this.loadMarkets();
256066
+ const market = this.market(symbol);
256067
+ symbol = market['symbol'];
256068
+ const messageHash = 'orderbook:' + symbol;
256069
+ const url = this.urls['api']['ws']['public'];
256070
+ const request = {
256071
+ 'method': 'subscribe',
256072
+ 'subscription': {
256073
+ 'type': 'l2Book',
256074
+ 'coin': market['base'],
256075
+ },
256076
+ };
256077
+ const message = this.extend(request, params);
256078
+ const orderbook = await this.watch(url, messageHash, message, messageHash);
256079
+ return orderbook.limit();
256080
+ }
256081
+ handleOrderBook(client, message) {
256082
+ //
256083
+ // {
256084
+ // "channel": "l2Book",
256085
+ // "data": {
256086
+ // "coin": "BTC",
256087
+ // "time": 1710131872708,
256088
+ // "levels": [
256089
+ // [
256090
+ // {
256091
+ // "px": "68674.0",
256092
+ // "sz": "0.97139",
256093
+ // "n": 4
256094
+ // }
256095
+ // ],
256096
+ // [
256097
+ // {
256098
+ // "px": "68675.0",
256099
+ // "sz": "0.04396",
256100
+ // "n": 1
256101
+ // }
256102
+ // ]
256103
+ // ]
256104
+ // }
256105
+ // }
256106
+ //
256107
+ const entry = this.safeDict(message, 'data', {});
256108
+ const coin = this.safeString(entry, 'coin');
256109
+ const marketId = coin + '/USDC:USDC';
256110
+ const market = this.market(marketId);
256111
+ const symbol = market['symbol'];
256112
+ const rawData = this.safeList(entry, 'levels', []);
256113
+ const data = {
256114
+ 'bids': this.safeList(rawData, 0, []),
256115
+ 'asks': this.safeList(rawData, 1, []),
256116
+ };
256117
+ const timestamp = this.safeInteger(entry, 'time');
256118
+ const snapshot = this.parseOrderBook(data, symbol, timestamp, 'bids', 'asks', 'px', 'sz');
256119
+ if (!(symbol in this.orderbooks)) {
256120
+ const ob = this.orderBook(snapshot);
256121
+ this.orderbooks[symbol] = ob;
256122
+ }
256123
+ const orderbook = this.orderbooks[symbol];
256124
+ orderbook.reset(snapshot);
256125
+ const messageHash = 'orderbook:' + symbol;
256126
+ client.resolve(orderbook, messageHash);
256127
+ }
256128
+ async watchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
256129
+ /**
256130
+ * @method
256131
+ * @name hyperliquid#watchMyTrades
256132
+ * @description watches information on multiple trades made by the user
256133
+ * @param {string} symbol unified market symbol of the market orders were made in
256134
+ * @param {int} [since] the earliest time in ms to fetch orders for
256135
+ * @param {int} [limit] the maximum number of order structures to retrieve
256136
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
256137
+ * @param {string} [params.user] user address, will default to this.walletAddress if not provided
256138
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
256139
+ */
256140
+ let userAddress = undefined;
256141
+ [userAddress, params] = this.handlePublicAddress('watchMyTrades', params);
256142
+ await this.loadMarkets();
256143
+ let messageHash = 'myTrades';
256144
+ if (symbol !== undefined) {
256145
+ symbol = this.symbol(symbol);
256146
+ messageHash += ':' + symbol;
256147
+ }
256148
+ const url = this.urls['api']['ws']['public'];
256149
+ const request = {
256150
+ 'method': 'subscribe',
256151
+ 'subscription': {
256152
+ 'type': 'userFills',
256153
+ 'user': userAddress,
256154
+ },
256155
+ };
256156
+ const message = this.extend(request, params);
256157
+ const trades = await this.watch(url, messageHash, message, messageHash);
256158
+ if (this.newUpdates) {
256159
+ limit = trades.getLimit(symbol, limit);
256160
+ }
256161
+ return this.filterBySymbolSinceLimit(trades, symbol, since, limit, true);
256162
+ }
256163
+ handleMyTrades(client, message) {
256164
+ //
256165
+ // {
256166
+ // "channel": "userFills",
256167
+ // "data": {
256168
+ // "isSnapshot": true,
256169
+ // "user": "0x15f43d1f2dee81424afd891943262aa90f22cc2a",
256170
+ // "fills": [
256171
+ // {
256172
+ // "coin": "BTC",
256173
+ // "px": "72528.0",
256174
+ // "sz": "0.11693",
256175
+ // "side": "A",
256176
+ // "time": 1710208712815,
256177
+ // "startPosition": "0.11693",
256178
+ // "dir": "Close Long",
256179
+ // "closedPnl": "-0.81851",
256180
+ // "hash": "0xc5adaf35f8402750c218040b0a7bc301130051521273b6f398b3caad3e1f3f5f",
256181
+ // "oid": 7484888874,
256182
+ // "crossed": true,
256183
+ // "fee": "2.968244",
256184
+ // "liquidationMarkPx": null,
256185
+ // "tid": 567547935839686,
256186
+ // "cloid": null
256187
+ // }
256188
+ // ]
256189
+ // }
256190
+ // }
256191
+ //
256192
+ const entry = this.safeDict(message, 'data', {});
256193
+ if (this.myTrades === undefined) {
256194
+ const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
256195
+ this.myTrades = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCacheBySymbolById */ .hl(limit);
256196
+ }
256197
+ const trades = this.myTrades;
256198
+ const symbols = {};
256199
+ const data = this.safeList(entry, 'fills', []);
256200
+ const dataLength = data.length;
256201
+ if (dataLength === 0) {
256202
+ return;
256203
+ }
256204
+ for (let i = 0; i < data.length; i++) {
256205
+ const rawTrade = data[i];
256206
+ const parsed = this.parseWsTrade(rawTrade);
256207
+ const symbol = parsed['symbol'];
256208
+ symbols[symbol] = true;
256209
+ trades.append(parsed);
256210
+ }
256211
+ const keys = Object.keys(symbols);
256212
+ for (let i = 0; i < keys.length; i++) {
256213
+ const currentMessageHash = 'myTrades:' + keys[i];
256214
+ client.resolve(trades, currentMessageHash);
256215
+ }
256216
+ // non-symbol specific
256217
+ const messageHash = 'myTrades';
256218
+ client.resolve(trades, messageHash);
256219
+ }
256220
+ async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
256221
+ /**
256222
+ * @method
256223
+ * @name hyperliquid#watchTrades
256224
+ * @description watches information on multiple trades made in a market
256225
+ * @param {string} symbol unified market symbol of the market trades were made in
256226
+ * @param {int} [since] the earliest time in ms to fetch trades for
256227
+ * @param {int} [limit] the maximum number of trade structures to retrieve
256228
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
256229
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
256230
+ */
256231
+ await this.loadMarkets();
256232
+ const market = this.market(symbol);
256233
+ symbol = market['symbol'];
256234
+ const messageHash = 'trade:' + symbol;
256235
+ const url = this.urls['api']['ws']['public'];
256236
+ const request = {
256237
+ 'method': 'subscribe',
256238
+ 'subscription': {
256239
+ 'type': 'trades',
256240
+ 'coin': market['base'],
256241
+ },
256242
+ };
256243
+ const message = this.extend(request, params);
256244
+ const trades = await this.watch(url, messageHash, message, messageHash);
256245
+ if (this.newUpdates) {
256246
+ limit = trades.getLimit(symbol, limit);
256247
+ }
256248
+ return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
256249
+ }
256250
+ handleTrades(client, message) {
256251
+ //
256252
+ // {
256253
+ // "channel": "trades",
256254
+ // "data": [
256255
+ // {
256256
+ // "coin": "BTC",
256257
+ // "side": "A",
256258
+ // "px": "68517.0",
256259
+ // "sz": "0.005",
256260
+ // "time": 1710125266669,
256261
+ // "hash": "0xc872699f116e012186620407fc08a802015e0097c5cce74710697f7272e6e959",
256262
+ // "tid": 981894269203506
256263
+ // }
256264
+ // ]
256265
+ // }
256266
+ //
256267
+ const entry = this.safeList(message, 'data', []);
256268
+ const first = this.safeDict(entry, 0, {});
256269
+ const coin = this.safeString(first, 'coin');
256270
+ const marketId = coin + '/USDC:USDC';
256271
+ const market = this.market(marketId);
256272
+ const symbol = market['symbol'];
256273
+ if (!(symbol in this.trades)) {
256274
+ const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
256275
+ const stored = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCache */ .ZL(limit);
256276
+ this.trades[symbol] = stored;
256277
+ }
256278
+ const trades = this.trades[symbol];
256279
+ for (let i = 0; i < entry.length; i++) {
256280
+ const data = this.safeDict(entry, i);
256281
+ const trade = this.parseWsTrade(data);
256282
+ trades.append(trade);
256283
+ }
256284
+ const messageHash = 'trade:' + symbol;
256285
+ client.resolve(trades, messageHash);
256286
+ }
256287
+ parseWsTrade(trade, market = undefined) {
256288
+ //
256289
+ // fetchMyTrades
256290
+ //
256291
+ // {
256292
+ // "coin": "BTC",
256293
+ // "px": "72528.0",
256294
+ // "sz": "0.11693",
256295
+ // "side": "A",
256296
+ // "time": 1710208712815,
256297
+ // "startPosition": "0.11693",
256298
+ // "dir": "Close Long",
256299
+ // "closedPnl": "-0.81851",
256300
+ // "hash": "0xc5adaf35f8402750c218040b0a7bc301130051521273b6f398b3caad3e1f3f5f",
256301
+ // "oid": 7484888874,
256302
+ // "crossed": true,
256303
+ // "fee": "2.968244",
256304
+ // "liquidationMarkPx": null,
256305
+ // "tid": 567547935839686,
256306
+ // "cloid": null
256307
+ // }
256308
+ //
256309
+ // fetchTrades
256310
+ //
256311
+ // {
256312
+ // "coin": "BTC",
256313
+ // "side": "A",
256314
+ // "px": "68517.0",
256315
+ // "sz": "0.005",
256316
+ // "time": 1710125266669,
256317
+ // "hash": "0xc872699f116e012186620407fc08a802015e0097c5cce74710697f7272e6e959",
256318
+ // "tid": 981894269203506
256319
+ // }
256320
+ //
256321
+ const timestamp = this.safeInteger(trade, 'time');
256322
+ const price = this.safeString(trade, 'px');
256323
+ const amount = this.safeString(trade, 'sz');
256324
+ const coin = this.safeString(trade, 'coin');
256325
+ const marketId = coin + '/USDC:USDC';
256326
+ market = this.safeMarket(marketId, undefined);
256327
+ const symbol = market['symbol'];
256328
+ const id = this.safeString(trade, 'tid');
256329
+ let side = this.safeString(trade, 'side');
256330
+ if (side !== undefined) {
256331
+ side = (side === 'A') ? 'sell' : 'buy';
256332
+ }
256333
+ const fee = this.safeString(trade, 'fee');
256334
+ return this.safeTrade({
256335
+ 'info': trade,
256336
+ 'timestamp': timestamp,
256337
+ 'datetime': this.iso8601(timestamp),
256338
+ 'symbol': symbol,
256339
+ 'id': id,
256340
+ 'order': undefined,
256341
+ 'type': undefined,
256342
+ 'side': side,
256343
+ 'takerOrMaker': undefined,
256344
+ 'price': price,
256345
+ 'amount': amount,
256346
+ 'cost': undefined,
256347
+ 'fee': { 'cost': fee, 'currency': 'USDC' },
256348
+ }, market);
256349
+ }
256350
+ async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
256351
+ /**
256352
+ * @method
256353
+ * @name hyperliquid#watchOHLCV
256354
+ * @description watches historical candlestick data containing the open, high, low, close price, and the volume of a market
256355
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
256356
+ * @param {string} timeframe the length of time each candle represents
256357
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
256358
+ * @param {int} [limit] the maximum amount of candles to fetch
256359
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
256360
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
256361
+ */
256362
+ await this.loadMarkets();
256363
+ const market = this.market(symbol);
256364
+ symbol = market['symbol'];
256365
+ const url = this.urls['api']['ws']['public'];
256366
+ const request = {
256367
+ 'method': 'subscribe',
256368
+ 'subscription': {
256369
+ 'type': 'candle',
256370
+ 'coin': market['base'],
256371
+ 'interval': timeframe,
256372
+ },
256373
+ };
256374
+ const messageHash = 'candles:' + timeframe + ':' + symbol;
256375
+ const message = this.extend(request, params);
256376
+ const ohlcv = await this.watch(url, messageHash, message, messageHash);
256377
+ if (this.newUpdates) {
256378
+ limit = ohlcv.getLimit(symbol, limit);
256379
+ }
256380
+ return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
256381
+ }
256382
+ handleOHLCV(client, message) {
256383
+ //
256384
+ // {
256385
+ // channel: 'candle',
256386
+ // data: {
256387
+ // t: 1710146280000,
256388
+ // T: 1710146339999,
256389
+ // s: 'BTC',
256390
+ // i: '1m',
256391
+ // o: '71400.0',
256392
+ // c: '71411.0',
256393
+ // h: '71422.0',
256394
+ // l: '71389.0',
256395
+ // v: '1.20407',
256396
+ // n: 20
256397
+ // }
256398
+ // }
256399
+ //
256400
+ const data = this.safeDict(message, 'data', {});
256401
+ const base = this.safeString(data, 's');
256402
+ const symbol = base + '/USDC:USDC';
256403
+ const timeframe = this.safeString(data, 'i');
256404
+ if (!(symbol in this.ohlcvs)) {
256405
+ this.ohlcvs[symbol] = {};
256406
+ }
256407
+ if (!(timeframe in this.ohlcvs[symbol])) {
256408
+ const limit = this.safeInteger(this.options, 'OHLCVLimit', 1000);
256409
+ const stored = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCacheByTimestamp */ .Py(limit);
256410
+ this.ohlcvs[symbol][timeframe] = stored;
256411
+ }
256412
+ const ohlcv = this.ohlcvs[symbol][timeframe];
256413
+ const parsed = this.parseOHLCV(data);
256414
+ ohlcv.append(parsed);
256415
+ const messageHash = 'candles:' + timeframe + ':' + symbol;
256416
+ client.resolve(ohlcv, messageHash);
256417
+ }
256418
+ async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
256419
+ /**
256420
+ * @method
256421
+ * @name hyperliquid#watchOrders
256422
+ * @description watches information on multiple orders made by the user
256423
+ * @param {string} symbol unified market symbol of the market orders were made in
256424
+ * @param {int} [since] the earliest time in ms to fetch orders for
256425
+ * @param {int} [limit] the maximum number of order structures to retrieve
256426
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
256427
+ * @param {string} [params.user] user address, will default to this.walletAddress if not provided
256428
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
256429
+ */
256430
+ await this.loadMarkets();
256431
+ let userAddress = undefined;
256432
+ [userAddress, params] = this.handlePublicAddress('watchOrders', params);
256433
+ let market = undefined;
256434
+ let messageHash = 'order';
256435
+ if (symbol !== undefined) {
256436
+ market = this.market(symbol);
256437
+ symbol = market['symbol'];
256438
+ messageHash = messageHash + ':' + symbol;
256439
+ }
256440
+ const url = this.urls['api']['ws']['public'];
256441
+ const request = {
256442
+ 'method': 'subscribe',
256443
+ 'subscription': {
256444
+ 'type': 'orderUpdates',
256445
+ 'user': userAddress,
256446
+ },
256447
+ };
256448
+ const message = this.extend(request, params);
256449
+ const orders = await this.watch(url, messageHash, message, messageHash);
256450
+ if (this.newUpdates) {
256451
+ limit = orders.getLimit(symbol, limit);
256452
+ }
256453
+ return this.filterBySymbolSinceLimit(orders, symbol, since, limit, true);
256454
+ }
256455
+ handleOrder(client, message) {
256456
+ //
256457
+ // {
256458
+ // channel: 'orderUpdates',
256459
+ // data: [
256460
+ // {
256461
+ // order: {
256462
+ // coin: 'BTC',
256463
+ // side: 'B',
256464
+ // limitPx: '30000.0',
256465
+ // sz: '0.001',
256466
+ // oid: 7456484275,
256467
+ // timestamp: 1710163596492,
256468
+ // origSz: '0.001'
256469
+ // },
256470
+ // status: 'open',
256471
+ // statusTimestamp: 1710163596492
256472
+ // }
256473
+ // ]
256474
+ // }
256475
+ //
256476
+ const data = this.safeList(message, 'data', []);
256477
+ if (this.orders === undefined) {
256478
+ const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
256479
+ this.orders = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCacheBySymbolById */ .hl(limit);
256480
+ }
256481
+ const dataLength = data.length;
256482
+ if (dataLength === 0) {
256483
+ return;
256484
+ }
256485
+ const stored = this.orders;
256486
+ const messageHash = 'order';
256487
+ const marketSymbols = {};
256488
+ for (let i = 0; i < data.length; i++) {
256489
+ const rawOrder = data[i];
256490
+ const order = this.parseOrder(rawOrder);
256491
+ stored.append(order);
256492
+ const symbol = this.safeString(order, 'symbol');
256493
+ marketSymbols[symbol] = true;
256494
+ }
256495
+ const keys = Object.keys(marketSymbols);
256496
+ for (let i = 0; i < keys.length; i++) {
256497
+ const symbol = keys[i];
256498
+ const innerMessageHash = messageHash + ':' + symbol;
256499
+ client.resolve(stored, innerMessageHash);
256500
+ }
256501
+ client.resolve(stored, messageHash);
256502
+ }
256503
+ handleErrorMessage(client, message) {
256504
+ //
256505
+ // {
256506
+ // "channel": "error",
256507
+ // "data": "Error parsing JSON into valid websocket request: { \"type\": \"allMids\" }"
256508
+ // }
256509
+ //
256510
+ const channel = this.safeString(message, 'channel', '');
256511
+ const ret_msg = this.safeString(message, 'data', '');
256512
+ if (channel === 'error') {
256513
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' ' + ret_msg);
256514
+ }
256515
+ else {
256516
+ return false;
256517
+ }
256518
+ }
256519
+ handleMessage(client, message) {
256520
+ if (this.handleErrorMessage(client, message)) {
256521
+ return;
256522
+ }
256523
+ const topic = this.safeString(message, 'channel', '');
256524
+ const methods = {
256525
+ 'pong': this.handlePong,
256526
+ 'trades': this.handleTrades,
256527
+ 'l2Book': this.handleOrderBook,
256528
+ 'candle': this.handleOHLCV,
256529
+ 'orderUpdates': this.handleOrder,
256530
+ 'userFills': this.handleMyTrades,
256531
+ };
256532
+ const exacMethod = this.safeValue(methods, topic);
256533
+ if (exacMethod !== undefined) {
256534
+ exacMethod.call(this, client, message);
256535
+ return;
256536
+ }
256537
+ const keys = Object.keys(methods);
256538
+ for (let i = 0; i < keys.length; i++) {
256539
+ const key = keys[i];
256540
+ if (topic.indexOf(keys[i]) >= 0) {
256541
+ const method = methods[key];
256542
+ method.call(this, client, message);
256543
+ return;
256544
+ }
256545
+ }
256546
+ }
256547
+ ping(client) {
256548
+ return {
256549
+ 'method': 'ping',
256550
+ };
256551
+ }
256552
+ handlePong(client, message) {
256553
+ //
256554
+ // {
256555
+ // "channel": "pong"
256556
+ // }
256557
+ //
256558
+ client.lastPong = this.safeInteger(message, 'pong');
256559
+ return message;
256560
+ }
256561
+ }
256562
+
256563
+
255783
256564
  /***/ }),
255784
256565
 
255785
256566
  /***/ 3484:
@@ -316935,39 +317716,39 @@ var __webpack_exports__ = {};
316935
317716
  (() => {
316936
317717
  __webpack_require__.r(__webpack_exports__);
316937
317718
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
316938
- /* harmony export */ AccountNotEnabled: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.AccountNotEnabled),
316939
- /* harmony export */ AccountSuspended: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.AccountSuspended),
316940
- /* harmony export */ AddressPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.AddressPending),
316941
- /* harmony export */ ArgumentsRequired: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.ArgumentsRequired),
316942
- /* harmony export */ AuthenticationError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.AuthenticationError),
316943
- /* harmony export */ BadRequest: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.BadRequest),
316944
- /* harmony export */ BadResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.BadResponse),
316945
- /* harmony export */ BadSymbol: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.BadSymbol),
316946
- /* harmony export */ BaseError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.BaseError),
316947
- /* harmony export */ CancelPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.CancelPending),
316948
- /* harmony export */ DDoSProtection: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.DDoSProtection),
316949
- /* harmony export */ DuplicateOrderId: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.DuplicateOrderId),
317719
+ /* harmony export */ AccountNotEnabled: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.AccountNotEnabled),
317720
+ /* harmony export */ AccountSuspended: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.AccountSuspended),
317721
+ /* harmony export */ AddressPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.AddressPending),
317722
+ /* harmony export */ ArgumentsRequired: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.ArgumentsRequired),
317723
+ /* harmony export */ AuthenticationError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.AuthenticationError),
317724
+ /* harmony export */ BadRequest: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.BadRequest),
317725
+ /* harmony export */ BadResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.BadResponse),
317726
+ /* harmony export */ BadSymbol: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.BadSymbol),
317727
+ /* harmony export */ BaseError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.BaseError),
317728
+ /* harmony export */ CancelPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.CancelPending),
317729
+ /* harmony export */ DDoSProtection: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.DDoSProtection),
317730
+ /* harmony export */ DuplicateOrderId: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.DuplicateOrderId),
316950
317731
  /* harmony export */ Exchange: () => (/* reexport safe */ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__.e),
316951
- /* harmony export */ ExchangeError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.ExchangeError),
316952
- /* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.ExchangeNotAvailable),
316953
- /* harmony export */ InsufficientFunds: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.InsufficientFunds),
316954
- /* harmony export */ InvalidAddress: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.InvalidAddress),
316955
- /* harmony export */ InvalidNonce: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.InvalidNonce),
316956
- /* harmony export */ InvalidOrder: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.InvalidOrder),
316957
- /* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.MarginModeAlreadySet),
316958
- /* harmony export */ NetworkError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.NetworkError),
316959
- /* harmony export */ NoChange: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.NoChange),
316960
- /* harmony export */ NotSupported: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.NotSupported),
316961
- /* harmony export */ NullResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.NullResponse),
316962
- /* harmony export */ OnMaintenance: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.OnMaintenance),
316963
- /* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.OrderImmediatelyFillable),
316964
- /* harmony export */ OrderNotCached: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.OrderNotCached),
316965
- /* harmony export */ OrderNotFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.OrderNotFillable),
316966
- /* harmony export */ OrderNotFound: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.OrderNotFound),
316967
- /* harmony export */ PermissionDenied: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.PermissionDenied),
316968
- /* harmony export */ Precise: () => (/* reexport safe */ _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_163__.O),
316969
- /* harmony export */ RateLimitExceeded: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.RateLimitExceeded),
316970
- /* harmony export */ RequestTimeout: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.RequestTimeout),
317732
+ /* harmony export */ ExchangeError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.ExchangeError),
317733
+ /* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.ExchangeNotAvailable),
317734
+ /* harmony export */ InsufficientFunds: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.InsufficientFunds),
317735
+ /* harmony export */ InvalidAddress: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.InvalidAddress),
317736
+ /* harmony export */ InvalidNonce: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.InvalidNonce),
317737
+ /* harmony export */ InvalidOrder: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.InvalidOrder),
317738
+ /* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.MarginModeAlreadySet),
317739
+ /* harmony export */ NetworkError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.NetworkError),
317740
+ /* harmony export */ NoChange: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.NoChange),
317741
+ /* harmony export */ NotSupported: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.NotSupported),
317742
+ /* harmony export */ NullResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.NullResponse),
317743
+ /* harmony export */ OnMaintenance: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.OnMaintenance),
317744
+ /* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.OrderImmediatelyFillable),
317745
+ /* harmony export */ OrderNotCached: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.OrderNotCached),
317746
+ /* harmony export */ OrderNotFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.OrderNotFillable),
317747
+ /* harmony export */ OrderNotFound: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.OrderNotFound),
317748
+ /* harmony export */ PermissionDenied: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.PermissionDenied),
317749
+ /* harmony export */ Precise: () => (/* reexport safe */ _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_164__.O),
317750
+ /* harmony export */ RateLimitExceeded: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.RateLimitExceeded),
317751
+ /* harmony export */ RequestTimeout: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.RequestTimeout),
316971
317752
  /* harmony export */ ace: () => (/* reexport safe */ _src_ace_js__WEBPACK_IMPORTED_MODULE_1__.Z),
316972
317753
  /* harmony export */ alpaca: () => (/* reexport safe */ _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__.Z),
316973
317754
  /* harmony export */ ascendex: () => (/* reexport safe */ _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__.Z),
@@ -317022,11 +317803,11 @@ __webpack_require__.r(__webpack_exports__);
317022
317803
  /* harmony export */ delta: () => (/* reexport safe */ _src_delta_js__WEBPACK_IMPORTED_MODULE_51__.Z),
317023
317804
  /* harmony export */ deribit: () => (/* reexport safe */ _src_deribit_js__WEBPACK_IMPORTED_MODULE_52__.Z),
317024
317805
  /* harmony export */ digifinex: () => (/* reexport safe */ _src_digifinex_js__WEBPACK_IMPORTED_MODULE_53__.Z),
317025
- /* harmony export */ errors: () => (/* reexport module object */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__),
317806
+ /* harmony export */ errors: () => (/* reexport module object */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__),
317026
317807
  /* harmony export */ exchanges: () => (/* binding */ exchanges),
317027
317808
  /* harmony export */ exmo: () => (/* reexport safe */ _src_exmo_js__WEBPACK_IMPORTED_MODULE_54__.Z),
317028
317809
  /* harmony export */ fmfwio: () => (/* reexport safe */ _src_fmfwio_js__WEBPACK_IMPORTED_MODULE_55__.Z),
317029
- /* harmony export */ functions: () => (/* reexport module object */ _src_base_functions_js__WEBPACK_IMPORTED_MODULE_164__),
317810
+ /* harmony export */ functions: () => (/* reexport module object */ _src_base_functions_js__WEBPACK_IMPORTED_MODULE_165__),
317030
317811
  /* harmony export */ gate: () => (/* reexport safe */ _src_gate_js__WEBPACK_IMPORTED_MODULE_56__.Z),
317031
317812
  /* harmony export */ gateio: () => (/* reexport safe */ _src_gateio_js__WEBPACK_IMPORTED_MODULE_57__.Z),
317032
317813
  /* harmony export */ gemini: () => (/* reexport safe */ _src_gemini_js__WEBPACK_IMPORTED_MODULE_58__.Z),
@@ -317077,9 +317858,9 @@ __webpack_require__.r(__webpack_exports__);
317077
317858
  /* harmony export */ zonda: () => (/* reexport safe */ _src_zonda_js__WEBPACK_IMPORTED_MODULE_101__.Z)
317078
317859
  /* harmony export */ });
317079
317860
  /* harmony import */ var _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3043);
317080
- /* harmony import */ var _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_163__ = __webpack_require__(2194);
317081
- /* harmony import */ var _src_base_functions_js__WEBPACK_IMPORTED_MODULE_164__ = __webpack_require__(7100);
317082
- /* harmony import */ var _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__ = __webpack_require__(6689);
317861
+ /* harmony import */ var _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_164__ = __webpack_require__(2194);
317862
+ /* harmony import */ var _src_base_functions_js__WEBPACK_IMPORTED_MODULE_165__ = __webpack_require__(7100);
317863
+ /* harmony import */ var _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__ = __webpack_require__(6689);
317083
317864
  /* harmony import */ var _src_ace_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9869);
317084
317865
  /* harmony import */ var _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5660);
317085
317866
  /* harmony import */ var _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9612);
@@ -317220,28 +318001,29 @@ __webpack_require__.r(__webpack_exports__);
317220
318001
  /* harmony import */ var _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(7474);
317221
318002
  /* harmony import */ var _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(8384);
317222
318003
  /* harmony import */ var _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(9021);
317223
- /* harmony import */ var _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(3484);
317224
- /* harmony import */ var _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(1311);
317225
- /* harmony import */ var _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(736);
317226
- /* harmony import */ var _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(449);
317227
- /* harmony import */ var _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(2387);
317228
- /* harmony import */ var _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(7181);
317229
- /* harmony import */ var _src_pro_lbank_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(1267);
317230
- /* harmony import */ var _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(627);
317231
- /* harmony import */ var _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(6484);
317232
- /* harmony import */ var _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(8080);
317233
- /* harmony import */ var _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(7105);
317234
- /* harmony import */ var _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(2214);
317235
- /* harmony import */ var _src_pro_onetrading_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(9419);
317236
- /* harmony import */ var _src_pro_p2b_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(8516);
317237
- /* harmony import */ var _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(4360);
317238
- /* harmony import */ var _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(7924);
317239
- /* harmony import */ var _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(3541);
317240
- /* harmony import */ var _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(9782);
317241
- /* harmony import */ var _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_159__ = __webpack_require__(7614);
317242
- /* harmony import */ var _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_160__ = __webpack_require__(4828);
317243
- /* harmony import */ var _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_161__ = __webpack_require__(5630);
317244
- /* harmony import */ var _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_162__ = __webpack_require__(3910);
318004
+ /* harmony import */ var _src_pro_hyperliquid_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(8354);
318005
+ /* harmony import */ var _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(3484);
318006
+ /* harmony import */ var _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(1311);
318007
+ /* harmony import */ var _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(736);
318008
+ /* harmony import */ var _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(449);
318009
+ /* harmony import */ var _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(2387);
318010
+ /* harmony import */ var _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(7181);
318011
+ /* harmony import */ var _src_pro_lbank_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(1267);
318012
+ /* harmony import */ var _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(627);
318013
+ /* harmony import */ var _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(6484);
318014
+ /* harmony import */ var _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(8080);
318015
+ /* harmony import */ var _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(7105);
318016
+ /* harmony import */ var _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(2214);
318017
+ /* harmony import */ var _src_pro_onetrading_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(9419);
318018
+ /* harmony import */ var _src_pro_p2b_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(8516);
318019
+ /* harmony import */ var _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(4360);
318020
+ /* harmony import */ var _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(7924);
318021
+ /* harmony import */ var _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(3541);
318022
+ /* harmony import */ var _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_159__ = __webpack_require__(9782);
318023
+ /* harmony import */ var _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_160__ = __webpack_require__(7614);
318024
+ /* harmony import */ var _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_161__ = __webpack_require__(4828);
318025
+ /* harmony import */ var _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_162__ = __webpack_require__(5630);
318026
+ /* harmony import */ var _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_163__ = __webpack_require__(3910);
317245
318027
  /*
317246
318028
 
317247
318029
  MIT License
@@ -317276,7 +318058,7 @@ SOFTWARE.
317276
318058
 
317277
318059
  //-----------------------------------------------------------------------------
317278
318060
  // this is updated by vss.js when building
317279
- const version = '4.2.70';
318061
+ const version = '4.2.72';
317280
318062
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
317281
318063
  //-----------------------------------------------------------------------------
317282
318064
 
@@ -317440,6 +318222,7 @@ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion
317440
318222
 
317441
318223
 
317442
318224
 
318225
+
317443
318226
 
317444
318227
 
317445
318228
  const exchanges = {
@@ -317585,28 +318368,29 @@ const pro = {
317585
318368
  'htx': _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_138__/* ["default"] */ .Z,
317586
318369
  'huobi': _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_139__/* ["default"] */ .Z,
317587
318370
  'huobijp': _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_140__/* ["default"] */ .Z,
317588
- 'idex': _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_141__/* ["default"] */ .Z,
317589
- 'independentreserve': _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_142__/* ["default"] */ .Z,
317590
- 'kraken': _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_143__/* ["default"] */ .Z,
317591
- 'krakenfutures': _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_144__/* ["default"] */ .Z,
317592
- 'kucoin': _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_145__/* ["default"] */ .Z,
317593
- 'kucoinfutures': _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_146__/* ["default"] */ .Z,
317594
- 'lbank': _src_pro_lbank_js__WEBPACK_IMPORTED_MODULE_147__/* ["default"] */ .Z,
317595
- 'luno': _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_148__/* ["default"] */ .Z,
317596
- 'mexc': _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_149__/* ["default"] */ .Z,
317597
- 'ndax': _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_150__/* ["default"] */ .Z,
317598
- 'okcoin': _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_151__/* ["default"] */ .Z,
317599
- 'okx': _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_152__/* ["default"] */ .Z,
317600
- 'onetrading': _src_pro_onetrading_js__WEBPACK_IMPORTED_MODULE_153__/* ["default"] */ .Z,
317601
- 'p2b': _src_pro_p2b_js__WEBPACK_IMPORTED_MODULE_154__/* ["default"] */ .Z,
317602
- 'phemex': _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_155__/* ["default"] */ .Z,
317603
- 'poloniex': _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_156__/* ["default"] */ .Z,
317604
- 'poloniexfutures': _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_157__/* ["default"] */ .Z,
317605
- 'probit': _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_158__/* ["default"] */ .Z,
317606
- 'upbit': _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_159__/* ["default"] */ .Z,
317607
- 'wazirx': _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_160__/* ["default"] */ .Z,
317608
- 'whitebit': _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_161__/* ["default"] */ .Z,
317609
- 'woo': _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_162__/* ["default"] */ .Z,
318371
+ 'hyperliquid': _src_pro_hyperliquid_js__WEBPACK_IMPORTED_MODULE_141__/* ["default"] */ .Z,
318372
+ 'idex': _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_142__/* ["default"] */ .Z,
318373
+ 'independentreserve': _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_143__/* ["default"] */ .Z,
318374
+ 'kraken': _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_144__/* ["default"] */ .Z,
318375
+ 'krakenfutures': _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_145__/* ["default"] */ .Z,
318376
+ 'kucoin': _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_146__/* ["default"] */ .Z,
318377
+ 'kucoinfutures': _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_147__/* ["default"] */ .Z,
318378
+ 'lbank': _src_pro_lbank_js__WEBPACK_IMPORTED_MODULE_148__/* ["default"] */ .Z,
318379
+ 'luno': _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_149__/* ["default"] */ .Z,
318380
+ 'mexc': _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_150__/* ["default"] */ .Z,
318381
+ 'ndax': _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_151__/* ["default"] */ .Z,
318382
+ 'okcoin': _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_152__/* ["default"] */ .Z,
318383
+ 'okx': _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_153__/* ["default"] */ .Z,
318384
+ 'onetrading': _src_pro_onetrading_js__WEBPACK_IMPORTED_MODULE_154__/* ["default"] */ .Z,
318385
+ 'p2b': _src_pro_p2b_js__WEBPACK_IMPORTED_MODULE_155__/* ["default"] */ .Z,
318386
+ 'phemex': _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_156__/* ["default"] */ .Z,
318387
+ 'poloniex': _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_157__/* ["default"] */ .Z,
318388
+ 'poloniexfutures': _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_158__/* ["default"] */ .Z,
318389
+ 'probit': _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_159__/* ["default"] */ .Z,
318390
+ 'upbit': _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_160__/* ["default"] */ .Z,
318391
+ 'wazirx': _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_161__/* ["default"] */ .Z,
318392
+ 'whitebit': _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_162__/* ["default"] */ .Z,
318393
+ 'woo': _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_163__/* ["default"] */ .Z,
317610
318394
  };
317611
318395
  for (const exchange in pro) {
317612
318396
  // const ccxtExchange = exchanges[exchange]
@@ -317619,7 +318403,7 @@ for (const exchange in pro) {
317619
318403
  pro.exchanges = Object.keys(pro);
317620
318404
  pro['Exchange'] = _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e; // now the same for rest and ts
317621
318405
  //-----------------------------------------------------------------------------
317622
- const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise: _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_163__/* .Precise */ .O, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, _src_base_functions_js__WEBPACK_IMPORTED_MODULE_164__, _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__);
318406
+ const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise: _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_164__/* .Precise */ .O, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, _src_base_functions_js__WEBPACK_IMPORTED_MODULE_165__, _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__);
317623
318407
 
317624
318408
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ccxt);
317625
318409
  //-----------------------------------------------------------------------------