@fileverse-dev/formulajs 4.4.12-mod-5 → 4.4.12-mod-6

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.
@@ -1,4 +1,4 @@
1
- /* @fileverse-dev/formulajs v4.4.12-mod-5 */
1
+ /* @fileverse-dev/formulajs v4.4.12-mod-6 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -18405,7 +18405,7 @@ function _typeof(o) {
18405
18405
  }
18406
18406
  function _DUNESIM() {
18407
18407
  _DUNESIM = _asyncToGenerator(_regeneratorRuntime().mark((function _callee29() {
18408
- var _ref26, _json$activity, _ref27, _json$holders, _ref28, _json$tokens, _argsToArray31, _argsToArray32, type, input1, input2, input3, input4, route, buildQuery, address, qs, chain, _qs, _qs2, _chain, apiKey, url, _getUrlAndHeaders1, finalUrl, HEADERS, res, json, _data6, result, _args32 = arguments;
18408
+ var _ref26, _json$activity, _ref27, _json$holders, _ref28, _json$tokens, _argsToArray31, _argsToArray32, type, input1, input2, input3, input4, route, buildQuery, address, qs, chain, _qs, tokenAddress, _qs2, _chain, apiKey, url, _getUrlAndHeaders1, finalUrl, HEADERS, res, json, _data6, result, _args32 = arguments;
18409
18409
  return _regeneratorRuntime().wrap((function _callee29$(_context32) {
18410
18410
  while (1) switch (_context32.prev = _context32.next) {
18411
18411
  case 0:
@@ -18431,23 +18431,16 @@ function _typeof(o) {
18431
18431
  }));
18432
18432
  return parts.length ? "?".concat(parts.join("&")) : "";
18433
18433
  };
18434
- if (!(type === "activity")) {
18435
- _context32.next = 11;
18436
- break;
18434
+ if (type === "activity") {
18435
+ address = fromEnsNameToAddress$1.validateAndGetAddress(input1);
18436
+ qs = buildQuery([ [ "chain_ids", SUPPORTED_TOKEN_NAMES[input2] || input2 ], [ "limit", input3 ] ]);
18437
+ route = "activity/".concat(address).concat(qs);
18437
18438
  }
18438
- _context32.next = 8;
18439
- return fromEnsNameToAddress$1.validateAndGetAddress(input1);
18440
-
18441
- case 8:
18442
- address = _context32.sent;
18443
- qs = buildQuery([ [ "chain_ids", SUPPORTED_TOKEN_NAMES[input2] || input2 ], [ "limit", input3 ] ]);
18444
- route = "activity/".concat(address).concat(qs);
18445
-
18446
- case 11:
18447
18439
  if (type === "price") {
18448
- chain = SUPPORTED_TOKEN_NAMES[input1] || input2;
18449
- _qs = buildQuery([ [ "chain_ids", chain ], [ "historical_prices", input3 ], [ "limit", input4 ] ]);
18450
- route = "token-info/native".concat(_qs);
18440
+ chain = SUPPORTED_TOKEN_NAMES[input1] || input1;
18441
+ _qs = buildQuery([ [ "chain_ids", chain ], [ "historical_prices", input2 ], [ "limit", input4 ] ]);
18442
+ tokenAddress = input3 || "native";
18443
+ route = "token-info/".concat(tokenAddress).concat(_qs);
18451
18444
  }
18452
18445
  if (type === "token_holders") {
18453
18446
  _qs2 = buildQuery([ [ "limit", input3 ] ]);
@@ -18456,6 +18449,9 @@ function _typeof(o) {
18456
18449
  }
18457
18450
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.DuneSim);
18458
18451
  url = "https://api.sim.dune.com/v1/evm/".concat(route);
18452
+ console.log({
18453
+ route: route
18454
+ });
18459
18455
  _getUrlAndHeaders1 = getUrlAndHeaders({
18460
18456
  url: url,
18461
18457
  serviceName: "DuneSim",
@@ -18463,25 +18459,25 @@ function _typeof(o) {
18463
18459
  "X-Sim-Api-Key": apiKey
18464
18460
  }
18465
18461
  }), finalUrl = _getUrlAndHeaders1.URL, HEADERS = _getUrlAndHeaders1.HEADERS;
18466
- _context32.next = 18;
18462
+ _context32.next = 14;
18467
18463
  return fetch(finalUrl, {
18468
18464
  method: "GET",
18469
18465
  headers: HEADERS
18470
18466
  });
18471
18467
 
18472
- case 18:
18468
+ case 14:
18473
18469
  res = _context32.sent;
18474
18470
  if (res.ok) {
18475
- _context32.next = 21;
18471
+ _context32.next = 17;
18476
18472
  break;
18477
18473
  }
18478
18474
  throw new NetworkError(SERVICES_API_KEY.DuneSim, res.status);
18479
18475
 
18480
- case 21:
18481
- _context32.next = 23;
18476
+ case 17:
18477
+ _context32.next = 19;
18482
18478
  return res.json();
18483
18479
 
18484
- case 23:
18480
+ case 19:
18485
18481
  json = _context32.sent;
18486
18482
  _data6 = type === "activity" ? (_ref26 = (_json$activity = json === null || json === void 0 ? void 0 : json.activity) !== null && _json$activity !== void 0 ? _json$activity : json) !== null && _ref26 !== void 0 ? _ref26 : [] : type === "token_holders" ? (_ref27 = (_json$holders = json === null || json === void 0 ? void 0 : json.holders) !== null && _json$holders !== void 0 ? _json$holders : json) !== null && _ref27 !== void 0 ? _ref27 : [] : type === "price" ? (_ref28 = (_json$tokens = json === null || json === void 0 ? void 0 : json.tokens) !== null && _json$tokens !== void 0 ? _json$tokens : json) !== null && _ref28 !== void 0 ? _ref28 : [] : json !== null && json !== void 0 ? json : [];
18487
18483
  result = _data6.map((function(item) {
@@ -18492,16 +18488,16 @@ function _typeof(o) {
18492
18488
  });
18493
18489
  return _context32.abrupt("return", result);
18494
18490
 
18495
- case 30:
18496
- _context32.prev = 30;
18491
+ case 26:
18492
+ _context32.prev = 26;
18497
18493
  _context32.t0 = _context32["catch"](0);
18498
18494
  return _context32.abrupt("return", errorMessageHandler(_context32.t0, "DUNESIM"));
18499
18495
 
18500
- case 33:
18496
+ case 29:
18501
18497
  case "end":
18502
18498
  return _context32.stop();
18503
18499
  }
18504
- }), _callee29, null, [ [ 0, 30 ] ]);
18500
+ }), _callee29, null, [ [ 0, 26 ] ]);
18505
18501
  })));
18506
18502
  return _DUNESIM.apply(this, arguments);
18507
18503
  }