@fileverse-dev/formulajs 4.4.12-mod-9 → 4.4.13

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-9 */
1
+ /* @fileverse-dev/formulajs v4.4.13 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -16188,13 +16188,13 @@ function _typeof(o) {
16188
16188
  return _AAVE.apply(this, arguments);
16189
16189
  }
16190
16190
  function _AAVE() {
16191
- _AAVE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11() {
16192
- var _argsToArray3, _argsToArray4, graphType, category, param1, param2, baseUrl, url, res, json, _args11 = arguments;
16193
- return _regeneratorRuntime().wrap((function _callee11$(_context11) {
16194
- while (1) switch (_context11.prev = _context11.next) {
16191
+ _AAVE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10() {
16192
+ var _argsToArray3, _argsToArray4, graphType, category, param1, param2, baseUrl, url, res, json, _args10 = arguments;
16193
+ return _regeneratorRuntime().wrap((function _callee10$(_context10) {
16194
+ while (1) switch (_context10.prev = _context10.next) {
16195
16195
  case 0:
16196
- _context11.prev = 0;
16197
- _argsToArray3 = argsToArray(_args11), _argsToArray4 = _slicedToArray(_argsToArray3, 4),
16196
+ _context10.prev = 0;
16197
+ _argsToArray3 = argsToArray(_args10), _argsToArray4 = _slicedToArray(_argsToArray3, 4),
16198
16198
  graphType = _argsToArray4[0], category = _argsToArray4[1], param1 = _argsToArray4[2],
16199
16199
  param2 = _argsToArray4[3];
16200
16200
  validateParams(aaveParamsSchema, {
@@ -16205,49 +16205,49 @@ function _typeof(o) {
16205
16205
  });
16206
16206
  baseUrl = "https://onchain-proxy.fileverse.io/third-party";
16207
16207
  url = "".concat(baseUrl) + "?service=aave" + "&graphType=".concat(encodeURIComponent(graphType)) + "&category=".concat(encodeURIComponent(category)) + "&input1=".concat(encodeURIComponent(param1)) + (param2 ? "&input2=".concat(encodeURIComponent(param2)) : "");
16208
- _context11.next = 7;
16208
+ _context10.next = 7;
16209
16209
  return fetch(url);
16210
16210
 
16211
16211
  case 7:
16212
- res = _context11.sent;
16212
+ res = _context10.sent;
16213
16213
  if (res.ok) {
16214
- _context11.next = 10;
16214
+ _context10.next = 10;
16215
16215
  break;
16216
16216
  }
16217
16217
  throw new NetworkError("AAVE", res.status);
16218
16218
 
16219
16219
  case 10:
16220
- _context11.next = 12;
16220
+ _context10.next = 12;
16221
16221
  return res.json();
16222
16222
 
16223
16223
  case 12:
16224
- json = _context11.sent;
16224
+ json = _context10.sent;
16225
16225
  if (!Array.isArray(json)) {
16226
- _context11.next = 15;
16226
+ _context10.next = 15;
16227
16227
  break;
16228
16228
  }
16229
- return _context11.abrupt("return", json.map((function(item) {
16229
+ return _context10.abrupt("return", json.map((function(item) {
16230
16230
  var flat = {};
16231
- Object.entries(item).forEach((function(_ref16) {
16232
- var _ref17 = _slicedToArray(_ref16, 2), k = _ref17[0], v = _ref17[1];
16231
+ Object.entries(item).forEach((function(_ref15) {
16232
+ var _ref16 = _slicedToArray(_ref15, 2), k = _ref16[0], v = _ref16[1];
16233
16233
  if (v === null || _typeof(v) !== "object") flat[k] = v;
16234
16234
  }));
16235
16235
  return flat;
16236
16236
  })));
16237
16237
 
16238
16238
  case 15:
16239
- return _context11.abrupt("return", json);
16239
+ return _context10.abrupt("return", json);
16240
16240
 
16241
16241
  case 18:
16242
- _context11.prev = 18;
16243
- _context11.t0 = _context11["catch"](0);
16244
- return _context11.abrupt("return", errorMessageHandler(_context11.t0, "AAVE"));
16242
+ _context10.prev = 18;
16243
+ _context10.t0 = _context10["catch"](0);
16244
+ return _context10.abrupt("return", errorMessageHandler(_context10.t0, "AAVE"));
16245
16245
 
16246
16246
  case 21:
16247
16247
  case "end":
16248
- return _context11.stop();
16248
+ return _context10.stop();
16249
16249
  }
16250
- }), _callee11, null, [ [ 0, 18 ] ]);
16250
+ }), _callee10, null, [ [ 0, 18 ] ]);
16251
16251
  })));
16252
16252
  return _AAVE.apply(this, arguments);
16253
16253
  }
@@ -16307,16 +16307,16 @@ function _typeof(o) {
16307
16307
  return _fromEnsNameToAddress.apply(this, arguments);
16308
16308
  }
16309
16309
  function _fromEnsNameToAddress() {
16310
- _fromEnsNameToAddress = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12(name) {
16310
+ _fromEnsNameToAddress = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11(name) {
16311
16311
  var ALCHEMY_KEY, provider, resolved;
16312
- return _regeneratorRuntime().wrap((function _callee12$(_context12) {
16313
- while (1) switch (_context12.prev = _context12.next) {
16312
+ return _regeneratorRuntime().wrap((function _callee11$(_context11) {
16313
+ while (1) switch (_context11.prev = _context11.next) {
16314
16314
  case 0:
16315
16315
  if (!(typeof ethers === "undefined")) {
16316
- _context12.next = 3;
16316
+ _context11.next = 3;
16317
16317
  break;
16318
16318
  }
16319
- _context12.next = 3;
16319
+ _context11.next = 3;
16320
16320
  return new Promise((function(resolve, reject) {
16321
16321
  var script = document.createElement("script");
16322
16322
  script.src = "https://cdn.jsdelivr.net/npm/ethers@6.10.0/dist/ethers.umd.min.js";
@@ -16328,33 +16328,33 @@ function _typeof(o) {
16328
16328
  case 3:
16329
16329
  ALCHEMY_KEY = window.localStorage.getItem(UTILITY.ALCHEMY_API_KEY);
16330
16330
  if (ALCHEMY_KEY) {
16331
- _context12.next = 7;
16331
+ _context11.next = 7;
16332
16332
  break;
16333
16333
  }
16334
16334
  console.error("alchemy api key missing");
16335
- return _context12.abrupt("return", null);
16335
+ return _context11.abrupt("return", null);
16336
16336
 
16337
16337
  case 7:
16338
16338
  provider = new ethers.AlchemyProvider("mainnet", ALCHEMY_KEY);
16339
- _context12.prev = 8;
16340
- _context12.next = 11;
16339
+ _context11.prev = 8;
16340
+ _context11.next = 11;
16341
16341
  return provider.resolveName(name);
16342
16342
 
16343
16343
  case 11:
16344
- resolved = _context12.sent;
16345
- return _context12.abrupt("return", resolved || null);
16344
+ resolved = _context11.sent;
16345
+ return _context11.abrupt("return", resolved || null);
16346
16346
 
16347
16347
  case 15:
16348
- _context12.prev = 15;
16349
- _context12.t0 = _context12["catch"](8);
16350
- console.error("ENS resolution failed:", _context12.t0.message);
16351
- return _context12.abrupt("return", null);
16348
+ _context11.prev = 15;
16349
+ _context11.t0 = _context11["catch"](8);
16350
+ console.error("ENS resolution failed:", _context11.t0.message);
16351
+ return _context11.abrupt("return", null);
16352
16352
 
16353
16353
  case 19:
16354
16354
  case "end":
16355
- return _context12.stop();
16355
+ return _context11.stop();
16356
16356
  }
16357
- }), _callee12, null, [ [ 8, 15 ] ]);
16357
+ }), _callee11, null, [ [ 8, 15 ] ]);
16358
16358
  })));
16359
16359
  return _fromEnsNameToAddress.apply(this, arguments);
16360
16360
  }
@@ -16540,74 +16540,74 @@ function _typeof(o) {
16540
16540
  return _EOA.apply(this, arguments);
16541
16541
  }
16542
16542
  function _EOA() {
16543
- _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee14() {
16544
- var fetchJSON, _argsToArray5, _argsToArray6, addresses, category, chains, startTime, endTime, _argsToArray6$, page, _argsToArray6$2, offset, apiKey, INPUTS, CHAINS, ADDRESS_MAP, _iterator41, _step41, inp, _address, ADDRS, out, _iterator42, _step42, _loop, _ret, _args17 = arguments;
16545
- return _regeneratorRuntime().wrap((function _callee14$(_context17) {
16546
- while (1) switch (_context17.prev = _context17.next) {
16543
+ _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
16544
+ var fetchJSON, _argsToArray5, _argsToArray6, addresses, category, chains, startTime, endTime, _argsToArray6$, page, _argsToArray6$2, offset, apiKey, INPUTS, CHAINS, ADDRESS_MAP, _iterator41, _step41, inp, _address, ADDRS, out, _iterator42, _step42, _loop, _ret, _args16 = arguments;
16545
+ return _regeneratorRuntime().wrap((function _callee13$(_context16) {
16546
+ while (1) switch (_context16.prev = _context16.next) {
16547
16547
  case 0:
16548
- _context17.prev = 0;
16548
+ _context16.prev = 0;
16549
16549
  fetchJSON = function() {
16550
- var _ref18 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13(url) {
16550
+ var _ref17 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12(url) {
16551
16551
  var _getUrlAndHeaders3, finalUrl, HEADERS, res, json;
16552
- return _regeneratorRuntime().wrap((function _callee13$(_context13) {
16553
- while (1) switch (_context13.prev = _context13.next) {
16552
+ return _regeneratorRuntime().wrap((function _callee12$(_context12) {
16553
+ while (1) switch (_context12.prev = _context12.next) {
16554
16554
  case 0:
16555
16555
  _getUrlAndHeaders3 = getUrlAndHeaders({
16556
16556
  url: url,
16557
16557
  serviceName: "Etherscan",
16558
16558
  headers: {}
16559
16559
  }), finalUrl = _getUrlAndHeaders3.URL, HEADERS = _getUrlAndHeaders3.HEADERS;
16560
- _context13.next = 3;
16560
+ _context12.next = 3;
16561
16561
  return fetch(finalUrl, {
16562
16562
  method: "GET",
16563
16563
  headers: HEADERS
16564
16564
  });
16565
16565
 
16566
16566
  case 3:
16567
- res = _context13.sent;
16567
+ res = _context12.sent;
16568
16568
  if (res.ok) {
16569
- _context13.next = 6;
16569
+ _context12.next = 6;
16570
16570
  break;
16571
16571
  }
16572
16572
  throw new NetworkError(SERVICES_API_KEY.Etherscan, res.status);
16573
16573
 
16574
16574
  case 6:
16575
- _context13.next = 8;
16575
+ _context12.next = 8;
16576
16576
  return res.json();
16577
16577
 
16578
16578
  case 8:
16579
- json = _context13.sent;
16579
+ json = _context12.sent;
16580
16580
  if (!(typeof json.result === "string")) {
16581
- _context13.next = 14;
16581
+ _context12.next = 14;
16582
16582
  break;
16583
16583
  }
16584
16584
  if (!json.result.includes("Invalid API Key")) {
16585
- _context13.next = 12;
16585
+ _context12.next = 12;
16586
16586
  break;
16587
16587
  }
16588
16588
  throw new InvalidApiKeyError(SERVICES_API_KEY.Etherscan);
16589
16589
 
16590
16590
  case 12:
16591
16591
  if (!json.result.includes("Max rate limit reached")) {
16592
- _context13.next = 14;
16592
+ _context12.next = 14;
16593
16593
  break;
16594
16594
  }
16595
16595
  throw new RateLimitError(SERVICES_API_KEY.Etherscan);
16596
16596
 
16597
16597
  case 14:
16598
- return _context13.abrupt("return", json.result);
16598
+ return _context12.abrupt("return", json.result);
16599
16599
 
16600
16600
  case 15:
16601
16601
  case "end":
16602
- return _context13.stop();
16602
+ return _context12.stop();
16603
16603
  }
16604
- }), _callee13);
16604
+ }), _callee12);
16605
16605
  })));
16606
16606
  return function fetchJSON(_x17) {
16607
- return _ref18.apply(this, arguments);
16607
+ return _ref17.apply(this, arguments);
16608
16608
  };
16609
16609
  }();
16610
- _argsToArray5 = argsToArray(_args17), _argsToArray6 = _slicedToArray(_argsToArray5, 7),
16610
+ _argsToArray5 = argsToArray(_args16), _argsToArray6 = _slicedToArray(_argsToArray5, 7),
16611
16611
  addresses = _argsToArray6[0], category = _argsToArray6[1], chains = _argsToArray6[2],
16612
16612
  startTime = _argsToArray6[3], endTime = _argsToArray6[4], _argsToArray6$ = _argsToArray6[5],
16613
16613
  page = _argsToArray6$ === void 0 ? 1 : _argsToArray6$, _argsToArray6$2 = _argsToArray6[6],
@@ -16630,89 +16630,89 @@ function _typeof(o) {
16630
16630
  })).filter(Boolean);
16631
16631
  ADDRESS_MAP = {};
16632
16632
  _iterator41 = _createForOfIteratorHelper(INPUTS);
16633
- _context17.prev = 9;
16633
+ _context16.prev = 9;
16634
16634
  _iterator41.s();
16635
16635
 
16636
16636
  case 11:
16637
16637
  if ((_step41 = _iterator41.n()).done) {
16638
- _context17.next = 23;
16638
+ _context16.next = 23;
16639
16639
  break;
16640
16640
  }
16641
16641
  inp = _step41.value;
16642
16642
  if (!isAddress$1.isAddress(inp)) {
16643
- _context17.next = 17;
16643
+ _context16.next = 17;
16644
16644
  break;
16645
16645
  }
16646
16646
  ADDRESS_MAP[inp.toLowerCase()] = null;
16647
- _context17.next = 21;
16647
+ _context16.next = 21;
16648
16648
  break;
16649
16649
 
16650
16650
  case 17:
16651
- _context17.next = 19;
16651
+ _context16.next = 19;
16652
16652
  return fromEnsNameToAddress$1.validateAndGetAddress(inp);
16653
16653
 
16654
16654
  case 19:
16655
- _address = _context17.sent;
16655
+ _address = _context16.sent;
16656
16656
  ADDRESS_MAP[_address.toLowerCase()] = _address;
16657
16657
 
16658
16658
  case 21:
16659
- _context17.next = 11;
16659
+ _context16.next = 11;
16660
16660
  break;
16661
16661
 
16662
16662
  case 23:
16663
- _context17.next = 28;
16663
+ _context16.next = 28;
16664
16664
  break;
16665
16665
 
16666
16666
  case 25:
16667
- _context17.prev = 25;
16668
- _context17.t0 = _context17["catch"](9);
16669
- _iterator41.e(_context17.t0);
16667
+ _context16.prev = 25;
16668
+ _context16.t0 = _context16["catch"](9);
16669
+ _iterator41.e(_context16.t0);
16670
16670
 
16671
16671
  case 28:
16672
- _context17.prev = 28;
16672
+ _context16.prev = 28;
16673
16673
  _iterator41.f();
16674
- return _context17.finish(28);
16674
+ return _context16.finish(28);
16675
16675
 
16676
16676
  case 31:
16677
16677
  ADDRS = Object.keys(ADDRESS_MAP);
16678
16678
  out = [];
16679
16679
  _iterator42 = _createForOfIteratorHelper(CHAINS);
16680
- _context17.prev = 34;
16680
+ _context16.prev = 34;
16681
16681
  _loop = _regeneratorRuntime().mark((function _loop() {
16682
16682
  var chain, chainId, _loop2, _ret2, i, sb, eb, _loop3, _ret3, _i10, _ADDRS;
16683
- return _regeneratorRuntime().wrap((function _loop$(_context16) {
16684
- while (1) switch (_context16.prev = _context16.next) {
16683
+ return _regeneratorRuntime().wrap((function _loop$(_context15) {
16684
+ while (1) switch (_context15.prev = _context15.next) {
16685
16685
  case 0:
16686
16686
  chain = _step42.value;
16687
16687
  chainId = CHAIN_ID_MAP[chain];
16688
16688
  if (chainId) {
16689
- _context16.next = 4;
16689
+ _context15.next = 4;
16690
16690
  break;
16691
16691
  }
16692
16692
  throw new ValidationError("Invalid chain: ".concat(chain));
16693
16693
 
16694
16694
  case 4:
16695
16695
  if (!(category === "balance")) {
16696
- _context16.next = 17;
16696
+ _context15.next = 17;
16697
16697
  break;
16698
16698
  }
16699
16699
  _loop2 = _regeneratorRuntime().mark((function _loop2(i) {
16700
16700
  var slice, url, data;
16701
- return _regeneratorRuntime().wrap((function _loop2$(_context14) {
16702
- while (1) switch (_context14.prev = _context14.next) {
16701
+ return _regeneratorRuntime().wrap((function _loop2$(_context13) {
16702
+ while (1) switch (_context13.prev = _context13.next) {
16703
16703
  case 0:
16704
16704
  slice = ADDRS.slice(i, i + 20).join(",");
16705
16705
  url = "https://api.etherscan.io/v2/api?chainid=".concat(chainId) + "&module=account&action=addresstokenbalance&address=".concat(slice) + "&page=".concat(page, "&offset=").concat(offset, "&apikey=").concat(apiKey);
16706
- _context14.next = 4;
16706
+ _context13.next = 4;
16707
16707
  return fetchJSON(url);
16708
16708
 
16709
16709
  case 4:
16710
- data = _context14.sent;
16710
+ data = _context13.sent;
16711
16711
  if (Array.isArray(data)) {
16712
- _context14.next = 7;
16712
+ _context13.next = 7;
16713
16713
  break;
16714
16714
  }
16715
- return _context14.abrupt("return", {
16715
+ return _context13.abrupt("return", {
16716
16716
  v: {
16717
16717
  v: data
16718
16718
  }
@@ -16729,7 +16729,7 @@ function _typeof(o) {
16729
16729
 
16730
16730
  case 8:
16731
16731
  case "end":
16732
- return _context14.stop();
16732
+ return _context13.stop();
16733
16733
  }
16734
16734
  }), _loop2);
16735
16735
  }));
@@ -16737,48 +16737,48 @@ function _typeof(o) {
16737
16737
 
16738
16738
  case 7:
16739
16739
  if (!(i < ADDRS.length)) {
16740
- _context16.next = 15;
16740
+ _context15.next = 15;
16741
16741
  break;
16742
16742
  }
16743
- return _context16.delegateYield(_loop2(i), "t0", 9);
16743
+ return _context15.delegateYield(_loop2(i), "t0", 9);
16744
16744
 
16745
16745
  case 9:
16746
- _ret2 = _context16.t0;
16746
+ _ret2 = _context15.t0;
16747
16747
  if (!_ret2) {
16748
- _context16.next = 12;
16748
+ _context15.next = 12;
16749
16749
  break;
16750
16750
  }
16751
- return _context16.abrupt("return", _ret2.v);
16751
+ return _context15.abrupt("return", _ret2.v);
16752
16752
 
16753
16753
  case 12:
16754
16754
  i += 20;
16755
- _context16.next = 7;
16755
+ _context15.next = 7;
16756
16756
  break;
16757
16757
 
16758
16758
  case 15:
16759
- _context16.next = 37;
16759
+ _context15.next = 37;
16760
16760
  break;
16761
16761
 
16762
16762
  case 17:
16763
- _context16.next = 19;
16763
+ _context15.next = 19;
16764
16764
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startTime), chain, apiKey);
16765
16765
 
16766
16766
  case 19:
16767
- sb = _context16.sent;
16768
- _context16.next = 22;
16767
+ sb = _context15.sent;
16768
+ _context15.next = 22;
16769
16769
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endTime), chain, apiKey);
16770
16770
 
16771
16771
  case 22:
16772
- eb = _context16.sent;
16772
+ eb = _context15.sent;
16773
16773
  if (sb) {
16774
- _context16.next = 25;
16774
+ _context15.next = 25;
16775
16775
  break;
16776
16776
  }
16777
16777
  throw new ValidationError("Invalid startTime: ".concat(startTime));
16778
16778
 
16779
16779
  case 25:
16780
16780
  if (eb) {
16781
- _context16.next = 27;
16781
+ _context15.next = 27;
16782
16782
  break;
16783
16783
  }
16784
16784
  throw new ValidationError("Invalid endTime: ".concat(endTime));
@@ -16786,21 +16786,21 @@ function _typeof(o) {
16786
16786
  case 27:
16787
16787
  _loop3 = _regeneratorRuntime().mark((function _loop3() {
16788
16788
  var addr, url, data;
16789
- return _regeneratorRuntime().wrap((function _loop3$(_context15) {
16790
- while (1) switch (_context15.prev = _context15.next) {
16789
+ return _regeneratorRuntime().wrap((function _loop3$(_context14) {
16790
+ while (1) switch (_context14.prev = _context14.next) {
16791
16791
  case 0:
16792
16792
  addr = _ADDRS[_i10];
16793
16793
  url = "https://api.etherscan.io/v2/api?chainid=".concat(chainId) + "&module=account&action=tokentx&address=".concat(addr) + "&startblock=".concat(sb, "&endblock=").concat(eb) + "&page=".concat(page, "&offset=").concat(offset, "&sort=asc&apikey=").concat(apiKey);
16794
- _context15.next = 4;
16794
+ _context14.next = 4;
16795
16795
  return fetchJSON(url);
16796
16796
 
16797
16797
  case 4:
16798
- data = _context15.sent;
16798
+ data = _context14.sent;
16799
16799
  if (Array.isArray(data)) {
16800
- _context15.next = 7;
16800
+ _context14.next = 7;
16801
16801
  break;
16802
16802
  }
16803
- return _context15.abrupt("return", {
16803
+ return _context14.abrupt("return", {
16804
16804
  v: {
16805
16805
  v: data
16806
16806
  }
@@ -16817,7 +16817,7 @@ function _typeof(o) {
16817
16817
 
16818
16818
  case 8:
16819
16819
  case "end":
16820
- return _context15.stop();
16820
+ return _context14.stop();
16821
16821
  }
16822
16822
  }), _loop3);
16823
16823
  }));
@@ -16825,27 +16825,27 @@ function _typeof(o) {
16825
16825
 
16826
16826
  case 29:
16827
16827
  if (!(_i10 < _ADDRS.length)) {
16828
- _context16.next = 37;
16828
+ _context15.next = 37;
16829
16829
  break;
16830
16830
  }
16831
- return _context16.delegateYield(_loop3(), "t1", 31);
16831
+ return _context15.delegateYield(_loop3(), "t1", 31);
16832
16832
 
16833
16833
  case 31:
16834
- _ret3 = _context16.t1;
16834
+ _ret3 = _context15.t1;
16835
16835
  if (!_ret3) {
16836
- _context16.next = 34;
16836
+ _context15.next = 34;
16837
16837
  break;
16838
16838
  }
16839
- return _context16.abrupt("return", _ret3.v);
16839
+ return _context15.abrupt("return", _ret3.v);
16840
16840
 
16841
16841
  case 34:
16842
16842
  _i10++;
16843
- _context16.next = 29;
16843
+ _context15.next = 29;
16844
16844
  break;
16845
16845
 
16846
16846
  case 37:
16847
16847
  case "end":
16848
- return _context16.stop();
16848
+ return _context15.stop();
16849
16849
  }
16850
16850
  }), _loop);
16851
16851
  }));
@@ -16853,50 +16853,50 @@ function _typeof(o) {
16853
16853
 
16854
16854
  case 37:
16855
16855
  if ((_step42 = _iterator42.n()).done) {
16856
- _context17.next = 44;
16856
+ _context16.next = 44;
16857
16857
  break;
16858
16858
  }
16859
- return _context17.delegateYield(_loop(), "t1", 39);
16859
+ return _context16.delegateYield(_loop(), "t1", 39);
16860
16860
 
16861
16861
  case 39:
16862
- _ret = _context17.t1;
16862
+ _ret = _context16.t1;
16863
16863
  if (!_ret) {
16864
- _context17.next = 42;
16864
+ _context16.next = 42;
16865
16865
  break;
16866
16866
  }
16867
- return _context17.abrupt("return", _ret.v);
16867
+ return _context16.abrupt("return", _ret.v);
16868
16868
 
16869
16869
  case 42:
16870
- _context17.next = 37;
16870
+ _context16.next = 37;
16871
16871
  break;
16872
16872
 
16873
16873
  case 44:
16874
- _context17.next = 49;
16874
+ _context16.next = 49;
16875
16875
  break;
16876
16876
 
16877
16877
  case 46:
16878
- _context17.prev = 46;
16879
- _context17.t2 = _context17["catch"](34);
16880
- _iterator42.e(_context17.t2);
16878
+ _context16.prev = 46;
16879
+ _context16.t2 = _context16["catch"](34);
16880
+ _iterator42.e(_context16.t2);
16881
16881
 
16882
16882
  case 49:
16883
- _context17.prev = 49;
16883
+ _context16.prev = 49;
16884
16884
  _iterator42.f();
16885
- return _context17.finish(49);
16885
+ return _context16.finish(49);
16886
16886
 
16887
16887
  case 52:
16888
- return _context17.abrupt("return", out);
16888
+ return _context16.abrupt("return", out);
16889
16889
 
16890
16890
  case 55:
16891
- _context17.prev = 55;
16892
- _context17.t3 = _context17["catch"](0);
16893
- return _context17.abrupt("return", errorMessageHandler(_context17.t3, "EOA"));
16891
+ _context16.prev = 55;
16892
+ _context16.t3 = _context16["catch"](0);
16893
+ return _context16.abrupt("return", errorMessageHandler(_context16.t3, "EOA"));
16894
16894
 
16895
16895
  case 58:
16896
16896
  case "end":
16897
- return _context17.stop();
16897
+ return _context16.stop();
16898
16898
  }
16899
- }), _callee14, null, [ [ 0, 55 ], [ 9, 25, 28, 31 ], [ 34, 46, 49, 52 ] ]);
16899
+ }), _callee13, null, [ [ 0, 55 ], [ 9, 25, 28, 31 ], [ 34, 46, 49, 52 ] ]);
16900
16900
  })));
16901
16901
  return _EOA.apply(this, arguments);
16902
16902
  }
@@ -16924,10 +16924,10 @@ function _typeof(o) {
16924
16924
  return _handleScanRequest.apply(this, arguments);
16925
16925
  }
16926
16926
  function _handleScanRequest() {
16927
- _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15(_ref13) {
16927
+ _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee14(_ref13) {
16928
16928
  var type, address, startDate, endDate, _ref13$page, page, _ref13$offset, offset, apiKey, functionName, chainId, network, API_INFO_MAP, apiInfo, baseUrl, ACTION_MAP, action, module, url, _yield$Promise$all, _yield$Promise$all2, startBlock, endBlock, _getUrlAndHeaders4, finalUrl, HEADERS, res, json;
16929
- return _regeneratorRuntime().wrap((function _callee15$(_context18) {
16930
- while (1) switch (_context18.prev = _context18.next) {
16929
+ return _regeneratorRuntime().wrap((function _callee14$(_context17) {
16930
+ while (1) switch (_context17.prev = _context17.next) {
16931
16931
  case 0:
16932
16932
  type = _ref13.type, address = _ref13.address, startDate = _ref13.startDate, endDate = _ref13.endDate,
16933
16933
  _ref13$page = _ref13.page, page = _ref13$page === void 0 ? 1 : _ref13$page, _ref13$offset = _ref13.offset,
@@ -16948,20 +16948,20 @@ function _typeof(o) {
16948
16948
  }
16949
16949
  };
16950
16950
  if (!(type !== "gas")) {
16951
- _context18.next = 6;
16951
+ _context17.next = 6;
16952
16952
  break;
16953
16953
  }
16954
- _context18.next = 5;
16954
+ _context17.next = 5;
16955
16955
  return fromEnsNameToAddress$1.validateAndGetAddress(address);
16956
16956
 
16957
16957
  case 5:
16958
- address = _context18.sent;
16958
+ address = _context17.sent;
16959
16959
 
16960
16960
  case 6:
16961
16961
  apiInfo = API_INFO_MAP[functionName];
16962
16962
  baseUrl = apiInfo === null || apiInfo === void 0 ? void 0 : apiInfo.url;
16963
16963
  if (baseUrl) {
16964
- _context18.next = 10;
16964
+ _context17.next = 10;
16965
16965
  break;
16966
16966
  }
16967
16967
  throw new ValidationError("Api not found for: ".concat(functionName));
@@ -16975,7 +16975,7 @@ function _typeof(o) {
16975
16975
  };
16976
16976
  action = ACTION_MAP[type];
16977
16977
  if (action) {
16978
- _context18.next = 14;
16978
+ _context17.next = 14;
16979
16979
  break;
16980
16980
  }
16981
16981
  throw new ValidationError("Invalid type: ".concat(type));
@@ -16984,19 +16984,19 @@ function _typeof(o) {
16984
16984
  module = action === "gasoracle" ? "gastracker" : "account";
16985
16985
  url = "".concat(baseUrl, "?chainid=").concat(chainId, "&module=").concat(module, "&action=").concat(action, "&apikey=").concat(apiKey);
16986
16986
  if (![ "all-txns", "token-txns", "nft-txns" ].includes(type)) {
16987
- _context18.next = 27;
16987
+ _context17.next = 27;
16988
16988
  break;
16989
16989
  }
16990
16990
  url += "&address=".concat(address, "&startblock=0&endblock=99999999&sort=asc");
16991
16991
  if (!(!isNaN(startDate) && !isNaN(endDate))) {
16992
- _context18.next = 26;
16992
+ _context17.next = 26;
16993
16993
  break;
16994
16994
  }
16995
- _context18.next = 21;
16995
+ _context17.next = 21;
16996
16996
  return Promise.all([ fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startDate), network, apiKey), fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endDate), network, apiKey) ]);
16997
16997
 
16998
16998
  case 21:
16999
- _yield$Promise$all = _context18.sent;
16999
+ _yield$Promise$all = _context17.sent;
17000
17000
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
17001
17001
  startBlock = _yield$Promise$all2[0];
17002
17002
  endBlock = _yield$Promise$all2[1];
@@ -17011,51 +17011,51 @@ function _typeof(o) {
17011
17011
  serviceName: apiInfo.apiKeyName,
17012
17012
  headers: {}
17013
17013
  }), finalUrl = _getUrlAndHeaders4.URL, HEADERS = _getUrlAndHeaders4.HEADERS;
17014
- _context18.next = 30;
17014
+ _context17.next = 30;
17015
17015
  return fetch(finalUrl, {
17016
17016
  method: "GET",
17017
17017
  headers: HEADERS
17018
17018
  });
17019
17019
 
17020
17020
  case 30:
17021
- res = _context18.sent;
17021
+ res = _context17.sent;
17022
17022
  if (res.ok) {
17023
- _context18.next = 33;
17023
+ _context17.next = 33;
17024
17024
  break;
17025
17025
  }
17026
17026
  throw new NetworkError(apiInfo.apiKeyName, res.status);
17027
17027
 
17028
17028
  case 33:
17029
- _context18.next = 35;
17029
+ _context17.next = 35;
17030
17030
  return res.json();
17031
17031
 
17032
17032
  case 35:
17033
- json = _context18.sent;
17033
+ json = _context17.sent;
17034
17034
  if (!(typeof json.result === "string")) {
17035
- _context18.next = 41;
17035
+ _context17.next = 41;
17036
17036
  break;
17037
17037
  }
17038
17038
  if (!json.result.includes("Invalid API Key")) {
17039
- _context18.next = 39;
17039
+ _context17.next = 39;
17040
17040
  break;
17041
17041
  }
17042
17042
  throw new InvalidApiKeyError(apiInfo.apiKeyName);
17043
17043
 
17044
17044
  case 39:
17045
17045
  if (!json.result.includes("Max rate limit reached")) {
17046
- _context18.next = 41;
17046
+ _context17.next = 41;
17047
17047
  break;
17048
17048
  }
17049
17049
  throw new RateLimitError(apiInfo.apiKeyName);
17050
17050
 
17051
17051
  case 41:
17052
- return _context18.abrupt("return", type === "gas" && !Array.isArray(json.result) ? [ json.result ] : json.result);
17052
+ return _context17.abrupt("return", type === "gas" && !Array.isArray(json.result) ? [ json.result ] : json.result);
17053
17053
 
17054
17054
  case 42:
17055
17055
  case "end":
17056
- return _context18.stop();
17056
+ return _context17.stop();
17057
17057
  }
17058
- }), _callee15);
17058
+ }), _callee14);
17059
17059
  })));
17060
17060
  return _handleScanRequest.apply(this, arguments);
17061
17061
  }
@@ -17063,13 +17063,13 @@ function _typeof(o) {
17063
17063
  return _BASE.apply(this, arguments);
17064
17064
  }
17065
17065
  function _BASE() {
17066
- _BASE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee16() {
17067
- var _argsToArray7, _argsToArray8, type, address, startDate, endDate, page, limit, API_KEY, _args19 = arguments;
17068
- return _regeneratorRuntime().wrap((function _callee16$(_context19) {
17069
- while (1) switch (_context19.prev = _context19.next) {
17066
+ _BASE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15() {
17067
+ var _argsToArray7, _argsToArray8, type, address, startDate, endDate, page, limit, API_KEY, _args18 = arguments;
17068
+ return _regeneratorRuntime().wrap((function _callee15$(_context18) {
17069
+ while (1) switch (_context18.prev = _context18.next) {
17070
17070
  case 0:
17071
- _context19.prev = 0;
17072
- _argsToArray7 = argsToArray(_args19), _argsToArray8 = _slicedToArray(_argsToArray7, 6),
17071
+ _context18.prev = 0;
17072
+ _argsToArray7 = argsToArray(_args18), _argsToArray8 = _slicedToArray(_argsToArray7, 6),
17073
17073
  type = _argsToArray8[0], address = _argsToArray8[1], startDate = _argsToArray8[2],
17074
17074
  endDate = _argsToArray8[3], page = _argsToArray8[4], limit = _argsToArray8[5];
17075
17075
  validateParams(baseParamsSchema, {
@@ -17081,7 +17081,7 @@ function _typeof(o) {
17081
17081
  limit: limit
17082
17082
  });
17083
17083
  API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Basescan);
17084
- _context19.next = 6;
17084
+ _context18.next = 6;
17085
17085
  return handleScanRequest({
17086
17086
  type: type,
17087
17087
  address: address,
@@ -17096,18 +17096,18 @@ function _typeof(o) {
17096
17096
  });
17097
17097
 
17098
17098
  case 6:
17099
- return _context19.abrupt("return", _context19.sent);
17099
+ return _context18.abrupt("return", _context18.sent);
17100
17100
 
17101
17101
  case 9:
17102
- _context19.prev = 9;
17103
- _context19.t0 = _context19["catch"](0);
17104
- return _context19.abrupt("return", errorMessageHandler(_context19.t0, "BASE"));
17102
+ _context18.prev = 9;
17103
+ _context18.t0 = _context18["catch"](0);
17104
+ return _context18.abrupt("return", errorMessageHandler(_context18.t0, "BASE"));
17105
17105
 
17106
17106
  case 12:
17107
17107
  case "end":
17108
- return _context19.stop();
17108
+ return _context18.stop();
17109
17109
  }
17110
- }), _callee16, null, [ [ 0, 9 ] ]);
17110
+ }), _callee15, null, [ [ 0, 9 ] ]);
17111
17111
  })));
17112
17112
  return _BASE.apply(this, arguments);
17113
17113
  }
@@ -17126,13 +17126,13 @@ function _typeof(o) {
17126
17126
  return _BLOCKSCOUT.apply(this, arguments);
17127
17127
  }
17128
17128
  function _BLOCKSCOUT() {
17129
- _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
17130
- var _json$result, _json$result2, _argsToArray9, _argsToArray0, address, type, _argsToArray0$, chain, startTimestamp, endTimestamp, page, offset, startTs, endTs, resolvedAddress, hostname, requestUrl, response, json, _args20 = arguments;
17131
- return _regeneratorRuntime().wrap((function _callee17$(_context20) {
17132
- while (1) switch (_context20.prev = _context20.next) {
17129
+ _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee16() {
17130
+ var _json$result, _json$result2, _argsToArray9, _argsToArray0, address, type, _argsToArray0$, chain, startTimestamp, endTimestamp, page, offset, startTs, endTs, resolvedAddress, hostname, requestUrl, response, json, _args19 = arguments;
17131
+ return _regeneratorRuntime().wrap((function _callee16$(_context19) {
17132
+ while (1) switch (_context19.prev = _context19.next) {
17133
17133
  case 0:
17134
- _context20.prev = 0;
17135
- _argsToArray9 = argsToArray(_args20), _argsToArray0 = _slicedToArray(_argsToArray9, 7),
17134
+ _context19.prev = 0;
17135
+ _argsToArray9 = argsToArray(_args19), _argsToArray0 = _slicedToArray(_argsToArray9, 7),
17136
17136
  address = _argsToArray0[0], type = _argsToArray0[1], _argsToArray0$ = _argsToArray0[2],
17137
17137
  chain = _argsToArray0$ === void 0 ? "ethereum" : _argsToArray0$, startTimestamp = _argsToArray0[3],
17138
17138
  endTimestamp = _argsToArray0[4], page = _argsToArray0[5], offset = _argsToArray0[6];
@@ -17147,72 +17147,72 @@ function _typeof(o) {
17147
17147
  });
17148
17148
  startTs = startTimestamp !== null && startTimestamp !== void 0 ? startTimestamp : Math.floor((Date.now() - 30 * 24 * 3600 * 1e3) / 1e3);
17149
17149
  endTs = endTimestamp;
17150
- _context20.next = 7;
17150
+ _context19.next = 7;
17151
17151
  return fromEnsNameToAddress$1.validateAndGetAddress(address);
17152
17152
 
17153
17153
  case 7:
17154
- resolvedAddress = _context20.sent;
17154
+ resolvedAddress = _context19.sent;
17155
17155
  hostname = BLOCKSCOUT_CHAINS_MAP[chain];
17156
- _context20.t0 = type;
17157
- _context20.next = _context20.t0 === "stat" ? 12 : _context20.t0 === "txns" ? 14 : _context20.t0 === "tokens" ? 16 : 18;
17156
+ _context19.t0 = type;
17157
+ _context19.next = _context19.t0 === "stat" ? 12 : _context19.t0 === "txns" ? 14 : _context19.t0 === "tokens" ? 16 : 18;
17158
17158
  break;
17159
17159
 
17160
17160
  case 12:
17161
17161
  requestUrl = "".concat(hostname, "/api/v2/addresses/").concat(resolvedAddress, "/counters");
17162
- return _context20.abrupt("break", 18);
17162
+ return _context19.abrupt("break", 18);
17163
17163
 
17164
17164
  case 14:
17165
17165
  requestUrl = "".concat(hostname, "/api?module=account&action=txlist") + "&address=".concat(resolvedAddress) + "&start_timestamp=".concat(startTs) + "&end_timestamp=".concat(endTs !== null && endTs !== void 0 ? endTs : "") + "&page=".concat(page) + "&offset=".concat(offset) + "&sort=asc";
17166
- return _context20.abrupt("break", 18);
17166
+ return _context19.abrupt("break", 18);
17167
17167
 
17168
17168
  case 16:
17169
17169
  requestUrl = "".concat(hostname, "/api?module=account&action=tokenlist") + "&address=".concat(resolvedAddress);
17170
- return _context20.abrupt("break", 18);
17170
+ return _context19.abrupt("break", 18);
17171
17171
 
17172
17172
  case 18:
17173
- _context20.next = 20;
17173
+ _context19.next = 20;
17174
17174
  return fetch(requestUrl);
17175
17175
 
17176
17176
  case 20:
17177
- response = _context20.sent;
17177
+ response = _context19.sent;
17178
17178
  if (response.ok) {
17179
- _context20.next = 23;
17179
+ _context19.next = 23;
17180
17180
  break;
17181
17181
  }
17182
17182
  throw new NetworkError("BLOCKSCOUT", response.status);
17183
17183
 
17184
17184
  case 23:
17185
- _context20.next = 25;
17185
+ _context19.next = 25;
17186
17186
  return response.json();
17187
17187
 
17188
17188
  case 25:
17189
- json = _context20.sent;
17189
+ json = _context19.sent;
17190
17190
  if (!(json !== null && json !== void 0 && (_json$result = json.result) !== null && _json$result !== void 0 && _json$result.includes("Invalid parameter(s)"))) {
17191
- _context20.next = 28;
17191
+ _context19.next = 28;
17192
17192
  break;
17193
17193
  }
17194
17194
  throw new ValidationError("Invalid parameters");
17195
17195
 
17196
17196
  case 28:
17197
17197
  if (!(json !== null && json !== void 0 && (_json$result2 = json.result) !== null && _json$result2 !== void 0 && _json$result2.includes("Not found"))) {
17198
- _context20.next = 30;
17198
+ _context19.next = 30;
17199
17199
  break;
17200
17200
  }
17201
17201
  throw new ValidationError("Address information not found");
17202
17202
 
17203
17203
  case 30:
17204
- return _context20.abrupt("return", type === "stat" ? [ json ] : json.result);
17204
+ return _context19.abrupt("return", type === "stat" ? [ json ] : json.result);
17205
17205
 
17206
17206
  case 33:
17207
- _context20.prev = 33;
17208
- _context20.t1 = _context20["catch"](0);
17209
- return _context20.abrupt("return", errorMessageHandler(_context20.t1, "BLOCKSCOUT"));
17207
+ _context19.prev = 33;
17208
+ _context19.t1 = _context19["catch"](0);
17209
+ return _context19.abrupt("return", errorMessageHandler(_context19.t1, "BLOCKSCOUT"));
17210
17210
 
17211
17211
  case 36:
17212
17212
  case "end":
17213
- return _context20.stop();
17213
+ return _context19.stop();
17214
17214
  }
17215
- }), _callee17, null, [ [ 0, 33 ] ]);
17215
+ }), _callee16, null, [ [ 0, 33 ] ]);
17216
17216
  })));
17217
17217
  return _BLOCKSCOUT.apply(this, arguments);
17218
17218
  }
@@ -17256,13 +17256,13 @@ function _typeof(o) {
17256
17256
  return _COINGECKO.apply(this, arguments);
17257
17257
  }
17258
17258
  function _COINGECKO() {
17259
- _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee18() {
17260
- var _category$toLowerCase, _argsToArray1, _argsToArray10, category, param1, param2, apiKey, headers, url, vs, map, _category, trend, _category2, _trend, _getUrlAndHeaders5, finalUrl, HEADERS, res, json, _json$status, msg, out, _i11, _Object$entries, _Object$entries$_i, token, prices, _i12, _Object$entries2, _Object$entries2$_i, cur, val, _data, _args21 = arguments;
17261
- return _regeneratorRuntime().wrap((function _callee18$(_context21) {
17262
- while (1) switch (_context21.prev = _context21.next) {
17259
+ _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
17260
+ var _category$toLowerCase, _argsToArray1, _argsToArray10, category, param1, param2, apiKey, headers, url, vs, map, _category, trend, _category2, _trend, _getUrlAndHeaders5, finalUrl, HEADERS, res, json, _json$status, msg, out, _i11, _Object$entries, _Object$entries$_i, token, prices, _i12, _Object$entries2, _Object$entries2$_i, cur, val, _data, _args20 = arguments;
17261
+ return _regeneratorRuntime().wrap((function _callee17$(_context20) {
17262
+ while (1) switch (_context20.prev = _context20.next) {
17263
17263
  case 0:
17264
- _context21.prev = 0;
17265
- _argsToArray1 = argsToArray(_args21), _argsToArray10 = _slicedToArray(_argsToArray1, 3),
17264
+ _context20.prev = 0;
17265
+ _argsToArray1 = argsToArray(_args20), _argsToArray10 = _slicedToArray(_argsToArray1, 3),
17266
17266
  category = _argsToArray10[0], param1 = _argsToArray10[1], param2 = _argsToArray10[2];
17267
17267
  validateParams(coingeckoParamsSchema, {
17268
17268
  category: category,
@@ -17275,14 +17275,14 @@ function _typeof(o) {
17275
17275
  "x-cg-demo-api-key": apiKey
17276
17276
  };
17277
17277
  url = "";
17278
- _context21.t0 = category === null || category === void 0 || (_category$toLowerCase = category.toLowerCase) === null || _category$toLowerCase === void 0 ? void 0 : _category$toLowerCase.call(category);
17279
- _context21.next = _context21.t0 === "price" ? 9 : _context21.t0 === "market" ? 12 : _context21.t0 === "stablecoins" ? 17 : _context21.t0 === "derivatives" ? 21 : 23;
17278
+ _context20.t0 = category === null || category === void 0 || (_category$toLowerCase = category.toLowerCase) === null || _category$toLowerCase === void 0 ? void 0 : _category$toLowerCase.call(category);
17279
+ _context20.next = _context20.t0 === "price" ? 9 : _context20.t0 === "market" ? 12 : _context20.t0 === "stablecoins" ? 17 : _context20.t0 === "derivatives" ? 21 : 23;
17280
17280
  break;
17281
17281
 
17282
17282
  case 9:
17283
17283
  vs = param2 || "usd";
17284
17284
  url = "https://api.coingecko.com/api/v3/simple/price?vs_currencies=".concat(vs, "&symbols=").concat(param1);
17285
- return _context21.abrupt("break", 23);
17285
+ return _context20.abrupt("break", 23);
17286
17286
 
17287
17287
  case 12:
17288
17288
  map = {
@@ -17299,17 +17299,17 @@ function _typeof(o) {
17299
17299
  _category = map[param1] || "";
17300
17300
  trend = param2 ? "&price_change_percentage=".concat(param2) : "";
17301
17301
  url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=1&per_page=100".concat(_category ? "&category=".concat(_category) : "").concat(trend);
17302
- return _context21.abrupt("break", 23);
17302
+ return _context20.abrupt("break", 23);
17303
17303
 
17304
17304
  case 17:
17305
17305
  _category2 = param1 === "all" ? "stablecoins" : param1;
17306
17306
  _trend = param2 ? "&price_change_percentage=".concat(param2) : "";
17307
17307
  url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&category=".concat(_category2, "&order=market_cap_desc&page=1&per_page=100").concat(_trend);
17308
- return _context21.abrupt("break", 23);
17308
+ return _context20.abrupt("break", 23);
17309
17309
 
17310
17310
  case 21:
17311
17311
  url = !param1 || param1 === "all" ? "https://api.coingecko.com/api/v3/derivatives" : "https://api.coingecko.com/api/v3/derivatives/exchanges/".concat(param1, "?include_tickers=all");
17312
- return _context21.abrupt("break", 23);
17312
+ return _context20.abrupt("break", 23);
17313
17313
 
17314
17314
  case 23:
17315
17315
  _getUrlAndHeaders5 = getUrlAndHeaders({
@@ -17317,25 +17317,25 @@ function _typeof(o) {
17317
17317
  serviceName: "Coingecko",
17318
17318
  headers: headers
17319
17319
  }), finalUrl = _getUrlAndHeaders5.URL, HEADERS = _getUrlAndHeaders5.HEADERS;
17320
- _context21.next = 26;
17320
+ _context20.next = 26;
17321
17321
  return fetch(finalUrl, {
17322
17322
  headers: HEADERS
17323
17323
  });
17324
17324
 
17325
17325
  case 26:
17326
- res = _context21.sent;
17327
- _context21.next = 29;
17326
+ res = _context20.sent;
17327
+ _context20.next = 29;
17328
17328
  return res.json();
17329
17329
 
17330
17330
  case 29:
17331
- json = _context21.sent;
17331
+ json = _context20.sent;
17332
17332
  if (res.ok) {
17333
- _context21.next = 35;
17333
+ _context20.next = 35;
17334
17334
  break;
17335
17335
  }
17336
17336
  msg = (json === null || json === void 0 || (_json$status = json.status) === null || _json$status === void 0 ? void 0 : _json$status.error_message) || "";
17337
17337
  if (!msg.includes("API Key Missing")) {
17338
- _context21.next = 34;
17338
+ _context20.next = 34;
17339
17339
  break;
17340
17340
  }
17341
17341
  throw new InvalidApiKeyError(SERVICES_API_KEY.Coingecko);
@@ -17345,7 +17345,7 @@ function _typeof(o) {
17345
17345
 
17346
17346
  case 35:
17347
17347
  if (!(category === "price")) {
17348
- _context21.next = 39;
17348
+ _context20.next = 39;
17349
17349
  break;
17350
17350
  }
17351
17351
  out = {};
@@ -17358,11 +17358,11 @@ function _typeof(o) {
17358
17358
  out["".concat(token.charAt(0).toUpperCase() + token.slice(1), "_").concat(cur.toUpperCase())] = val;
17359
17359
  }
17360
17360
  }
17361
- return _context21.abrupt("return", [ out ]);
17361
+ return _context20.abrupt("return", [ out ]);
17362
17362
 
17363
17363
  case 39:
17364
17364
  _data = Array.isArray(json) ? json : [ json ];
17365
- return _context21.abrupt("return", _data.map((function(item) {
17365
+ return _context20.abrupt("return", _data.map((function(item) {
17366
17366
  var flat = {};
17367
17367
  for (var _i13 = 0, _Object$entries3 = Object.entries(item); _i13 < _Object$entries3.length; _i13++) {
17368
17368
  var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i13], 2), key = _Object$entries3$_i[0], _value11 = _Object$entries3$_i[1];
@@ -17374,15 +17374,15 @@ function _typeof(o) {
17374
17374
  })));
17375
17375
 
17376
17376
  case 43:
17377
- _context21.prev = 43;
17378
- _context21.t1 = _context21["catch"](0);
17379
- return _context21.abrupt("return", errorMessageHandler(_context21.t1, "COINGECKO"));
17377
+ _context20.prev = 43;
17378
+ _context20.t1 = _context20["catch"](0);
17379
+ return _context20.abrupt("return", errorMessageHandler(_context20.t1, "COINGECKO"));
17380
17380
 
17381
17381
  case 46:
17382
17382
  case "end":
17383
- return _context21.stop();
17383
+ return _context20.stop();
17384
17384
  }
17385
- }), _callee18, null, [ [ 0, 43 ] ]);
17385
+ }), _callee17, null, [ [ 0, 43 ] ]);
17386
17386
  })));
17387
17387
  return _COINGECKO.apply(this, arguments);
17388
17388
  }
@@ -17400,60 +17400,60 @@ function _typeof(o) {
17400
17400
  return _DEFILLAMA.apply(this, arguments);
17401
17401
  }
17402
17402
  function _DEFILLAMA() {
17403
- _DEFILLAMA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee19() {
17404
- var _argsToArray11, _argsToArray12, category, url, res, json, _args22 = arguments;
17405
- return _regeneratorRuntime().wrap((function _callee19$(_context22) {
17406
- while (1) switch (_context22.prev = _context22.next) {
17403
+ _DEFILLAMA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee18() {
17404
+ var _argsToArray11, _argsToArray12, category, url, res, json, _args21 = arguments;
17405
+ return _regeneratorRuntime().wrap((function _callee18$(_context21) {
17406
+ while (1) switch (_context21.prev = _context21.next) {
17407
17407
  case 0:
17408
- _context22.prev = 0;
17409
- _argsToArray11 = argsToArray(_args22), _argsToArray12 = _slicedToArray(_argsToArray11, 1),
17408
+ _context21.prev = 0;
17409
+ _argsToArray11 = argsToArray(_args21), _argsToArray12 = _slicedToArray(_argsToArray11, 1),
17410
17410
  category = _argsToArray12[0];
17411
17411
  validateParams(defillamaParamsSchema, {
17412
17412
  category: category
17413
17413
  });
17414
17414
  url = CATEGORY_URLS[category];
17415
17415
  if (url) {
17416
- _context22.next = 6;
17416
+ _context21.next = 6;
17417
17417
  break;
17418
17418
  }
17419
17419
  throw new ValidationError("Invalid category: ".concat(category));
17420
17420
 
17421
17421
  case 6:
17422
- _context22.next = 8;
17422
+ _context21.next = 8;
17423
17423
  return fetch(url);
17424
17424
 
17425
17425
  case 8:
17426
- res = _context22.sent;
17426
+ res = _context21.sent;
17427
17427
  if (res.ok) {
17428
- _context22.next = 11;
17428
+ _context21.next = 11;
17429
17429
  break;
17430
17430
  }
17431
17431
  throw new NetworkError(SERVICES_API_KEY.Defillama, res.status);
17432
17432
 
17433
17433
  case 11:
17434
- _context22.next = 13;
17434
+ _context21.next = 13;
17435
17435
  return res.json();
17436
17436
 
17437
17437
  case 13:
17438
- json = _context22.sent;
17439
- _context22.t0 = category;
17440
- _context22.next = _context22.t0 === "protocols" ? 17 : _context22.t0 === "yields" ? 19 : _context22.t0 === "dex" ? 21 : _context22.t0 === "fees" ? 21 : 23;
17438
+ json = _context21.sent;
17439
+ _context21.t0 = category;
17440
+ _context21.next = _context21.t0 === "protocols" ? 17 : _context21.t0 === "yields" ? 19 : _context21.t0 === "dex" ? 21 : _context21.t0 === "fees" ? 21 : 23;
17441
17441
  break;
17442
17442
 
17443
17443
  case 17:
17444
17444
  json = Array.isArray(json) ? json.slice(0, 500) : [];
17445
- return _context22.abrupt("break", 23);
17445
+ return _context21.abrupt("break", 23);
17446
17446
 
17447
17447
  case 19:
17448
17448
  json = Array.isArray(json.data) ? json.data.slice(0, 500) : [];
17449
- return _context22.abrupt("break", 23);
17449
+ return _context21.abrupt("break", 23);
17450
17450
 
17451
17451
  case 21:
17452
17452
  json = Array.isArray(json.protocols) ? json.protocols.slice(0, 500) : [];
17453
- return _context22.abrupt("break", 23);
17453
+ return _context21.abrupt("break", 23);
17454
17454
 
17455
17455
  case 23:
17456
- return _context22.abrupt("return", (Array.isArray(json) ? json : [ json ]).map((function(item) {
17456
+ return _context21.abrupt("return", (Array.isArray(json) ? json : [ json ]).map((function(item) {
17457
17457
  var out = {};
17458
17458
  for (var _i14 = 0, _Object$entries4 = Object.entries(item); _i14 < _Object$entries4.length; _i14++) {
17459
17459
  var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i14], 2), k = _Object$entries4$_i[0], v = _Object$entries4$_i[1];
@@ -17463,15 +17463,15 @@ function _typeof(o) {
17463
17463
  })));
17464
17464
 
17465
17465
  case 26:
17466
- _context22.prev = 26;
17467
- _context22.t1 = _context22["catch"](0);
17468
- return _context22.abrupt("return", errorMessageHandler(_context22.t1, "DEFILLAMA"));
17466
+ _context21.prev = 26;
17467
+ _context21.t1 = _context21["catch"](0);
17468
+ return _context21.abrupt("return", errorMessageHandler(_context21.t1, "DEFILLAMA"));
17469
17469
 
17470
17470
  case 29:
17471
17471
  case "end":
17472
- return _context22.stop();
17472
+ return _context21.stop();
17473
17473
  }
17474
- }), _callee19, null, [ [ 0, 26 ] ]);
17474
+ }), _callee18, null, [ [ 0, 26 ] ]);
17475
17475
  })));
17476
17476
  return _DEFILLAMA.apply(this, arguments);
17477
17477
  }
@@ -17500,13 +17500,13 @@ function _typeof(o) {
17500
17500
  return _ETHERSCAN.apply(this, arguments);
17501
17501
  }
17502
17502
  function _ETHERSCAN() {
17503
- _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20() {
17504
- var _argsToArray13, _argsToArray14, type, chain, address, startDate, endDate, _argsToArray14$, page, _argsToArray14$2, limit, chainId, apiKey, _args23 = arguments;
17505
- return _regeneratorRuntime().wrap((function _callee20$(_context23) {
17506
- while (1) switch (_context23.prev = _context23.next) {
17503
+ _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee19() {
17504
+ var _argsToArray13, _argsToArray14, type, chain, address, startDate, endDate, _argsToArray14$, page, _argsToArray14$2, limit, chainId, apiKey, _args22 = arguments;
17505
+ return _regeneratorRuntime().wrap((function _callee19$(_context22) {
17506
+ while (1) switch (_context22.prev = _context22.next) {
17507
17507
  case 0:
17508
- _context23.prev = 0;
17509
- _argsToArray13 = argsToArray(_args23), _argsToArray14 = _slicedToArray(_argsToArray13, 7),
17508
+ _context22.prev = 0;
17509
+ _argsToArray13 = argsToArray(_args22), _argsToArray14 = _slicedToArray(_argsToArray13, 7),
17510
17510
  type = _argsToArray14[0], chain = _argsToArray14[1], address = _argsToArray14[2],
17511
17511
  startDate = _argsToArray14[3], endDate = _argsToArray14[4], _argsToArray14$ = _argsToArray14[5],
17512
17512
  page = _argsToArray14$ === void 0 ? 1 : _argsToArray14$, _argsToArray14$2 = _argsToArray14[6],
@@ -17522,14 +17522,14 @@ function _typeof(o) {
17522
17522
  });
17523
17523
  chainId = CHAIN_ID_MAP[chain];
17524
17524
  if (chainId) {
17525
- _context23.next = 6;
17525
+ _context22.next = 6;
17526
17526
  break;
17527
17527
  }
17528
17528
  throw new ValidationError("Invalid chain: ".concat(chain));
17529
17529
 
17530
17530
  case 6:
17531
17531
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Etherscan);
17532
- _context23.next = 9;
17532
+ _context22.next = 9;
17533
17533
  return handleScanRequest({
17534
17534
  type: type,
17535
17535
  address: address,
@@ -17544,18 +17544,18 @@ function _typeof(o) {
17544
17544
  });
17545
17545
 
17546
17546
  case 9:
17547
- return _context23.abrupt("return", _context23.sent);
17547
+ return _context22.abrupt("return", _context22.sent);
17548
17548
 
17549
17549
  case 12:
17550
- _context23.prev = 12;
17551
- _context23.t0 = _context23["catch"](0);
17552
- return _context23.abrupt("return", errorMessageHandler(_context23.t0, "ETHERSCAN"));
17550
+ _context22.prev = 12;
17551
+ _context22.t0 = _context22["catch"](0);
17552
+ return _context22.abrupt("return", errorMessageHandler(_context22.t0, "ETHERSCAN"));
17553
17553
 
17554
17554
  case 15:
17555
17555
  case "end":
17556
- return _context23.stop();
17556
+ return _context22.stop();
17557
17557
  }
17558
- }), _callee20, null, [ [ 0, 12 ] ]);
17558
+ }), _callee19, null, [ [ 0, 12 ] ]);
17559
17559
  })));
17560
17560
  return _ETHERSCAN.apply(this, arguments);
17561
17561
  }
@@ -17571,13 +17571,13 @@ function _typeof(o) {
17571
17571
  return _FARCASTER.apply(this, arguments);
17572
17572
  }
17573
17573
  function _FARCASTER() {
17574
- _FARCASTER = _asyncToGenerator(_regeneratorRuntime().mark((function _callee21() {
17575
- var _argsToArray15, _argsToArray16, contentType, identifier, _argsToArray16$, start, _argsToArray16$2, end, apiKey, url, typeMap, _getUrlAndHeaders6, finalUrl, HEADERS, response, _yield$response$json, _data2, _args24 = arguments;
17576
- return _regeneratorRuntime().wrap((function _callee21$(_context24) {
17577
- while (1) switch (_context24.prev = _context24.next) {
17574
+ _FARCASTER = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20() {
17575
+ var _argsToArray15, _argsToArray16, contentType, identifier, _argsToArray16$, start, _argsToArray16$2, end, apiKey, url, typeMap, _getUrlAndHeaders6, finalUrl, HEADERS, response, _yield$response$json, _data2, _args23 = arguments;
17576
+ return _regeneratorRuntime().wrap((function _callee20$(_context23) {
17577
+ while (1) switch (_context23.prev = _context23.next) {
17578
17578
  case 0:
17579
- _context24.prev = 0;
17580
- _argsToArray15 = argsToArray(_args24), _argsToArray16 = _slicedToArray(_argsToArray15, 4),
17579
+ _context23.prev = 0;
17580
+ _argsToArray15 = argsToArray(_args23), _argsToArray16 = _slicedToArray(_argsToArray15, 4),
17581
17581
  contentType = _argsToArray16[0], identifier = _argsToArray16[1], _argsToArray16$ = _argsToArray16[2],
17582
17582
  start = _argsToArray16$ === void 0 ? 0 : _argsToArray16$, _argsToArray16$2 = _argsToArray16[3],
17583
17583
  end = _argsToArray16$2 === void 0 ? 10 : _argsToArray16$2;
@@ -17607,35 +17607,35 @@ function _typeof(o) {
17607
17607
  "x-api-key": apiKey
17608
17608
  }
17609
17609
  }), finalUrl = _getUrlAndHeaders6.URL, HEADERS = _getUrlAndHeaders6.HEADERS;
17610
- _context24.next = 13;
17610
+ _context23.next = 13;
17611
17611
  return fetch(finalUrl, {
17612
17612
  method: "GET",
17613
17613
  headers: HEADERS
17614
17614
  });
17615
17615
 
17616
17616
  case 13:
17617
- response = _context24.sent;
17617
+ response = _context23.sent;
17618
17618
  if (response.ok) {
17619
- _context24.next = 16;
17619
+ _context23.next = 16;
17620
17620
  break;
17621
17621
  }
17622
17622
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
17623
17623
 
17624
17624
  case 16:
17625
- _context24.next = 18;
17625
+ _context23.next = 18;
17626
17626
  return response.json();
17627
17627
 
17628
17628
  case 18:
17629
- _yield$response$json = _context24.sent;
17629
+ _yield$response$json = _context23.sent;
17630
17630
  _data2 = _yield$response$json.data;
17631
17631
  if (Array.isArray(_data2)) {
17632
- _context24.next = 22;
17632
+ _context23.next = 22;
17633
17633
  break;
17634
17634
  }
17635
- return _context24.abrupt("return", []);
17635
+ return _context23.abrupt("return", []);
17636
17636
 
17637
17637
  case 22:
17638
- return _context24.abrupt("return", _data2.map((function(item) {
17638
+ return _context23.abrupt("return", _data2.map((function(item) {
17639
17639
  var flat = {};
17640
17640
  for (var _i15 = 0, _Object$entries5 = Object.entries(item); _i15 < _Object$entries5.length; _i15++) {
17641
17641
  var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i15], 2), k = _Object$entries5$_i[0], v = _Object$entries5$_i[1];
@@ -17648,15 +17648,15 @@ function _typeof(o) {
17648
17648
  })));
17649
17649
 
17650
17650
  case 25:
17651
- _context24.prev = 25;
17652
- _context24.t0 = _context24["catch"](0);
17653
- return _context24.abrupt("return", errorMessageHandler(_context24.t0, "FARCASTER"));
17651
+ _context23.prev = 25;
17652
+ _context23.t0 = _context23["catch"](0);
17653
+ return _context23.abrupt("return", errorMessageHandler(_context23.t0, "FARCASTER"));
17654
17654
 
17655
17655
  case 28:
17656
17656
  case "end":
17657
- return _context24.stop();
17657
+ return _context23.stop();
17658
17658
  }
17659
- }), _callee21, null, [ [ 0, 25 ] ]);
17659
+ }), _callee20, null, [ [ 0, 25 ] ]);
17660
17660
  })));
17661
17661
  return _FARCASTER.apply(this, arguments);
17662
17662
  }
@@ -17694,13 +17694,13 @@ function _typeof(o) {
17694
17694
  return _FIREFLY.apply(this, arguments);
17695
17695
  }
17696
17696
  function _FIREFLY() {
17697
- _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee22() {
17698
- var _argsToArray17, _argsToArray18, platform, contentType, identifier, _argsToArray18$, start, _argsToArray18$2, end, apiKey, url, _getUrlAndHeaders7, finalUrl, HEADERS, response, _yield$response$json2, _data3, _args25 = arguments;
17699
- return _regeneratorRuntime().wrap((function _callee22$(_context25) {
17700
- while (1) switch (_context25.prev = _context25.next) {
17697
+ _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee21() {
17698
+ var _argsToArray17, _argsToArray18, platform, contentType, identifier, _argsToArray18$, start, _argsToArray18$2, end, apiKey, url, _getUrlAndHeaders7, finalUrl, HEADERS, response, _yield$response$json2, _data3, _args24 = arguments;
17699
+ return _regeneratorRuntime().wrap((function _callee21$(_context24) {
17700
+ while (1) switch (_context24.prev = _context24.next) {
17701
17701
  case 0:
17702
- _context25.prev = 0;
17703
- _argsToArray17 = argsToArray(_args25), _argsToArray18 = _slicedToArray(_argsToArray17, 5),
17702
+ _context24.prev = 0;
17703
+ _argsToArray17 = argsToArray(_args24), _argsToArray18 = _slicedToArray(_argsToArray17, 5),
17704
17704
  platform = _argsToArray18[0], contentType = _argsToArray18[1], identifier = _argsToArray18[2],
17705
17705
  _argsToArray18$ = _argsToArray18[3], start = _argsToArray18$ === void 0 ? 0 : _argsToArray18$,
17706
17706
  _argsToArray18$2 = _argsToArray18[4], end = _argsToArray18$2 === void 0 ? 10 : _argsToArray18$2;
@@ -17726,35 +17726,35 @@ function _typeof(o) {
17726
17726
  "x-api-key": apiKey
17727
17727
  }
17728
17728
  }), finalUrl = _getUrlAndHeaders7.URL, HEADERS = _getUrlAndHeaders7.HEADERS;
17729
- _context25.next = 12;
17729
+ _context24.next = 12;
17730
17730
  return fetch(finalUrl, {
17731
17731
  method: "GET",
17732
17732
  headers: HEADERS
17733
17733
  });
17734
17734
 
17735
17735
  case 12:
17736
- response = _context25.sent;
17736
+ response = _context24.sent;
17737
17737
  if (response.ok) {
17738
- _context25.next = 15;
17738
+ _context24.next = 15;
17739
17739
  break;
17740
17740
  }
17741
17741
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
17742
17742
 
17743
17743
  case 15:
17744
- _context25.next = 17;
17744
+ _context24.next = 17;
17745
17745
  return response.json();
17746
17746
 
17747
17747
  case 17:
17748
- _yield$response$json2 = _context25.sent;
17748
+ _yield$response$json2 = _context24.sent;
17749
17749
  _data3 = _yield$response$json2.data;
17750
17750
  if (Array.isArray(_data3)) {
17751
- _context25.next = 21;
17751
+ _context24.next = 21;
17752
17752
  break;
17753
17753
  }
17754
- return _context25.abrupt("return", []);
17754
+ return _context24.abrupt("return", []);
17755
17755
 
17756
17756
  case 21:
17757
- return _context25.abrupt("return", _data3.map((function(item) {
17757
+ return _context24.abrupt("return", _data3.map((function(item) {
17758
17758
  var flat = {};
17759
17759
  for (var _i16 = 0, _Object$entries6 = Object.entries(item); _i16 < _Object$entries6.length; _i16++) {
17760
17760
  var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i16], 2), key = _Object$entries6$_i[0], _value12 = _Object$entries6$_i[1];
@@ -17767,15 +17767,15 @@ function _typeof(o) {
17767
17767
  })));
17768
17768
 
17769
17769
  case 24:
17770
- _context25.prev = 24;
17771
- _context25.t0 = _context25["catch"](0);
17772
- return _context25.abrupt("return", errorMessageHandler(_context25.t0, "FIREFLY"));
17770
+ _context24.prev = 24;
17771
+ _context24.t0 = _context24["catch"](0);
17772
+ return _context24.abrupt("return", errorMessageHandler(_context24.t0, "FIREFLY"));
17773
17773
 
17774
17774
  case 27:
17775
17775
  case "end":
17776
- return _context25.stop();
17776
+ return _context24.stop();
17777
17777
  }
17778
- }), _callee22, null, [ [ 0, 24 ] ]);
17778
+ }), _callee21, null, [ [ 0, 24 ] ]);
17779
17779
  })));
17780
17780
  return _FIREFLY.apply(this, arguments);
17781
17781
  }
@@ -17783,13 +17783,13 @@ function _typeof(o) {
17783
17783
  return _GNOSIS.apply(this, arguments);
17784
17784
  }
17785
17785
  function _GNOSIS() {
17786
- _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee23() {
17787
- var _argsToArray19, _argsToArray20, type, address, startDate, endDate, _argsToArray20$, page, _argsToArray20$2, limit, apiKey, _args26 = arguments;
17788
- return _regeneratorRuntime().wrap((function _callee23$(_context26) {
17789
- while (1) switch (_context26.prev = _context26.next) {
17786
+ _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee22() {
17787
+ var _argsToArray19, _argsToArray20, type, address, startDate, endDate, _argsToArray20$, page, _argsToArray20$2, limit, apiKey, _args25 = arguments;
17788
+ return _regeneratorRuntime().wrap((function _callee22$(_context25) {
17789
+ while (1) switch (_context25.prev = _context25.next) {
17790
17790
  case 0:
17791
- _context26.prev = 0;
17792
- _argsToArray19 = argsToArray(_args26), _argsToArray20 = _slicedToArray(_argsToArray19, 6),
17791
+ _context25.prev = 0;
17792
+ _argsToArray19 = argsToArray(_args25), _argsToArray20 = _slicedToArray(_argsToArray19, 6),
17793
17793
  type = _argsToArray20[0], address = _argsToArray20[1], startDate = _argsToArray20[2],
17794
17794
  endDate = _argsToArray20[3], _argsToArray20$ = _argsToArray20[4], page = _argsToArray20$ === void 0 ? 1 : _argsToArray20$,
17795
17795
  _argsToArray20$2 = _argsToArray20[5], limit = _argsToArray20$2 === void 0 ? 10 : _argsToArray20$2;
@@ -17802,7 +17802,7 @@ function _typeof(o) {
17802
17802
  limit: limit
17803
17803
  });
17804
17804
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Gnosisscan);
17805
- _context26.next = 6;
17805
+ _context25.next = 6;
17806
17806
  return handleScanRequest({
17807
17807
  type: type,
17808
17808
  address: address,
@@ -17817,18 +17817,18 @@ function _typeof(o) {
17817
17817
  });
17818
17818
 
17819
17819
  case 6:
17820
- return _context26.abrupt("return", _context26.sent);
17820
+ return _context25.abrupt("return", _context25.sent);
17821
17821
 
17822
17822
  case 9:
17823
- _context26.prev = 9;
17824
- _context26.t0 = _context26["catch"](0);
17825
- return _context26.abrupt("return", errorMessageHandler(_context26.t0, "GNOSIS"));
17823
+ _context25.prev = 9;
17824
+ _context25.t0 = _context25["catch"](0);
17825
+ return _context25.abrupt("return", errorMessageHandler(_context25.t0, "GNOSIS"));
17826
17826
 
17827
17827
  case 12:
17828
17828
  case "end":
17829
- return _context26.stop();
17829
+ return _context25.stop();
17830
17830
  }
17831
- }), _callee23, null, [ [ 0, 9 ] ]);
17831
+ }), _callee22, null, [ [ 0, 9 ] ]);
17832
17832
  })));
17833
17833
  return _GNOSIS.apply(this, arguments);
17834
17834
  }
@@ -17844,13 +17844,13 @@ function _typeof(o) {
17844
17844
  return _LENS.apply(this, arguments);
17845
17845
  }
17846
17846
  function _LENS() {
17847
- _LENS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee24() {
17848
- var _argsToArray21, _argsToArray22, contentType, identifier, _argsToArray22$, start, _argsToArray22$2, end, apiKey, url, typeMap, _getUrlAndHeaders8, finalUrl, HEADERS, response, _yield$response$json3, _data4, _args27 = arguments;
17849
- return _regeneratorRuntime().wrap((function _callee24$(_context27) {
17850
- while (1) switch (_context27.prev = _context27.next) {
17847
+ _LENS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee23() {
17848
+ var _argsToArray21, _argsToArray22, contentType, identifier, _argsToArray22$, start, _argsToArray22$2, end, apiKey, url, typeMap, _getUrlAndHeaders8, finalUrl, HEADERS, response, _yield$response$json3, _data4, _args26 = arguments;
17849
+ return _regeneratorRuntime().wrap((function _callee23$(_context26) {
17850
+ while (1) switch (_context26.prev = _context26.next) {
17851
17851
  case 0:
17852
- _context27.prev = 0;
17853
- _argsToArray21 = argsToArray(_args27), _argsToArray22 = _slicedToArray(_argsToArray21, 4),
17852
+ _context26.prev = 0;
17853
+ _argsToArray21 = argsToArray(_args26), _argsToArray22 = _slicedToArray(_argsToArray21, 4),
17854
17854
  contentType = _argsToArray22[0], identifier = _argsToArray22[1], _argsToArray22$ = _argsToArray22[2],
17855
17855
  start = _argsToArray22$ === void 0 ? 0 : _argsToArray22$, _argsToArray22$2 = _argsToArray22[3],
17856
17856
  end = _argsToArray22$2 === void 0 ? 10 : _argsToArray22$2;
@@ -17879,35 +17879,35 @@ function _typeof(o) {
17879
17879
  "x-api-key": apiKey
17880
17880
  }
17881
17881
  }), finalUrl = _getUrlAndHeaders8.URL, HEADERS = _getUrlAndHeaders8.HEADERS;
17882
- _context27.next = 13;
17882
+ _context26.next = 13;
17883
17883
  return fetch(finalUrl, {
17884
17884
  method: "GET",
17885
17885
  headers: HEADERS
17886
17886
  });
17887
17887
 
17888
17888
  case 13:
17889
- response = _context27.sent;
17889
+ response = _context26.sent;
17890
17890
  if (response.ok) {
17891
- _context27.next = 16;
17891
+ _context26.next = 16;
17892
17892
  break;
17893
17893
  }
17894
17894
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
17895
17895
 
17896
17896
  case 16:
17897
- _context27.next = 18;
17897
+ _context26.next = 18;
17898
17898
  return response.json();
17899
17899
 
17900
17900
  case 18:
17901
- _yield$response$json3 = _context27.sent;
17901
+ _yield$response$json3 = _context26.sent;
17902
17902
  _data4 = _yield$response$json3.data;
17903
17903
  if (Array.isArray(_data4)) {
17904
- _context27.next = 22;
17904
+ _context26.next = 22;
17905
17905
  break;
17906
17906
  }
17907
- return _context27.abrupt("return", []);
17907
+ return _context26.abrupt("return", []);
17908
17908
 
17909
17909
  case 22:
17910
- return _context27.abrupt("return", _data4.map((function(item) {
17910
+ return _context26.abrupt("return", _data4.map((function(item) {
17911
17911
  var flat = {};
17912
17912
  for (var _i17 = 0, _Object$entries7 = Object.entries(item); _i17 < _Object$entries7.length; _i17++) {
17913
17913
  var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i17], 2), key = _Object$entries7$_i[0], _value13 = _Object$entries7$_i[1];
@@ -17920,15 +17920,15 @@ function _typeof(o) {
17920
17920
  })));
17921
17921
 
17922
17922
  case 25:
17923
- _context27.prev = 25;
17924
- _context27.t0 = _context27["catch"](0);
17925
- return _context27.abrupt("return", errorMessageHandler(_context27.t0, "LENS"));
17923
+ _context26.prev = 25;
17924
+ _context26.t0 = _context26["catch"](0);
17925
+ return _context26.abrupt("return", errorMessageHandler(_context26.t0, "LENS"));
17926
17926
 
17927
17927
  case 28:
17928
17928
  case "end":
17929
- return _context27.stop();
17929
+ return _context26.stop();
17930
17930
  }
17931
- }), _callee24, null, [ [ 0, 25 ] ]);
17931
+ }), _callee23, null, [ [ 0, 25 ] ]);
17932
17932
  })));
17933
17933
  return _LENS.apply(this, arguments);
17934
17934
  }
@@ -17993,25 +17993,25 @@ function _typeof(o) {
17993
17993
  return _NEYNAR.apply(this, arguments);
17994
17994
  }
17995
17995
  function _NEYNAR() {
17996
- _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee25() {
17997
- var _argsToArray23, _argsToArray24, username, apiKey, fid, url, _getUrlAndHeaders9, finalUrl, HEADERS, response, json, users, _args28 = arguments;
17998
- return _regeneratorRuntime().wrap((function _callee25$(_context28) {
17999
- while (1) switch (_context28.prev = _context28.next) {
17996
+ _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee24() {
17997
+ var _argsToArray23, _argsToArray24, username, apiKey, fid, url, _getUrlAndHeaders9, finalUrl, HEADERS, response, json, users, _args27 = arguments;
17998
+ return _regeneratorRuntime().wrap((function _callee24$(_context27) {
17999
+ while (1) switch (_context27.prev = _context27.next) {
18000
18000
  case 0:
18001
- _context28.prev = 0;
18002
- _argsToArray23 = argsToArray(_args28), _argsToArray24 = _slicedToArray(_argsToArray23, 1),
18001
+ _context27.prev = 0;
18002
+ _argsToArray23 = argsToArray(_args27), _argsToArray24 = _slicedToArray(_argsToArray23, 1),
18003
18003
  username = _argsToArray24[0];
18004
18004
  validateParams(neynarParamsSchema, {
18005
18005
  username: username
18006
18006
  });
18007
18007
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Neynar);
18008
- _context28.next = 6;
18008
+ _context27.next = 6;
18009
18009
  return fromUsernameToFid$1.fromUsernameToFid(username, apiKey);
18010
18010
 
18011
18011
  case 6:
18012
- fid = _context28.sent;
18012
+ fid = _context27.sent;
18013
18013
  if (fid) {
18014
- _context28.next = 9;
18014
+ _context27.next = 9;
18015
18015
  break;
18016
18016
  }
18017
18017
  throw new ValidationError("Invalid username: ".concat(username));
@@ -18026,37 +18026,37 @@ function _typeof(o) {
18026
18026
  "x-neynar-experimental": "false"
18027
18027
  }
18028
18028
  }), finalUrl = _getUrlAndHeaders9.URL, HEADERS = _getUrlAndHeaders9.HEADERS;
18029
- _context28.next = 13;
18029
+ _context27.next = 13;
18030
18030
  return fetch(finalUrl, {
18031
18031
  method: "GET",
18032
18032
  headers: HEADERS
18033
18033
  });
18034
18034
 
18035
18035
  case 13:
18036
- response = _context28.sent;
18036
+ response = _context27.sent;
18037
18037
  if (response.ok) {
18038
- _context28.next = 16;
18038
+ _context27.next = 16;
18039
18039
  break;
18040
18040
  }
18041
18041
  throw new NetworkError(SERVICES_API_KEY.Neynar, response.status);
18042
18042
 
18043
18043
  case 16:
18044
- _context28.next = 18;
18044
+ _context27.next = 18;
18045
18045
  return response.json();
18046
18046
 
18047
18047
  case 18:
18048
- json = _context28.sent;
18048
+ json = _context27.sent;
18049
18049
  users = (json === null || json === void 0 ? void 0 : json.users) || [];
18050
18050
  if (users.length) {
18051
- _context28.next = 22;
18051
+ _context27.next = 22;
18052
18052
  break;
18053
18053
  }
18054
- return _context28.abrupt("return", []);
18054
+ return _context27.abrupt("return", []);
18055
18055
 
18056
18056
  case 22:
18057
- return _context28.abrupt("return", users.map((function(_ref19) {
18057
+ return _context27.abrupt("return", users.map((function(_ref18) {
18058
18058
  var _user$profile, _user$profile2;
18059
- var user = _ref19.user;
18059
+ var user = _ref18.user;
18060
18060
  return {
18061
18061
  username: user.username,
18062
18062
  custody_address: user.custody_address,
@@ -18067,15 +18067,15 @@ function _typeof(o) {
18067
18067
  })));
18068
18068
 
18069
18069
  case 25:
18070
- _context28.prev = 25;
18071
- _context28.t0 = _context28["catch"](0);
18072
- return _context28.abrupt("return", errorMessageHandler(_context28.t0, "NEYNAR"));
18070
+ _context27.prev = 25;
18071
+ _context27.t0 = _context27["catch"](0);
18072
+ return _context27.abrupt("return", errorMessageHandler(_context27.t0, "NEYNAR"));
18073
18073
 
18074
18074
  case 28:
18075
18075
  case "end":
18076
- return _context28.stop();
18076
+ return _context27.stop();
18077
18077
  }
18078
- }), _callee25, null, [ [ 0, 25 ] ]);
18078
+ }), _callee24, null, [ [ 0, 25 ] ]);
18079
18079
  })));
18080
18080
  return _NEYNAR.apply(this, arguments);
18081
18081
  }
@@ -18092,13 +18092,13 @@ function _typeof(o) {
18092
18092
  return _SAFE.apply(this, arguments);
18093
18093
  }
18094
18094
  function _SAFE() {
18095
- _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee26() {
18096
- var _argsToArray25, _argsToArray26, address, utility, chain, _argsToArray26$, limit, _argsToArray26$2, offset, apiKey, chainId, resolved, url, _getUrlAndHeaders0, finalUrl, HEADERS, res, json, _args29 = arguments;
18097
- return _regeneratorRuntime().wrap((function _callee26$(_context29) {
18098
- while (1) switch (_context29.prev = _context29.next) {
18095
+ _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee25() {
18096
+ var _argsToArray25, _argsToArray26, address, utility, chain, _argsToArray26$, limit, _argsToArray26$2, offset, apiKey, chainId, resolved, url, _getUrlAndHeaders0, finalUrl, HEADERS, res, json, _args28 = arguments;
18097
+ return _regeneratorRuntime().wrap((function _callee25$(_context28) {
18098
+ while (1) switch (_context28.prev = _context28.next) {
18099
18099
  case 0:
18100
- _context29.prev = 0;
18101
- _argsToArray25 = argsToArray(_args29), _argsToArray26 = _slicedToArray(_argsToArray25, 5),
18100
+ _context28.prev = 0;
18101
+ _argsToArray25 = argsToArray(_args28), _argsToArray26 = _slicedToArray(_argsToArray25, 5),
18102
18102
  address = _argsToArray26[0], utility = _argsToArray26[1], chain = _argsToArray26[2],
18103
18103
  _argsToArray26$ = _argsToArray26[3], limit = _argsToArray26$ === void 0 ? 10 : _argsToArray26$,
18104
18104
  _argsToArray26$2 = _argsToArray26[4], offset = _argsToArray26$2 === void 0 ? 0 : _argsToArray26$2;
@@ -18112,17 +18112,17 @@ function _typeof(o) {
18112
18112
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Safe);
18113
18113
  chainId = SAFE_CHAIN_MAP[chain];
18114
18114
  if (chainId) {
18115
- _context29.next = 7;
18115
+ _context28.next = 7;
18116
18116
  break;
18117
18117
  }
18118
18118
  throw new ValidationError("Invalid chain: ".concat(chain));
18119
18119
 
18120
18120
  case 7:
18121
- _context29.next = 9;
18121
+ _context28.next = 9;
18122
18122
  return fromEnsNameToAddress$1.validateAndGetAddress(address);
18123
18123
 
18124
18124
  case 9:
18125
- resolved = _context29.sent;
18125
+ resolved = _context28.sent;
18126
18126
  url = "https://api.safe.global/tx-service/".concat(chainId, "/api/v2/safes/").concat(resolved, "/multisig-transactions?limit=").concat(limit, "&offset=").concat(offset);
18127
18127
  _getUrlAndHeaders0 = getUrlAndHeaders({
18128
18128
  url: url,
@@ -18131,47 +18131,47 @@ function _typeof(o) {
18131
18131
  Authorization: "Bearer ".concat(apiKey)
18132
18132
  }
18133
18133
  }), finalUrl = _getUrlAndHeaders0.URL, HEADERS = _getUrlAndHeaders0.HEADERS;
18134
- _context29.next = 14;
18134
+ _context28.next = 14;
18135
18135
  return fetch(finalUrl, {
18136
18136
  headers: HEADERS
18137
18137
  });
18138
18138
 
18139
18139
  case 14:
18140
- res = _context29.sent;
18140
+ res = _context28.sent;
18141
18141
  if (res.ok) {
18142
- _context29.next = 17;
18142
+ _context28.next = 17;
18143
18143
  break;
18144
18144
  }
18145
18145
  throw new NetworkError(SERVICES_API_KEY.Safe, res.status);
18146
18146
 
18147
18147
  case 17:
18148
- _context29.next = 19;
18148
+ _context28.next = 19;
18149
18149
  return res.json();
18150
18150
 
18151
18151
  case 19:
18152
- json = _context29.sent;
18152
+ json = _context28.sent;
18153
18153
  if (Array.isArray(json.results)) {
18154
- _context29.next = 22;
18154
+ _context28.next = 22;
18155
18155
  break;
18156
18156
  }
18157
18157
  throw new ValidationError("Invalid API response");
18158
18158
 
18159
18159
  case 22:
18160
- return _context29.abrupt("return", json.results.map((function(_ref20) {
18161
- var confirmations = _ref20.confirmations, dataDecoded = _ref20.dataDecoded, rest = _objectWithoutProperties(_ref20, _excluded);
18160
+ return _context28.abrupt("return", json.results.map((function(_ref19) {
18161
+ var confirmations = _ref19.confirmations, dataDecoded = _ref19.dataDecoded, rest = _objectWithoutProperties(_ref19, _excluded);
18162
18162
  return rest;
18163
18163
  })));
18164
18164
 
18165
18165
  case 25:
18166
- _context29.prev = 25;
18167
- _context29.t0 = _context29["catch"](0);
18168
- return _context29.abrupt("return", errorMessageHandler(_context29.t0, "SAFE"));
18166
+ _context28.prev = 25;
18167
+ _context28.t0 = _context28["catch"](0);
18168
+ return _context28.abrupt("return", errorMessageHandler(_context28.t0, "SAFE"));
18169
18169
 
18170
18170
  case 28:
18171
18171
  case "end":
18172
- return _context29.stop();
18172
+ return _context28.stop();
18173
18173
  }
18174
- }), _callee26, null, [ [ 0, 25 ] ]);
18174
+ }), _callee25, null, [ [ 0, 25 ] ]);
18175
18175
  })));
18176
18176
  return _SAFE.apply(this, arguments);
18177
18177
  }
@@ -18185,13 +18185,13 @@ function _typeof(o) {
18185
18185
  return _UNISWAP.apply(this, arguments);
18186
18186
  }
18187
18187
  function _UNISWAP() {
18188
- _UNISWAP = _asyncToGenerator(_regeneratorRuntime().mark((function _callee27() {
18189
- var _argsToArray27, _argsToArray28, graphType, category, param1, param2, baseUrl, url, res, json, _args30 = arguments;
18190
- return _regeneratorRuntime().wrap((function _callee27$(_context30) {
18191
- while (1) switch (_context30.prev = _context30.next) {
18188
+ _UNISWAP = _asyncToGenerator(_regeneratorRuntime().mark((function _callee26() {
18189
+ var _argsToArray27, _argsToArray28, graphType, category, param1, param2, baseUrl, url, res, json, _args29 = arguments;
18190
+ return _regeneratorRuntime().wrap((function _callee26$(_context29) {
18191
+ while (1) switch (_context29.prev = _context29.next) {
18192
18192
  case 0:
18193
- _context30.prev = 0;
18194
- _argsToArray27 = argsToArray(_args30), _argsToArray28 = _slicedToArray(_argsToArray27, 4),
18193
+ _context29.prev = 0;
18194
+ _argsToArray27 = argsToArray(_args29), _argsToArray28 = _slicedToArray(_argsToArray27, 4),
18195
18195
  graphType = _argsToArray28[0], category = _argsToArray28[1], param1 = _argsToArray28[2],
18196
18196
  param2 = _argsToArray28[3];
18197
18197
  validateParams(uniswapParamsSchema, {
@@ -18202,49 +18202,49 @@ function _typeof(o) {
18202
18202
  });
18203
18203
  baseUrl = "https://onchain-proxy.fileverse.io/third-party";
18204
18204
  url = "".concat(baseUrl) + "?service=uniswap" + "&graphType=".concat(graphType) + "&category=".concat(category) + "&input1=".concat(encodeURIComponent(param1)) + (param2 ? "&input2=".concat(encodeURIComponent(param2)) : "");
18205
- _context30.next = 7;
18205
+ _context29.next = 7;
18206
18206
  return fetch(url);
18207
18207
 
18208
18208
  case 7:
18209
- res = _context30.sent;
18209
+ res = _context29.sent;
18210
18210
  if (res.ok) {
18211
- _context30.next = 10;
18211
+ _context29.next = 10;
18212
18212
  break;
18213
18213
  }
18214
18214
  throw new NetworkError("UNISWAP", res.status);
18215
18215
 
18216
18216
  case 10:
18217
- _context30.next = 12;
18217
+ _context29.next = 12;
18218
18218
  return res.json();
18219
18219
 
18220
18220
  case 12:
18221
- json = _context30.sent;
18221
+ json = _context29.sent;
18222
18222
  if (!Array.isArray(json)) {
18223
- _context30.next = 15;
18223
+ _context29.next = 15;
18224
18224
  break;
18225
18225
  }
18226
- return _context30.abrupt("return", json.map((function(item) {
18226
+ return _context29.abrupt("return", json.map((function(item) {
18227
18227
  var flat = {};
18228
- Object.entries(item).forEach((function(_ref21) {
18229
- var _ref22 = _slicedToArray(_ref21, 2), k = _ref22[0], v = _ref22[1];
18228
+ Object.entries(item).forEach((function(_ref20) {
18229
+ var _ref21 = _slicedToArray(_ref20, 2), k = _ref21[0], v = _ref21[1];
18230
18230
  if (v === null || _typeof(v) !== "object") flat[k] = v;
18231
18231
  }));
18232
18232
  return flat;
18233
18233
  })));
18234
18234
 
18235
18235
  case 15:
18236
- return _context30.abrupt("return", json);
18236
+ return _context29.abrupt("return", json);
18237
18237
 
18238
18238
  case 18:
18239
- _context30.prev = 18;
18240
- _context30.t0 = _context30["catch"](0);
18241
- return _context30.abrupt("return", errorMessageHandler(_context30.t0, "UNISWAP"));
18239
+ _context29.prev = 18;
18240
+ _context29.t0 = _context29["catch"](0);
18241
+ return _context29.abrupt("return", errorMessageHandler(_context29.t0, "UNISWAP"));
18242
18242
 
18243
18243
  case 21:
18244
18244
  case "end":
18245
- return _context30.stop();
18245
+ return _context29.stop();
18246
18246
  }
18247
- }), _callee27, null, [ [ 0, 18 ] ]);
18247
+ }), _callee26, null, [ [ 0, 18 ] ]);
18248
18248
  })));
18249
18249
  return _UNISWAP.apply(this, arguments);
18250
18250
  }
@@ -18252,14 +18252,14 @@ function _typeof(o) {
18252
18252
  return _SMARTCONTRACT.apply(this, arguments);
18253
18253
  }
18254
18254
  function _SMARTCONTRACT() {
18255
- _SMARTCONTRACT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee28() {
18256
- var args, _args31 = arguments;
18257
- return _regeneratorRuntime().wrap((function _callee28$(_context31) {
18258
- while (1) switch (_context31.prev = _context31.next) {
18255
+ _SMARTCONTRACT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee27() {
18256
+ var args, _args30 = arguments;
18257
+ return _regeneratorRuntime().wrap((function _callee27$(_context30) {
18258
+ while (1) switch (_context30.prev = _context30.next) {
18259
18259
  case 0:
18260
- _context31.prev = 0;
18261
- args = argsToArray(_args31);
18262
- return _context31.abrupt("return", new Promise((function(resolve) {
18260
+ _context30.prev = 0;
18261
+ args = argsToArray(_args30);
18262
+ return _context30.abrupt("return", new Promise((function(resolve) {
18263
18263
  resolve({
18264
18264
  callSignature: args,
18265
18265
  responseType: "smart-contract"
@@ -18267,15 +18267,15 @@ function _typeof(o) {
18267
18267
  })));
18268
18268
 
18269
18269
  case 5:
18270
- _context31.prev = 5;
18271
- _context31.t0 = _context31["catch"](0);
18272
- return _context31.abrupt("return", errorMessageHandler(_context31.t0, "SMARTCONTRACT"));
18270
+ _context30.prev = 5;
18271
+ _context30.t0 = _context30["catch"](0);
18272
+ return _context30.abrupt("return", errorMessageHandler(_context30.t0, "SMARTCONTRACT"));
18273
18273
 
18274
18274
  case 8:
18275
18275
  case "end":
18276
- return _context31.stop();
18276
+ return _context30.stop();
18277
18277
  }
18278
- }), _callee28, null, [ [ 0, 5 ] ]);
18278
+ }), _callee27, null, [ [ 0, 5 ] ]);
18279
18279
  })));
18280
18280
  return _SMARTCONTRACT.apply(this, arguments);
18281
18281
  }
@@ -18287,13 +18287,13 @@ function _typeof(o) {
18287
18287
  return _TALLY.apply(this, arguments);
18288
18288
  }
18289
18289
  function _TALLY() {
18290
- _TALLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee29() {
18291
- var _argsToArray29, _argsToArray30, query, slug, baseUrl, url, res, _data5, _args32 = arguments;
18292
- return _regeneratorRuntime().wrap((function _callee29$(_context32) {
18293
- while (1) switch (_context32.prev = _context32.next) {
18290
+ _TALLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee28() {
18291
+ var _argsToArray29, _argsToArray30, query, slug, baseUrl, url, res, _data5, _args31 = arguments;
18292
+ return _regeneratorRuntime().wrap((function _callee28$(_context31) {
18293
+ while (1) switch (_context31.prev = _context31.next) {
18294
18294
  case 0:
18295
- _context32.prev = 0;
18296
- _argsToArray29 = argsToArray(_args32), _argsToArray30 = _slicedToArray(_argsToArray29, 2),
18295
+ _context31.prev = 0;
18296
+ _argsToArray29 = argsToArray(_args31), _argsToArray30 = _slicedToArray(_argsToArray29, 2),
18297
18297
  query = _argsToArray30[0], slug = _argsToArray30[1];
18298
18298
  validateParams(tallyParamsSchema, {
18299
18299
  query: query,
@@ -18301,35 +18301,35 @@ function _typeof(o) {
18301
18301
  });
18302
18302
  baseUrl = "https://onchain-proxy.fileverse.io/third-party";
18303
18303
  url = "".concat(baseUrl) + "?service=tally" + "&input1=".concat(encodeURIComponent(query)) + "&input2=".concat(encodeURIComponent(slug));
18304
- _context32.next = 7;
18304
+ _context31.next = 7;
18305
18305
  return fetch(url);
18306
18306
 
18307
18307
  case 7:
18308
- res = _context32.sent;
18308
+ res = _context31.sent;
18309
18309
  if (res.ok) {
18310
- _context32.next = 10;
18310
+ _context31.next = 10;
18311
18311
  break;
18312
18312
  }
18313
18313
  throw new NetworkError("TALLY", res.status);
18314
18314
 
18315
18315
  case 10:
18316
- _context32.next = 12;
18316
+ _context31.next = 12;
18317
18317
  return res.json();
18318
18318
 
18319
18319
  case 12:
18320
- _data5 = _context32.sent;
18321
- return _context32.abrupt("return", _data5);
18320
+ _data5 = _context31.sent;
18321
+ return _context31.abrupt("return", _data5);
18322
18322
 
18323
18323
  case 16:
18324
- _context32.prev = 16;
18325
- _context32.t0 = _context32["catch"](0);
18326
- return _context32.abrupt("return", errorMessageHandler(_context32.t0, "TALLY"));
18324
+ _context31.prev = 16;
18325
+ _context31.t0 = _context31["catch"](0);
18326
+ return _context31.abrupt("return", errorMessageHandler(_context31.t0, "TALLY"));
18327
18327
 
18328
18328
  case 19:
18329
18329
  case "end":
18330
- return _context32.stop();
18330
+ return _context31.stop();
18331
18331
  }
18332
- }), _callee29, null, [ [ 0, 16 ] ]);
18332
+ }), _callee28, null, [ [ 0, 16 ] ]);
18333
18333
  })));
18334
18334
  return _TALLY.apply(this, arguments);
18335
18335
  }
@@ -18391,7 +18391,8 @@ function _typeof(o) {
18391
18391
  avalanche: 43114,
18392
18392
  fantom: 250,
18393
18393
  scroll: 534352,
18394
- linea: 59144
18394
+ linea: 59144,
18395
+ ethereum: 1
18395
18396
  };
18396
18397
  function formatNumber(raw, decimals) {
18397
18398
  if (!decimals) {
@@ -18410,51 +18411,51 @@ function _typeof(o) {
18410
18411
  return _getChainName.apply(this, arguments);
18411
18412
  }
18412
18413
  function _getChainName() {
18413
- _getChainName = _asyncToGenerator(_regeneratorRuntime().mark((function _callee30(chainId) {
18414
+ _getChainName = _asyncToGenerator(_regeneratorRuntime().mark((function _callee29(chainId) {
18414
18415
  var res, chain;
18415
- return _regeneratorRuntime().wrap((function _callee30$(_context33) {
18416
- while (1) switch (_context33.prev = _context33.next) {
18416
+ return _regeneratorRuntime().wrap((function _callee29$(_context32) {
18417
+ while (1) switch (_context32.prev = _context32.next) {
18417
18418
  case 0:
18418
- _context33.prev = 0;
18419
+ _context32.prev = 0;
18419
18420
  if (cachedChains) {
18420
- _context33.next = 10;
18421
+ _context32.next = 10;
18421
18422
  break;
18422
18423
  }
18423
- _context33.next = 4;
18424
+ _context32.next = 4;
18424
18425
  return fetch("https://chainid.network/chains_mini.json");
18425
18426
 
18426
18427
  case 4:
18427
- res = _context33.sent;
18428
+ res = _context32.sent;
18428
18429
  if (res.ok) {
18429
- _context33.next = 7;
18430
+ _context32.next = 7;
18430
18431
  break;
18431
18432
  }
18432
18433
  throw new Error("Failed to fetch chains.json");
18433
18434
 
18434
18435
  case 7:
18435
- _context33.next = 9;
18436
+ _context32.next = 9;
18436
18437
  return res.json();
18437
18438
 
18438
18439
  case 9:
18439
- cachedChains = _context33.sent;
18440
+ cachedChains = _context32.sent;
18440
18441
 
18441
18442
  case 10:
18442
18443
  chain = cachedChains.find((function(c) {
18443
18444
  return c.chainId === chainId;
18444
18445
  }));
18445
- return _context33.abrupt("return", chain ? chain.name : chainId);
18446
+ return _context32.abrupt("return", chain ? chain.name : chainId);
18446
18447
 
18447
18448
  case 14:
18448
- _context33.prev = 14;
18449
- _context33.t0 = _context33["catch"](0);
18450
- console.log(_context33.t0);
18451
- return _context33.abrupt("return", chainId);
18449
+ _context32.prev = 14;
18450
+ _context32.t0 = _context32["catch"](0);
18451
+ console.log(_context32.t0);
18452
+ return _context32.abrupt("return", chainId);
18452
18453
 
18453
18454
  case 18:
18454
18455
  case "end":
18455
- return _context33.stop();
18456
+ return _context32.stop();
18456
18457
  }
18457
- }), _callee30, null, [ [ 0, 14 ] ]);
18458
+ }), _callee29, null, [ [ 0, 14 ] ]);
18458
18459
  })));
18459
18460
  return _getChainName.apply(this, arguments);
18460
18461
  }
@@ -18462,13 +18463,13 @@ function _typeof(o) {
18462
18463
  return _DUNESIM.apply(this, arguments);
18463
18464
  }
18464
18465
  function _DUNESIM() {
18465
- _DUNESIM = _asyncToGenerator(_regeneratorRuntime().mark((function _callee31() {
18466
- var _ref27, _json$activity, _ref28, _json$holders, _ref29, _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, _final, globalDecimals, _iterator43, _step43, _loop4, _args35 = arguments;
18467
- return _regeneratorRuntime().wrap((function _callee31$(_context35) {
18468
- while (1) switch (_context35.prev = _context35.next) {
18466
+ _DUNESIM = _asyncToGenerator(_regeneratorRuntime().mark((function _callee30() {
18467
+ 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, _final, globalDecimals, _iterator43, _step43, _loop4, _args34 = arguments;
18468
+ return _regeneratorRuntime().wrap((function _callee30$(_context34) {
18469
+ while (1) switch (_context34.prev = _context34.next) {
18469
18470
  case 0:
18470
- _context35.prev = 0;
18471
- _argsToArray31 = argsToArray(_args35), _argsToArray32 = _slicedToArray(_argsToArray31, 5),
18471
+ _context34.prev = 0;
18472
+ _argsToArray31 = argsToArray(_args34), _argsToArray32 = _slicedToArray(_argsToArray31, 5),
18472
18473
  type = _argsToArray32[0], input1 = _argsToArray32[1], input2 = _argsToArray32[2],
18473
18474
  input3 = _argsToArray32[3], input4 = _argsToArray32[4];
18474
18475
  validateParams(duneSimParamsSchema, {
@@ -18480,24 +18481,24 @@ function _typeof(o) {
18480
18481
  });
18481
18482
  route = "";
18482
18483
  buildQuery = function buildQuery(pairs) {
18483
- var parts = pairs.filter((function(_ref23) {
18484
- var _ref24 = _slicedToArray(_ref23, 2), _ = _ref24[0], v = _ref24[1];
18484
+ var parts = pairs.filter((function(_ref22) {
18485
+ var _ref23 = _slicedToArray(_ref22, 2), _ = _ref23[0], v = _ref23[1];
18485
18486
  return v !== undefined && v !== "";
18486
- })).map((function(_ref25) {
18487
- var _ref26 = _slicedToArray(_ref25, 2), k = _ref26[0], v = _ref26[1];
18487
+ })).map((function(_ref24) {
18488
+ var _ref25 = _slicedToArray(_ref24, 2), k = _ref25[0], v = _ref25[1];
18488
18489
  return "".concat(k, "=").concat(encodeURIComponent(v));
18489
18490
  }));
18490
18491
  return parts.length ? "?".concat(parts.join("&")) : "";
18491
18492
  };
18492
18493
  if (!(type === "activity")) {
18493
- _context35.next = 11;
18494
+ _context34.next = 11;
18494
18495
  break;
18495
18496
  }
18496
- _context35.next = 8;
18497
+ _context34.next = 8;
18497
18498
  return fromEnsNameToAddress$1.validateAndGetAddress(input1);
18498
18499
 
18499
18500
  case 8:
18500
- address = _context35.sent;
18501
+ address = _context34.sent;
18501
18502
  qs = buildQuery([ [ "chain_ids", SUPPORTED_TOKEN_NAMES[input2] || input2 ], [ "limit", input3 ] ]);
18502
18503
  route = "activity/".concat(address).concat(qs);
18503
18504
 
@@ -18522,35 +18523,35 @@ function _typeof(o) {
18522
18523
  "X-Sim-Api-Key": apiKey
18523
18524
  }
18524
18525
  }), finalUrl = _getUrlAndHeaders1.URL, HEADERS = _getUrlAndHeaders1.HEADERS;
18525
- _context35.next = 18;
18526
+ _context34.next = 18;
18526
18527
  return fetch(finalUrl, {
18527
18528
  method: "GET",
18528
18529
  headers: HEADERS
18529
18530
  });
18530
18531
 
18531
18532
  case 18:
18532
- res = _context35.sent;
18533
+ res = _context34.sent;
18533
18534
  if (res.ok) {
18534
- _context35.next = 21;
18535
+ _context34.next = 21;
18535
18536
  break;
18536
18537
  }
18537
18538
  throw new NetworkError(SERVICES_API_KEY.DuneSim, res.status);
18538
18539
 
18539
18540
  case 21:
18540
- _context35.next = 23;
18541
+ _context34.next = 23;
18541
18542
  return res.json();
18542
18543
 
18543
18544
  case 23:
18544
- json = _context35.sent;
18545
- _data6 = type === "activity" ? (_ref27 = (_json$activity = json === null || json === void 0 ? void 0 : json.activity) !== null && _json$activity !== void 0 ? _json$activity : json) !== null && _ref27 !== void 0 ? _ref27 : [] : type === "token-holders" ? (_ref28 = (_json$holders = json === null || json === void 0 ? void 0 : json.holders) !== null && _json$holders !== void 0 ? _json$holders : json) !== null && _ref28 !== void 0 ? _ref28 : [] : type === "price" ? (_ref29 = (_json$tokens = json === null || json === void 0 ? void 0 : json.tokens) !== null && _json$tokens !== void 0 ? _json$tokens : json) !== null && _ref29 !== void 0 ? _ref29 : [] : json !== null && json !== void 0 ? json : [];
18545
+ json = _context34.sent;
18546
+ _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 : [];
18546
18547
  result = Array.isArray(_data6) ? _data6 : [ _data6 ];
18547
18548
  _final = [];
18548
18549
  _iterator43 = _createForOfIteratorHelper(result);
18549
- _context35.prev = 28;
18550
+ _context34.prev = 28;
18550
18551
  _loop4 = _regeneratorRuntime().mark((function _loop4() {
18551
18552
  var item, prices, _resData$tokens$, _chain2, _url, _getUrlAndHeaders10, _finalUrl, _HEADERS, _res, resData, decimals;
18552
- return _regeneratorRuntime().wrap((function _loop4$(_context34) {
18553
- while (1) switch (_context34.prev = _context34.next) {
18553
+ return _regeneratorRuntime().wrap((function _loop4$(_context33) {
18554
+ while (1) switch (_context33.prev = _context33.next) {
18554
18555
  case 0:
18555
18556
  item = _step43.value;
18556
18557
  if (item !== null && item !== void 0 && item.decimals) {
@@ -18581,29 +18582,29 @@ function _typeof(o) {
18581
18582
  delete item["logo"];
18582
18583
  }
18583
18584
  if (!(type === "activity")) {
18584
- _context34.next = 9;
18585
+ _context33.next = 9;
18585
18586
  break;
18586
18587
  }
18587
- _context34.next = 8;
18588
+ _context33.next = 8;
18588
18589
  return getChainName(item.chain_id);
18589
18590
 
18590
18591
  case 8:
18591
- item.chain_id = _context34.sent;
18592
+ item.chain_id = _context33.sent;
18592
18593
 
18593
18594
  case 9:
18594
18595
  if (!(type === "token-holders")) {
18595
- _context34.next = 30;
18596
+ _context33.next = 30;
18596
18597
  break;
18597
18598
  }
18598
18599
  if (!item.balance) {
18599
- _context34.next = 30;
18600
+ _context33.next = 30;
18600
18601
  break;
18601
18602
  }
18602
18603
  if (globalDecimals) {
18603
- _context34.next = 29;
18604
+ _context33.next = 29;
18604
18605
  break;
18605
18606
  }
18606
- _context34.prev = 12;
18607
+ _context33.prev = 12;
18607
18608
  _chain2 = SUPPORTED_TOKEN_NAMES[input2] || input2;
18608
18609
  _url = "https://api.sim.dune.com/v1/evm/token-info/".concat(input1, "?chain_ids=").concat(_chain2);
18609
18610
  _getUrlAndHeaders10 = getUrlAndHeaders({
@@ -18613,28 +18614,28 @@ function _typeof(o) {
18613
18614
  "X-Sim-Api-Key": apiKey
18614
18615
  }
18615
18616
  }), _finalUrl = _getUrlAndHeaders10.URL, _HEADERS = _getUrlAndHeaders10.HEADERS;
18616
- _context34.next = 18;
18617
+ _context33.next = 18;
18617
18618
  return fetch(_finalUrl, {
18618
18619
  method: "GET",
18619
18620
  headers: _HEADERS
18620
18621
  });
18621
18622
 
18622
18623
  case 18:
18623
- _res = _context34.sent;
18624
- _context34.next = 21;
18624
+ _res = _context33.sent;
18625
+ _context33.next = 21;
18625
18626
  return _res.json();
18626
18627
 
18627
18628
  case 21:
18628
- resData = _context34.sent;
18629
+ resData = _context33.sent;
18629
18630
  decimals = (_resData$tokens$ = resData.tokens[0]) === null || _resData$tokens$ === void 0 ? void 0 : _resData$tokens$.decimals;
18630
18631
  globalDecimals = decimals;
18631
- _context34.next = 29;
18632
+ _context33.next = 29;
18632
18633
  break;
18633
18634
 
18634
18635
  case 26:
18635
- _context34.prev = 26;
18636
- _context34.t0 = _context34["catch"](12);
18637
- console.log(_context34.t0);
18636
+ _context33.prev = 26;
18637
+ _context33.t0 = _context33["catch"](12);
18638
+ console.log(_context33.t0);
18638
18639
 
18639
18640
  case 29:
18640
18641
  item.balance = formatNumber(item.balance, globalDecimals);
@@ -18644,7 +18645,7 @@ function _typeof(o) {
18644
18645
 
18645
18646
  case 31:
18646
18647
  case "end":
18647
- return _context34.stop();
18648
+ return _context33.stop();
18648
18649
  }
18649
18650
  }), _loop4, null, [ [ 12, 26 ] ]);
18650
18651
  }));
@@ -18652,63 +18653,54 @@ function _typeof(o) {
18652
18653
 
18653
18654
  case 31:
18654
18655
  if ((_step43 = _iterator43.n()).done) {
18655
- _context35.next = 35;
18656
+ _context34.next = 35;
18656
18657
  break;
18657
18658
  }
18658
- return _context35.delegateYield(_loop4(), "t0", 33);
18659
+ return _context34.delegateYield(_loop4(), "t0", 33);
18659
18660
 
18660
18661
  case 33:
18661
- _context35.next = 31;
18662
+ _context34.next = 31;
18662
18663
  break;
18663
18664
 
18664
18665
  case 35:
18665
- _context35.next = 40;
18666
+ _context34.next = 40;
18666
18667
  break;
18667
18668
 
18668
18669
  case 37:
18669
- _context35.prev = 37;
18670
- _context35.t1 = _context35["catch"](28);
18671
- _iterator43.e(_context35.t1);
18670
+ _context34.prev = 37;
18671
+ _context34.t1 = _context34["catch"](28);
18672
+ _iterator43.e(_context34.t1);
18672
18673
 
18673
18674
  case 40:
18674
- _context35.prev = 40;
18675
+ _context34.prev = 40;
18675
18676
  _iterator43.f();
18676
- return _context35.finish(40);
18677
+ return _context34.finish(40);
18677
18678
 
18678
18679
  case 43:
18679
- return _context35.abrupt("return", _final);
18680
+ return _context34.abrupt("return", _final);
18680
18681
 
18681
18682
  case 46:
18682
- _context35.prev = 46;
18683
- _context35.t2 = _context35["catch"](0);
18684
- return _context35.abrupt("return", errorMessageHandler(_context35.t2, "DUNESIM"));
18683
+ _context34.prev = 46;
18684
+ _context34.t2 = _context34["catch"](0);
18685
+ return _context34.abrupt("return", errorMessageHandler(_context34.t2, "DUNESIM"));
18685
18686
 
18686
18687
  case 49:
18687
18688
  case "end":
18688
- return _context35.stop();
18689
+ return _context34.stop();
18689
18690
  }
18690
- }), _callee31, null, [ [ 0, 46 ], [ 28, 37, 40, 43 ] ]);
18691
+ }), _callee30, null, [ [ 0, 46 ], [ 28, 37, 40, 43 ] ]);
18691
18692
  })));
18692
18693
  return _DUNESIM.apply(this, arguments);
18693
18694
  }
18694
- _asyncToGenerator(_regeneratorRuntime().mark((function _callee10() {
18695
- return _regeneratorRuntime().wrap((function _callee10$(_context10) {
18696
- while (1) switch (_context10.prev = _context10.next) {
18697
- case 0:
18698
- case "end":
18699
- return _context10.stop();
18700
- }
18701
- }), _callee10);
18702
- })))();
18703
18695
  function FLVURL() {
18704
18696
  return _FLVURL.apply(this, arguments);
18705
18697
  }
18706
18698
  function _FLVURL() {
18707
- _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee32() {
18708
- return _regeneratorRuntime().wrap((function _callee32$(_context36) {
18709
- while (1) switch (_context36.prev = _context36.next) {
18699
+ _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee31() {
18700
+ return _regeneratorRuntime().wrap((function _callee31$(_context35) {
18701
+ while (1) switch (_context35.prev = _context35.next) {
18710
18702
  case 0:
18711
- return _context36.abrupt("return", new Promise((function(resolve) {
18703
+ return _context35.abrupt("return", new Promise((function(resolve) {
18712
18704
  setTimeout((function() {
18713
18705
  resolve([ {
18714
18706
  Yoo: "gotcha"
@@ -18718,9 +18710,9 @@ function _typeof(o) {
18718
18710
 
18719
18711
  case 1:
18720
18712
  case "end":
18721
- return _context36.stop();
18713
+ return _context35.stop();
18722
18714
  }
18723
- }), _callee32);
18715
+ }), _callee31);
18724
18716
  })));
18725
18717
  return _FLVURL.apply(this, arguments);
18726
18718
  }