@fileverse-dev/formulajs 4.4.21 → 4.4.23

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.21 */
1
+ /* @fileverse-dev/formulajs v4.4.23 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -16526,13 +16526,13 @@ function _typeof(o) {
16526
16526
  return _AAVE.apply(this, arguments);
16527
16527
  }
16528
16528
  function _AAVE() {
16529
- _AAVE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10() {
16530
- var _argsToArray3, _argsToArray4, graphType, category, param1, param2, baseUrl, url, res, json, _args10 = arguments;
16531
- return _regeneratorRuntime().wrap((function _callee10$(_context10) {
16532
- while (1) switch (_context10.prev = _context10.next) {
16529
+ _AAVE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11() {
16530
+ var _argsToArray3, _argsToArray4, graphType, category, param1, param2, baseUrl, url, res, json, _args11 = arguments;
16531
+ return _regeneratorRuntime().wrap((function _callee11$(_context11) {
16532
+ while (1) switch (_context11.prev = _context11.next) {
16533
16533
  case 0:
16534
- _context10.prev = 0;
16535
- _argsToArray3 = argsToArray(_args10), _argsToArray4 = _slicedToArray(_argsToArray3, 4),
16534
+ _context11.prev = 0;
16535
+ _argsToArray3 = argsToArray(_args11), _argsToArray4 = _slicedToArray(_argsToArray3, 4),
16536
16536
  graphType = _argsToArray4[0], category = _argsToArray4[1], param1 = _argsToArray4[2],
16537
16537
  param2 = _argsToArray4[3];
16538
16538
  validateParams(aaveParamsSchema, {
@@ -16543,49 +16543,49 @@ function _typeof(o) {
16543
16543
  });
16544
16544
  baseUrl = "https://onchain-proxy.fileverse.io/third-party";
16545
16545
  url = "".concat(baseUrl) + "?service=aave" + "&graphType=".concat(encodeURIComponent(graphType)) + "&category=".concat(encodeURIComponent(category)) + "&input1=".concat(encodeURIComponent(param1)) + (param2 ? "&input2=".concat(encodeURIComponent(param2)) : "");
16546
- _context10.next = 7;
16546
+ _context11.next = 7;
16547
16547
  return fetch(url);
16548
16548
 
16549
16549
  case 7:
16550
- res = _context10.sent;
16550
+ res = _context11.sent;
16551
16551
  if (res.ok) {
16552
- _context10.next = 10;
16552
+ _context11.next = 10;
16553
16553
  break;
16554
16554
  }
16555
16555
  throw new NetworkError("AAVE", res.status);
16556
16556
 
16557
16557
  case 10:
16558
- _context10.next = 12;
16558
+ _context11.next = 12;
16559
16559
  return res.json();
16560
16560
 
16561
16561
  case 12:
16562
- json = _context10.sent;
16562
+ json = _context11.sent;
16563
16563
  if (!Array.isArray(json)) {
16564
- _context10.next = 15;
16564
+ _context11.next = 15;
16565
16565
  break;
16566
16566
  }
16567
- return _context10.abrupt("return", json.map((function(item) {
16567
+ return _context11.abrupt("return", json.map((function(item) {
16568
16568
  var flat = {};
16569
- Object.entries(item).forEach((function(_ref15) {
16570
- var _ref16 = _slicedToArray(_ref15, 2), k = _ref16[0], v = _ref16[1];
16569
+ Object.entries(item).forEach((function(_ref16) {
16570
+ var _ref17 = _slicedToArray(_ref16, 2), k = _ref17[0], v = _ref17[1];
16571
16571
  if (v === null || _typeof(v) !== "object") flat[k] = v;
16572
16572
  }));
16573
16573
  return flat;
16574
16574
  })));
16575
16575
 
16576
16576
  case 15:
16577
- return _context10.abrupt("return", json);
16577
+ return _context11.abrupt("return", json);
16578
16578
 
16579
16579
  case 18:
16580
- _context10.prev = 18;
16581
- _context10.t0 = _context10["catch"](0);
16582
- return _context10.abrupt("return", errorMessageHandler(_context10.t0, "AAVE"));
16580
+ _context11.prev = 18;
16581
+ _context11.t0 = _context11["catch"](0);
16582
+ return _context11.abrupt("return", errorMessageHandler(_context11.t0, "AAVE"));
16583
16583
 
16584
16584
  case 21:
16585
16585
  case "end":
16586
- return _context10.stop();
16586
+ return _context11.stop();
16587
16587
  }
16588
- }), _callee10, null, [ [ 0, 18 ] ]);
16588
+ }), _callee11, null, [ [ 0, 18 ] ]);
16589
16589
  })));
16590
16590
  return _AAVE.apply(this, arguments);
16591
16591
  }
@@ -16645,16 +16645,16 @@ function _typeof(o) {
16645
16645
  return _fromEnsNameToAddress.apply(this, arguments);
16646
16646
  }
16647
16647
  function _fromEnsNameToAddress() {
16648
- _fromEnsNameToAddress = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11(name) {
16648
+ _fromEnsNameToAddress = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12(name) {
16649
16649
  var ALCHEMY_KEY, provider, resolved;
16650
- return _regeneratorRuntime().wrap((function _callee11$(_context11) {
16651
- while (1) switch (_context11.prev = _context11.next) {
16650
+ return _regeneratorRuntime().wrap((function _callee12$(_context12) {
16651
+ while (1) switch (_context12.prev = _context12.next) {
16652
16652
  case 0:
16653
16653
  if (!(typeof ethers === "undefined")) {
16654
- _context11.next = 3;
16654
+ _context12.next = 3;
16655
16655
  break;
16656
16656
  }
16657
- _context11.next = 3;
16657
+ _context12.next = 3;
16658
16658
  return new Promise((function(resolve, reject) {
16659
16659
  var script = document.createElement("script");
16660
16660
  script.src = "https://cdn.jsdelivr.net/npm/ethers@6.10.0/dist/ethers.umd.min.js";
@@ -16666,33 +16666,33 @@ function _typeof(o) {
16666
16666
  case 3:
16667
16667
  ALCHEMY_KEY = window.localStorage.getItem(UTILITY.ALCHEMY_API_KEY);
16668
16668
  if (ALCHEMY_KEY) {
16669
- _context11.next = 7;
16669
+ _context12.next = 7;
16670
16670
  break;
16671
16671
  }
16672
16672
  console.error("alchemy api key missing");
16673
- return _context11.abrupt("return", null);
16673
+ return _context12.abrupt("return", null);
16674
16674
 
16675
16675
  case 7:
16676
16676
  provider = new ethers.AlchemyProvider("mainnet", ALCHEMY_KEY);
16677
- _context11.prev = 8;
16678
- _context11.next = 11;
16677
+ _context12.prev = 8;
16678
+ _context12.next = 11;
16679
16679
  return provider.resolveName(name);
16680
16680
 
16681
16681
  case 11:
16682
- resolved = _context11.sent;
16683
- return _context11.abrupt("return", resolved || null);
16682
+ resolved = _context12.sent;
16683
+ return _context12.abrupt("return", resolved || null);
16684
16684
 
16685
16685
  case 15:
16686
- _context11.prev = 15;
16687
- _context11.t0 = _context11["catch"](8);
16688
- console.error("ENS resolution failed:", _context11.t0.message);
16689
- return _context11.abrupt("return", null);
16686
+ _context12.prev = 15;
16687
+ _context12.t0 = _context12["catch"](8);
16688
+ console.error("ENS resolution failed:", _context12.t0.message);
16689
+ return _context12.abrupt("return", null);
16690
16690
 
16691
16691
  case 19:
16692
16692
  case "end":
16693
- return _context11.stop();
16693
+ return _context12.stop();
16694
16694
  }
16695
- }), _callee11, null, [ [ 8, 15 ] ]);
16695
+ }), _callee12, null, [ [ 8, 15 ] ]);
16696
16696
  })));
16697
16697
  return _fromEnsNameToAddress.apply(this, arguments);
16698
16698
  }
@@ -16883,74 +16883,74 @@ function _typeof(o) {
16883
16883
  return _EOA.apply(this, arguments);
16884
16884
  }
16885
16885
  function _EOA() {
16886
- _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
16887
- var fetchJSON, _argsToArray5, _argsToArray6, addresses, category, chains, startTime, endTime, _argsToArray6$, page, _argsToArray6$2, offset, apiKey, INPUTS, CHAINS, ADDRESS_MAP, _iterator45, _step45, inp, _address, ADDRS, out, _iterator46, _step46, _loop, _ret, _args16 = arguments;
16888
- return _regeneratorRuntime().wrap((function _callee13$(_context16) {
16889
- while (1) switch (_context16.prev = _context16.next) {
16886
+ _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee14() {
16887
+ var fetchJSON, _argsToArray5, _argsToArray6, addresses, category, chains, startTime, endTime, _argsToArray6$, page, _argsToArray6$2, offset, apiKey, INPUTS, CHAINS, ADDRESS_MAP, _iterator46, _step46, inp, _address, ADDRS, out, _iterator47, _step47, _loop, _ret, _args17 = arguments;
16888
+ return _regeneratorRuntime().wrap((function _callee14$(_context17) {
16889
+ while (1) switch (_context17.prev = _context17.next) {
16890
16890
  case 0:
16891
- _context16.prev = 0;
16891
+ _context17.prev = 0;
16892
16892
  fetchJSON = function() {
16893
- var _ref17 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12(url) {
16893
+ var _ref18 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13(url) {
16894
16894
  var _getUrlAndHeaders3, finalUrl, HEADERS, res, json;
16895
- return _regeneratorRuntime().wrap((function _callee12$(_context12) {
16896
- while (1) switch (_context12.prev = _context12.next) {
16895
+ return _regeneratorRuntime().wrap((function _callee13$(_context13) {
16896
+ while (1) switch (_context13.prev = _context13.next) {
16897
16897
  case 0:
16898
16898
  _getUrlAndHeaders3 = getUrlAndHeaders({
16899
16899
  url: url,
16900
16900
  serviceName: "Etherscan",
16901
16901
  headers: {}
16902
16902
  }), finalUrl = _getUrlAndHeaders3.URL, HEADERS = _getUrlAndHeaders3.HEADERS;
16903
- _context12.next = 3;
16903
+ _context13.next = 3;
16904
16904
  return fetch(finalUrl, {
16905
16905
  method: "GET",
16906
16906
  headers: HEADERS
16907
16907
  });
16908
16908
 
16909
16909
  case 3:
16910
- res = _context12.sent;
16910
+ res = _context13.sent;
16911
16911
  if (res.ok) {
16912
- _context12.next = 6;
16912
+ _context13.next = 6;
16913
16913
  break;
16914
16914
  }
16915
16915
  throw new NetworkError(SERVICES_API_KEY.Etherscan, res.status);
16916
16916
 
16917
16917
  case 6:
16918
- _context12.next = 8;
16918
+ _context13.next = 8;
16919
16919
  return res.json();
16920
16920
 
16921
16921
  case 8:
16922
- json = _context12.sent;
16922
+ json = _context13.sent;
16923
16923
  if (!(typeof json.result === "string")) {
16924
- _context12.next = 14;
16924
+ _context13.next = 14;
16925
16925
  break;
16926
16926
  }
16927
16927
  if (!json.result.includes("Invalid API Key")) {
16928
- _context12.next = 12;
16928
+ _context13.next = 12;
16929
16929
  break;
16930
16930
  }
16931
16931
  throw new InvalidApiKeyError(SERVICES_API_KEY.Etherscan);
16932
16932
 
16933
16933
  case 12:
16934
16934
  if (!json.result.includes("Max rate limit reached")) {
16935
- _context12.next = 14;
16935
+ _context13.next = 14;
16936
16936
  break;
16937
16937
  }
16938
16938
  throw new RateLimitError(SERVICES_API_KEY.Etherscan);
16939
16939
 
16940
16940
  case 14:
16941
- return _context12.abrupt("return", json.result);
16941
+ return _context13.abrupt("return", json.result);
16942
16942
 
16943
16943
  case 15:
16944
16944
  case "end":
16945
- return _context12.stop();
16945
+ return _context13.stop();
16946
16946
  }
16947
- }), _callee12);
16947
+ }), _callee13);
16948
16948
  })));
16949
- return function fetchJSON(_x17) {
16950
- return _ref17.apply(this, arguments);
16949
+ return function fetchJSON(_x18) {
16950
+ return _ref18.apply(this, arguments);
16951
16951
  };
16952
16952
  }();
16953
- _argsToArray5 = argsToArray(_args16), _argsToArray6 = _slicedToArray(_argsToArray5, 7),
16953
+ _argsToArray5 = argsToArray(_args17), _argsToArray6 = _slicedToArray(_argsToArray5, 7),
16954
16954
  addresses = _argsToArray6[0], category = _argsToArray6[1], chains = _argsToArray6[2],
16955
16955
  startTime = _argsToArray6[3], endTime = _argsToArray6[4], _argsToArray6$ = _argsToArray6[5],
16956
16956
  page = _argsToArray6$ === void 0 ? 1 : _argsToArray6$, _argsToArray6$2 = _argsToArray6[6],
@@ -16972,90 +16972,90 @@ function _typeof(o) {
16972
16972
  return s.trim();
16973
16973
  })).filter(Boolean);
16974
16974
  ADDRESS_MAP = {};
16975
- _iterator45 = _createForOfIteratorHelper(INPUTS);
16976
- _context16.prev = 9;
16977
- _iterator45.s();
16975
+ _iterator46 = _createForOfIteratorHelper(INPUTS);
16976
+ _context17.prev = 9;
16977
+ _iterator46.s();
16978
16978
 
16979
16979
  case 11:
16980
- if ((_step45 = _iterator45.n()).done) {
16981
- _context16.next = 23;
16980
+ if ((_step46 = _iterator46.n()).done) {
16981
+ _context17.next = 23;
16982
16982
  break;
16983
16983
  }
16984
- inp = _step45.value;
16984
+ inp = _step46.value;
16985
16985
  if (!isAddress$1.isAddress(inp)) {
16986
- _context16.next = 17;
16986
+ _context17.next = 17;
16987
16987
  break;
16988
16988
  }
16989
16989
  ADDRESS_MAP[inp.toLowerCase()] = null;
16990
- _context16.next = 21;
16990
+ _context17.next = 21;
16991
16991
  break;
16992
16992
 
16993
16993
  case 17:
16994
- _context16.next = 19;
16994
+ _context17.next = 19;
16995
16995
  return fromEnsNameToAddress$1.validateAndGetAddress(inp);
16996
16996
 
16997
16997
  case 19:
16998
- _address = _context16.sent;
16998
+ _address = _context17.sent;
16999
16999
  ADDRESS_MAP[_address.toLowerCase()] = _address;
17000
17000
 
17001
17001
  case 21:
17002
- _context16.next = 11;
17002
+ _context17.next = 11;
17003
17003
  break;
17004
17004
 
17005
17005
  case 23:
17006
- _context16.next = 28;
17006
+ _context17.next = 28;
17007
17007
  break;
17008
17008
 
17009
17009
  case 25:
17010
- _context16.prev = 25;
17011
- _context16.t0 = _context16["catch"](9);
17012
- _iterator45.e(_context16.t0);
17010
+ _context17.prev = 25;
17011
+ _context17.t0 = _context17["catch"](9);
17012
+ _iterator46.e(_context17.t0);
17013
17013
 
17014
17014
  case 28:
17015
- _context16.prev = 28;
17016
- _iterator45.f();
17017
- return _context16.finish(28);
17015
+ _context17.prev = 28;
17016
+ _iterator46.f();
17017
+ return _context17.finish(28);
17018
17018
 
17019
17019
  case 31:
17020
17020
  ADDRS = Object.keys(ADDRESS_MAP);
17021
17021
  out = [];
17022
- _iterator46 = _createForOfIteratorHelper(CHAINS);
17023
- _context16.prev = 34;
17022
+ _iterator47 = _createForOfIteratorHelper(CHAINS);
17023
+ _context17.prev = 34;
17024
17024
  _loop = _regeneratorRuntime().mark((function _loop() {
17025
17025
  var chain, chainId, _loop2, _ret2, i, sb, eb, _loop3, _ret3, _i10, _ADDRS;
17026
- return _regeneratorRuntime().wrap((function _loop$(_context15) {
17027
- while (1) switch (_context15.prev = _context15.next) {
17026
+ return _regeneratorRuntime().wrap((function _loop$(_context16) {
17027
+ while (1) switch (_context16.prev = _context16.next) {
17028
17028
  case 0:
17029
- chain = _step46.value;
17029
+ chain = _step47.value;
17030
17030
  chainId = CHAIN_ID_MAP[chain];
17031
17031
  if (chainId) {
17032
- _context15.next = 4;
17032
+ _context16.next = 4;
17033
17033
  break;
17034
17034
  }
17035
17035
  throw new ValidationError("Invalid chain: ".concat(chain));
17036
17036
 
17037
17037
  case 4:
17038
17038
  if (!(category === "balance")) {
17039
- _context15.next = 17;
17039
+ _context16.next = 17;
17040
17040
  break;
17041
17041
  }
17042
17042
  _loop2 = _regeneratorRuntime().mark((function _loop2(i) {
17043
17043
  var slice, url, data;
17044
- return _regeneratorRuntime().wrap((function _loop2$(_context13) {
17045
- while (1) switch (_context13.prev = _context13.next) {
17044
+ return _regeneratorRuntime().wrap((function _loop2$(_context14) {
17045
+ while (1) switch (_context14.prev = _context14.next) {
17046
17046
  case 0:
17047
17047
  slice = ADDRS.slice(i, i + 20).join(",");
17048
17048
  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);
17049
- _context13.next = 4;
17049
+ _context14.next = 4;
17050
17050
  return fetchJSON(url);
17051
17051
 
17052
17052
  case 4:
17053
- data = _context13.sent;
17053
+ data = _context14.sent;
17054
17054
  if (Array.isArray(data)) {
17055
- _context13.next = 7;
17055
+ _context14.next = 7;
17056
17056
  break;
17057
17057
  }
17058
- return _context13.abrupt("return", {
17058
+ return _context14.abrupt("return", {
17059
17059
  v: {
17060
17060
  v: data
17061
17061
  }
@@ -17072,7 +17072,7 @@ function _typeof(o) {
17072
17072
 
17073
17073
  case 8:
17074
17074
  case "end":
17075
- return _context13.stop();
17075
+ return _context14.stop();
17076
17076
  }
17077
17077
  }), _loop2);
17078
17078
  }));
@@ -17080,48 +17080,48 @@ function _typeof(o) {
17080
17080
 
17081
17081
  case 7:
17082
17082
  if (!(i < ADDRS.length)) {
17083
- _context15.next = 15;
17083
+ _context16.next = 15;
17084
17084
  break;
17085
17085
  }
17086
- return _context15.delegateYield(_loop2(i), "t0", 9);
17086
+ return _context16.delegateYield(_loop2(i), "t0", 9);
17087
17087
 
17088
17088
  case 9:
17089
- _ret2 = _context15.t0;
17089
+ _ret2 = _context16.t0;
17090
17090
  if (!_ret2) {
17091
- _context15.next = 12;
17091
+ _context16.next = 12;
17092
17092
  break;
17093
17093
  }
17094
- return _context15.abrupt("return", _ret2.v);
17094
+ return _context16.abrupt("return", _ret2.v);
17095
17095
 
17096
17096
  case 12:
17097
17097
  i += 20;
17098
- _context15.next = 7;
17098
+ _context16.next = 7;
17099
17099
  break;
17100
17100
 
17101
17101
  case 15:
17102
- _context15.next = 37;
17102
+ _context16.next = 37;
17103
17103
  break;
17104
17104
 
17105
17105
  case 17:
17106
- _context15.next = 19;
17106
+ _context16.next = 19;
17107
17107
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startTime), chain, apiKey);
17108
17108
 
17109
17109
  case 19:
17110
- sb = _context15.sent;
17111
- _context15.next = 22;
17110
+ sb = _context16.sent;
17111
+ _context16.next = 22;
17112
17112
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endTime), chain, apiKey);
17113
17113
 
17114
17114
  case 22:
17115
- eb = _context15.sent;
17115
+ eb = _context16.sent;
17116
17116
  if (sb) {
17117
- _context15.next = 25;
17117
+ _context16.next = 25;
17118
17118
  break;
17119
17119
  }
17120
17120
  throw new ValidationError("Invalid startTime: ".concat(startTime));
17121
17121
 
17122
17122
  case 25:
17123
17123
  if (eb) {
17124
- _context15.next = 27;
17124
+ _context16.next = 27;
17125
17125
  break;
17126
17126
  }
17127
17127
  throw new ValidationError("Invalid endTime: ".concat(endTime));
@@ -17129,21 +17129,21 @@ function _typeof(o) {
17129
17129
  case 27:
17130
17130
  _loop3 = _regeneratorRuntime().mark((function _loop3() {
17131
17131
  var addr, url, data;
17132
- return _regeneratorRuntime().wrap((function _loop3$(_context14) {
17133
- while (1) switch (_context14.prev = _context14.next) {
17132
+ return _regeneratorRuntime().wrap((function _loop3$(_context15) {
17133
+ while (1) switch (_context15.prev = _context15.next) {
17134
17134
  case 0:
17135
17135
  addr = _ADDRS[_i10];
17136
17136
  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);
17137
- _context14.next = 4;
17137
+ _context15.next = 4;
17138
17138
  return fetchJSON(url);
17139
17139
 
17140
17140
  case 4:
17141
- data = _context14.sent;
17141
+ data = _context15.sent;
17142
17142
  if (Array.isArray(data)) {
17143
- _context14.next = 7;
17143
+ _context15.next = 7;
17144
17144
  break;
17145
17145
  }
17146
- return _context14.abrupt("return", {
17146
+ return _context15.abrupt("return", {
17147
17147
  v: {
17148
17148
  v: data
17149
17149
  }
@@ -17160,7 +17160,7 @@ function _typeof(o) {
17160
17160
 
17161
17161
  case 8:
17162
17162
  case "end":
17163
- return _context14.stop();
17163
+ return _context15.stop();
17164
17164
  }
17165
17165
  }), _loop3);
17166
17166
  }));
@@ -17168,78 +17168,78 @@ function _typeof(o) {
17168
17168
 
17169
17169
  case 29:
17170
17170
  if (!(_i10 < _ADDRS.length)) {
17171
- _context15.next = 37;
17171
+ _context16.next = 37;
17172
17172
  break;
17173
17173
  }
17174
- return _context15.delegateYield(_loop3(), "t1", 31);
17174
+ return _context16.delegateYield(_loop3(), "t1", 31);
17175
17175
 
17176
17176
  case 31:
17177
- _ret3 = _context15.t1;
17177
+ _ret3 = _context16.t1;
17178
17178
  if (!_ret3) {
17179
- _context15.next = 34;
17179
+ _context16.next = 34;
17180
17180
  break;
17181
17181
  }
17182
- return _context15.abrupt("return", _ret3.v);
17182
+ return _context16.abrupt("return", _ret3.v);
17183
17183
 
17184
17184
  case 34:
17185
17185
  _i10++;
17186
- _context15.next = 29;
17186
+ _context16.next = 29;
17187
17187
  break;
17188
17188
 
17189
17189
  case 37:
17190
17190
  case "end":
17191
- return _context15.stop();
17191
+ return _context16.stop();
17192
17192
  }
17193
17193
  }), _loop);
17194
17194
  }));
17195
- _iterator46.s();
17195
+ _iterator47.s();
17196
17196
 
17197
17197
  case 37:
17198
- if ((_step46 = _iterator46.n()).done) {
17199
- _context16.next = 44;
17198
+ if ((_step47 = _iterator47.n()).done) {
17199
+ _context17.next = 44;
17200
17200
  break;
17201
17201
  }
17202
- return _context16.delegateYield(_loop(), "t1", 39);
17202
+ return _context17.delegateYield(_loop(), "t1", 39);
17203
17203
 
17204
17204
  case 39:
17205
- _ret = _context16.t1;
17205
+ _ret = _context17.t1;
17206
17206
  if (!_ret) {
17207
- _context16.next = 42;
17207
+ _context17.next = 42;
17208
17208
  break;
17209
17209
  }
17210
- return _context16.abrupt("return", _ret.v);
17210
+ return _context17.abrupt("return", _ret.v);
17211
17211
 
17212
17212
  case 42:
17213
- _context16.next = 37;
17213
+ _context17.next = 37;
17214
17214
  break;
17215
17215
 
17216
17216
  case 44:
17217
- _context16.next = 49;
17217
+ _context17.next = 49;
17218
17218
  break;
17219
17219
 
17220
17220
  case 46:
17221
- _context16.prev = 46;
17222
- _context16.t2 = _context16["catch"](34);
17223
- _iterator46.e(_context16.t2);
17221
+ _context17.prev = 46;
17222
+ _context17.t2 = _context17["catch"](34);
17223
+ _iterator47.e(_context17.t2);
17224
17224
 
17225
17225
  case 49:
17226
- _context16.prev = 49;
17227
- _iterator46.f();
17228
- return _context16.finish(49);
17226
+ _context17.prev = 49;
17227
+ _iterator47.f();
17228
+ return _context17.finish(49);
17229
17229
 
17230
17230
  case 52:
17231
- return _context16.abrupt("return", out);
17231
+ return _context17.abrupt("return", out);
17232
17232
 
17233
17233
  case 55:
17234
- _context16.prev = 55;
17235
- _context16.t3 = _context16["catch"](0);
17236
- return _context16.abrupt("return", errorMessageHandler(_context16.t3, "EOA"));
17234
+ _context17.prev = 55;
17235
+ _context17.t3 = _context17["catch"](0);
17236
+ return _context17.abrupt("return", errorMessageHandler(_context17.t3, "EOA"));
17237
17237
 
17238
17238
  case 58:
17239
17239
  case "end":
17240
- return _context16.stop();
17240
+ return _context17.stop();
17241
17241
  }
17242
- }), _callee13, null, [ [ 0, 55 ], [ 9, 25, 28, 31 ], [ 34, 46, 49, 52 ] ]);
17242
+ }), _callee14, null, [ [ 0, 55 ], [ 9, 25, 28, 31 ], [ 34, 46, 49, 52 ] ]);
17243
17243
  })));
17244
17244
  return _EOA.apply(this, arguments);
17245
17245
  }
@@ -17267,10 +17267,10 @@ function _typeof(o) {
17267
17267
  return _handleScanRequest.apply(this, arguments);
17268
17268
  }
17269
17269
  function _handleScanRequest() {
17270
- _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee14(_ref13) {
17270
+ _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15(_ref13) {
17271
17271
  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;
17272
- return _regeneratorRuntime().wrap((function _callee14$(_context17) {
17273
- while (1) switch (_context17.prev = _context17.next) {
17272
+ return _regeneratorRuntime().wrap((function _callee15$(_context18) {
17273
+ while (1) switch (_context18.prev = _context18.next) {
17274
17274
  case 0:
17275
17275
  type = _ref13.type, address = _ref13.address, startDate = _ref13.startDate, endDate = _ref13.endDate,
17276
17276
  _ref13$page = _ref13.page, page = _ref13$page === void 0 ? 1 : _ref13$page, _ref13$offset = _ref13.offset,
@@ -17291,20 +17291,20 @@ function _typeof(o) {
17291
17291
  }
17292
17292
  };
17293
17293
  if (!(type !== "gas")) {
17294
- _context17.next = 6;
17294
+ _context18.next = 6;
17295
17295
  break;
17296
17296
  }
17297
- _context17.next = 5;
17297
+ _context18.next = 5;
17298
17298
  return fromEnsNameToAddress$1.validateAndGetAddress(address);
17299
17299
 
17300
17300
  case 5:
17301
- address = _context17.sent;
17301
+ address = _context18.sent;
17302
17302
 
17303
17303
  case 6:
17304
17304
  apiInfo = API_INFO_MAP[functionName];
17305
17305
  baseUrl = apiInfo === null || apiInfo === void 0 ? void 0 : apiInfo.url;
17306
17306
  if (baseUrl) {
17307
- _context17.next = 10;
17307
+ _context18.next = 10;
17308
17308
  break;
17309
17309
  }
17310
17310
  throw new ValidationError("Api not found for: ".concat(functionName));
@@ -17318,7 +17318,7 @@ function _typeof(o) {
17318
17318
  };
17319
17319
  action = ACTION_MAP[type];
17320
17320
  if (action) {
17321
- _context17.next = 14;
17321
+ _context18.next = 14;
17322
17322
  break;
17323
17323
  }
17324
17324
  throw new ValidationError("Invalid type: ".concat(type));
@@ -17327,19 +17327,19 @@ function _typeof(o) {
17327
17327
  module = action === "gasoracle" ? "gastracker" : "account";
17328
17328
  url = "".concat(baseUrl, "?chainid=").concat(chainId, "&module=").concat(module, "&action=").concat(action, "&apikey=").concat(apiKey);
17329
17329
  if (![ "all-txns", "token-txns", "nft-txns" ].includes(type)) {
17330
- _context17.next = 27;
17330
+ _context18.next = 27;
17331
17331
  break;
17332
17332
  }
17333
17333
  url += "&address=".concat(address, "&startblock=0&endblock=99999999&sort=asc");
17334
17334
  if (!(!isNaN(startDate) && !isNaN(endDate))) {
17335
- _context17.next = 26;
17335
+ _context18.next = 26;
17336
17336
  break;
17337
17337
  }
17338
- _context17.next = 21;
17338
+ _context18.next = 21;
17339
17339
  return Promise.all([ fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startDate), network, apiKey), fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endDate), network, apiKey) ]);
17340
17340
 
17341
17341
  case 21:
17342
- _yield$Promise$all = _context17.sent;
17342
+ _yield$Promise$all = _context18.sent;
17343
17343
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
17344
17344
  startBlock = _yield$Promise$all2[0];
17345
17345
  endBlock = _yield$Promise$all2[1];
@@ -17354,51 +17354,51 @@ function _typeof(o) {
17354
17354
  serviceName: apiInfo.apiKeyName,
17355
17355
  headers: {}
17356
17356
  }), finalUrl = _getUrlAndHeaders4.URL, HEADERS = _getUrlAndHeaders4.HEADERS;
17357
- _context17.next = 30;
17357
+ _context18.next = 30;
17358
17358
  return fetch(finalUrl, {
17359
17359
  method: "GET",
17360
17360
  headers: HEADERS
17361
17361
  });
17362
17362
 
17363
17363
  case 30:
17364
- res = _context17.sent;
17364
+ res = _context18.sent;
17365
17365
  if (res.ok) {
17366
- _context17.next = 33;
17366
+ _context18.next = 33;
17367
17367
  break;
17368
17368
  }
17369
17369
  throw new NetworkError(apiInfo.apiKeyName, res.status);
17370
17370
 
17371
17371
  case 33:
17372
- _context17.next = 35;
17372
+ _context18.next = 35;
17373
17373
  return res.json();
17374
17374
 
17375
17375
  case 35:
17376
- json = _context17.sent;
17376
+ json = _context18.sent;
17377
17377
  if (!(typeof json.result === "string")) {
17378
- _context17.next = 41;
17378
+ _context18.next = 41;
17379
17379
  break;
17380
17380
  }
17381
17381
  if (!json.result.includes("Invalid API Key")) {
17382
- _context17.next = 39;
17382
+ _context18.next = 39;
17383
17383
  break;
17384
17384
  }
17385
17385
  throw new InvalidApiKeyError(apiInfo.apiKeyName);
17386
17386
 
17387
17387
  case 39:
17388
17388
  if (!json.result.includes("Max rate limit reached")) {
17389
- _context17.next = 41;
17389
+ _context18.next = 41;
17390
17390
  break;
17391
17391
  }
17392
17392
  throw new RateLimitError(apiInfo.apiKeyName);
17393
17393
 
17394
17394
  case 41:
17395
- return _context17.abrupt("return", type === "gas" && !Array.isArray(json.result) ? [ json.result ] : json.result);
17395
+ return _context18.abrupt("return", type === "gas" && !Array.isArray(json.result) ? [ json.result ] : json.result);
17396
17396
 
17397
17397
  case 42:
17398
17398
  case "end":
17399
- return _context17.stop();
17399
+ return _context18.stop();
17400
17400
  }
17401
- }), _callee14);
17401
+ }), _callee15);
17402
17402
  })));
17403
17403
  return _handleScanRequest.apply(this, arguments);
17404
17404
  }
@@ -17406,13 +17406,13 @@ function _typeof(o) {
17406
17406
  return _BASE.apply(this, arguments);
17407
17407
  }
17408
17408
  function _BASE() {
17409
- _BASE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15() {
17410
- var _argsToArray7, _argsToArray8, type, address, startDate, endDate, page, limit, API_KEY, _args18 = arguments;
17411
- return _regeneratorRuntime().wrap((function _callee15$(_context18) {
17412
- while (1) switch (_context18.prev = _context18.next) {
17409
+ _BASE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee16() {
17410
+ var _argsToArray7, _argsToArray8, type, address, startDate, endDate, page, limit, API_KEY, _args19 = arguments;
17411
+ return _regeneratorRuntime().wrap((function _callee16$(_context19) {
17412
+ while (1) switch (_context19.prev = _context19.next) {
17413
17413
  case 0:
17414
- _context18.prev = 0;
17415
- _argsToArray7 = argsToArray(_args18), _argsToArray8 = _slicedToArray(_argsToArray7, 6),
17414
+ _context19.prev = 0;
17415
+ _argsToArray7 = argsToArray(_args19), _argsToArray8 = _slicedToArray(_argsToArray7, 6),
17416
17416
  type = _argsToArray8[0], address = _argsToArray8[1], startDate = _argsToArray8[2],
17417
17417
  endDate = _argsToArray8[3], page = _argsToArray8[4], limit = _argsToArray8[5];
17418
17418
  validateParams(baseParamsSchema, {
@@ -17424,7 +17424,7 @@ function _typeof(o) {
17424
17424
  limit: limit
17425
17425
  });
17426
17426
  API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Basescan);
17427
- _context18.next = 6;
17427
+ _context19.next = 6;
17428
17428
  return handleScanRequest({
17429
17429
  type: type,
17430
17430
  address: address,
@@ -17439,18 +17439,18 @@ function _typeof(o) {
17439
17439
  });
17440
17440
 
17441
17441
  case 6:
17442
- return _context18.abrupt("return", _context18.sent);
17442
+ return _context19.abrupt("return", _context19.sent);
17443
17443
 
17444
17444
  case 9:
17445
- _context18.prev = 9;
17446
- _context18.t0 = _context18["catch"](0);
17447
- return _context18.abrupt("return", errorMessageHandler(_context18.t0, "BASE"));
17445
+ _context19.prev = 9;
17446
+ _context19.t0 = _context19["catch"](0);
17447
+ return _context19.abrupt("return", errorMessageHandler(_context19.t0, "BASE"));
17448
17448
 
17449
17449
  case 12:
17450
17450
  case "end":
17451
- return _context18.stop();
17451
+ return _context19.stop();
17452
17452
  }
17453
- }), _callee15, null, [ [ 0, 9 ] ]);
17453
+ }), _callee16, null, [ [ 0, 9 ] ]);
17454
17454
  })));
17455
17455
  return _BASE.apply(this, arguments);
17456
17456
  }
@@ -17469,13 +17469,13 @@ function _typeof(o) {
17469
17469
  return _BLOCKSCOUT.apply(this, arguments);
17470
17470
  }
17471
17471
  function _BLOCKSCOUT() {
17472
- _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee16() {
17473
- var _json$result, _json$result2, _argsToArray9, _argsToArray0, address, type, _argsToArray0$, chain, startTimestamp, endTimestamp, page, offset, startTs, endTs, resolvedAddress, hostname, requestUrl, response, json, _args19 = arguments;
17474
- return _regeneratorRuntime().wrap((function _callee16$(_context19) {
17475
- while (1) switch (_context19.prev = _context19.next) {
17472
+ _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
17473
+ var _json$result, _json$result2, _argsToArray9, _argsToArray0, address, type, _argsToArray0$, chain, startTimestamp, endTimestamp, page, offset, startTs, endTs, resolvedAddress, hostname, requestUrl, response, json, _args20 = arguments;
17474
+ return _regeneratorRuntime().wrap((function _callee17$(_context20) {
17475
+ while (1) switch (_context20.prev = _context20.next) {
17476
17476
  case 0:
17477
- _context19.prev = 0;
17478
- _argsToArray9 = argsToArray(_args19), _argsToArray0 = _slicedToArray(_argsToArray9, 7),
17477
+ _context20.prev = 0;
17478
+ _argsToArray9 = argsToArray(_args20), _argsToArray0 = _slicedToArray(_argsToArray9, 7),
17479
17479
  address = _argsToArray0[0], type = _argsToArray0[1], _argsToArray0$ = _argsToArray0[2],
17480
17480
  chain = _argsToArray0$ === void 0 ? "ethereum" : _argsToArray0$, startTimestamp = _argsToArray0[3],
17481
17481
  endTimestamp = _argsToArray0[4], page = _argsToArray0[5], offset = _argsToArray0[6];
@@ -17490,72 +17490,72 @@ function _typeof(o) {
17490
17490
  });
17491
17491
  startTs = startTimestamp !== null && startTimestamp !== void 0 ? startTimestamp : Math.floor((Date.now() - 30 * 24 * 3600 * 1e3) / 1e3);
17492
17492
  endTs = endTimestamp;
17493
- _context19.next = 7;
17493
+ _context20.next = 7;
17494
17494
  return fromEnsNameToAddress$1.validateAndGetAddress(address);
17495
17495
 
17496
17496
  case 7:
17497
- resolvedAddress = _context19.sent;
17497
+ resolvedAddress = _context20.sent;
17498
17498
  hostname = BLOCKSCOUT_CHAINS_MAP[chain];
17499
- _context19.t0 = type;
17500
- _context19.next = _context19.t0 === "stat" ? 12 : _context19.t0 === "txns" ? 14 : _context19.t0 === "tokens" ? 16 : 18;
17499
+ _context20.t0 = type;
17500
+ _context20.next = _context20.t0 === "stat" ? 12 : _context20.t0 === "txns" ? 14 : _context20.t0 === "tokens" ? 16 : 18;
17501
17501
  break;
17502
17502
 
17503
17503
  case 12:
17504
17504
  requestUrl = "".concat(hostname, "/api/v2/addresses/").concat(resolvedAddress, "/counters");
17505
- return _context19.abrupt("break", 18);
17505
+ return _context20.abrupt("break", 18);
17506
17506
 
17507
17507
  case 14:
17508
17508
  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";
17509
- return _context19.abrupt("break", 18);
17509
+ return _context20.abrupt("break", 18);
17510
17510
 
17511
17511
  case 16:
17512
17512
  requestUrl = "".concat(hostname, "/api?module=account&action=tokenlist") + "&address=".concat(resolvedAddress);
17513
- return _context19.abrupt("break", 18);
17513
+ return _context20.abrupt("break", 18);
17514
17514
 
17515
17515
  case 18:
17516
- _context19.next = 20;
17516
+ _context20.next = 20;
17517
17517
  return fetch(requestUrl);
17518
17518
 
17519
17519
  case 20:
17520
- response = _context19.sent;
17520
+ response = _context20.sent;
17521
17521
  if (response.ok) {
17522
- _context19.next = 23;
17522
+ _context20.next = 23;
17523
17523
  break;
17524
17524
  }
17525
17525
  throw new NetworkError("BLOCKSCOUT", response.status);
17526
17526
 
17527
17527
  case 23:
17528
- _context19.next = 25;
17528
+ _context20.next = 25;
17529
17529
  return response.json();
17530
17530
 
17531
17531
  case 25:
17532
- json = _context19.sent;
17532
+ json = _context20.sent;
17533
17533
  if (!(json !== null && json !== void 0 && (_json$result = json.result) !== null && _json$result !== void 0 && _json$result.includes("Invalid parameter(s)"))) {
17534
- _context19.next = 28;
17534
+ _context20.next = 28;
17535
17535
  break;
17536
17536
  }
17537
17537
  throw new ValidationError("Invalid parameters");
17538
17538
 
17539
17539
  case 28:
17540
17540
  if (!(json !== null && json !== void 0 && (_json$result2 = json.result) !== null && _json$result2 !== void 0 && _json$result2.includes("Not found"))) {
17541
- _context19.next = 30;
17541
+ _context20.next = 30;
17542
17542
  break;
17543
17543
  }
17544
17544
  throw new ValidationError("Address information not found");
17545
17545
 
17546
17546
  case 30:
17547
- return _context19.abrupt("return", type === "stat" ? [ json ] : json.result);
17547
+ return _context20.abrupt("return", type === "stat" ? [ json ] : json.result);
17548
17548
 
17549
17549
  case 33:
17550
- _context19.prev = 33;
17551
- _context19.t1 = _context19["catch"](0);
17552
- return _context19.abrupt("return", errorMessageHandler(_context19.t1, "BLOCKSCOUT"));
17550
+ _context20.prev = 33;
17551
+ _context20.t1 = _context20["catch"](0);
17552
+ return _context20.abrupt("return", errorMessageHandler(_context20.t1, "BLOCKSCOUT"));
17553
17553
 
17554
17554
  case 36:
17555
17555
  case "end":
17556
- return _context19.stop();
17556
+ return _context20.stop();
17557
17557
  }
17558
- }), _callee16, null, [ [ 0, 33 ] ]);
17558
+ }), _callee17, null, [ [ 0, 33 ] ]);
17559
17559
  })));
17560
17560
  return _BLOCKSCOUT.apply(this, arguments);
17561
17561
  }
@@ -17572,7 +17572,7 @@ function _typeof(o) {
17572
17572
  }), {
17573
17573
  message: "param2 must contain at least one of: '1h', '24h', '7d', '14d', '30d', '200d', '1y'"
17574
17574
  }).optional();
17575
- var priceSchema = objectType({
17575
+ var priceSchema$1 = objectType({
17576
17576
  category: literalType("price"),
17577
17577
  param1: stringType().nonempty(),
17578
17578
  param2: stringType().nonempty().optional()
@@ -17594,18 +17594,18 @@ function _typeof(o) {
17594
17594
  param1: stringType().nonempty(),
17595
17595
  param2: anyType().optional()
17596
17596
  });
17597
- var coingeckoParamsSchema = discriminatedUnionType("category", [ priceSchema, marketSchema, stablecoinsSchema, derivativesSchema ]);
17597
+ var coingeckoParamsSchema = discriminatedUnionType("category", [ priceSchema$1, marketSchema, stablecoinsSchema, derivativesSchema ]);
17598
17598
  function COINGECKO() {
17599
17599
  return _COINGECKO.apply(this, arguments);
17600
17600
  }
17601
17601
  function _COINGECKO() {
17602
- _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
17603
- 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;
17604
- return _regeneratorRuntime().wrap((function _callee17$(_context20) {
17605
- while (1) switch (_context20.prev = _context20.next) {
17602
+ _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee18() {
17603
+ 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, _data2, _args21 = arguments;
17604
+ return _regeneratorRuntime().wrap((function _callee18$(_context21) {
17605
+ while (1) switch (_context21.prev = _context21.next) {
17606
17606
  case 0:
17607
- _context20.prev = 0;
17608
- _argsToArray1 = argsToArray(_args20), _argsToArray10 = _slicedToArray(_argsToArray1, 3),
17607
+ _context21.prev = 0;
17608
+ _argsToArray1 = argsToArray(_args21), _argsToArray10 = _slicedToArray(_argsToArray1, 3),
17609
17609
  category = _argsToArray10[0], param1 = _argsToArray10[1], param2 = _argsToArray10[2];
17610
17610
  validateParams(coingeckoParamsSchema, {
17611
17611
  category: category,
@@ -17618,14 +17618,14 @@ function _typeof(o) {
17618
17618
  "x-cg-demo-api-key": apiKey
17619
17619
  };
17620
17620
  url = "";
17621
- _context20.t0 = category === null || category === void 0 || (_category$toLowerCase = category.toLowerCase) === null || _category$toLowerCase === void 0 ? void 0 : _category$toLowerCase.call(category);
17622
- _context20.next = _context20.t0 === "price" ? 9 : _context20.t0 === "market" ? 12 : _context20.t0 === "stablecoins" ? 17 : _context20.t0 === "derivatives" ? 21 : 23;
17621
+ _context21.t0 = category === null || category === void 0 || (_category$toLowerCase = category.toLowerCase) === null || _category$toLowerCase === void 0 ? void 0 : _category$toLowerCase.call(category);
17622
+ _context21.next = _context21.t0 === "price" ? 9 : _context21.t0 === "market" ? 12 : _context21.t0 === "stablecoins" ? 17 : _context21.t0 === "derivatives" ? 21 : 23;
17623
17623
  break;
17624
17624
 
17625
17625
  case 9:
17626
17626
  vs = param2 || "usd";
17627
17627
  url = "https://api.coingecko.com/api/v3/simple/price?vs_currencies=".concat(vs, "&symbols=").concat(param1);
17628
- return _context20.abrupt("break", 23);
17628
+ return _context21.abrupt("break", 23);
17629
17629
 
17630
17630
  case 12:
17631
17631
  map = {
@@ -17642,17 +17642,17 @@ function _typeof(o) {
17642
17642
  _category = map[param1] || "";
17643
17643
  trend = param2 ? "&price_change_percentage=".concat(param2) : "";
17644
17644
  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);
17645
- return _context20.abrupt("break", 23);
17645
+ return _context21.abrupt("break", 23);
17646
17646
 
17647
17647
  case 17:
17648
17648
  _category2 = param1 === "all" ? "stablecoins" : param1;
17649
17649
  _trend = param2 ? "&price_change_percentage=".concat(param2) : "";
17650
17650
  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);
17651
- return _context20.abrupt("break", 23);
17651
+ return _context21.abrupt("break", 23);
17652
17652
 
17653
17653
  case 21:
17654
17654
  url = !param1 || param1 === "all" ? "https://api.coingecko.com/api/v3/derivatives" : "https://api.coingecko.com/api/v3/derivatives/exchanges/".concat(param1, "?include_tickers=all");
17655
- return _context20.abrupt("break", 23);
17655
+ return _context21.abrupt("break", 23);
17656
17656
 
17657
17657
  case 23:
17658
17658
  _getUrlAndHeaders5 = getUrlAndHeaders({
@@ -17660,25 +17660,25 @@ function _typeof(o) {
17660
17660
  serviceName: "Coingecko",
17661
17661
  headers: headers
17662
17662
  }), finalUrl = _getUrlAndHeaders5.URL, HEADERS = _getUrlAndHeaders5.HEADERS;
17663
- _context20.next = 26;
17663
+ _context21.next = 26;
17664
17664
  return fetch(finalUrl + "?refresh=true", {
17665
17665
  headers: HEADERS
17666
17666
  });
17667
17667
 
17668
17668
  case 26:
17669
- res = _context20.sent;
17670
- _context20.next = 29;
17669
+ res = _context21.sent;
17670
+ _context21.next = 29;
17671
17671
  return res.json();
17672
17672
 
17673
17673
  case 29:
17674
- json = _context20.sent;
17674
+ json = _context21.sent;
17675
17675
  if (res.ok) {
17676
- _context20.next = 35;
17676
+ _context21.next = 35;
17677
17677
  break;
17678
17678
  }
17679
17679
  msg = (json === null || json === void 0 || (_json$status = json.status) === null || _json$status === void 0 ? void 0 : _json$status.error_message) || "";
17680
17680
  if (!msg.includes("API Key Missing")) {
17681
- _context20.next = 34;
17681
+ _context21.next = 34;
17682
17682
  break;
17683
17683
  }
17684
17684
  throw new InvalidApiKeyError(SERVICES_API_KEY.Coingecko);
@@ -17688,7 +17688,7 @@ function _typeof(o) {
17688
17688
 
17689
17689
  case 35:
17690
17690
  if (!(category === "price")) {
17691
- _context20.next = 39;
17691
+ _context21.next = 39;
17692
17692
  break;
17693
17693
  }
17694
17694
  out = {};
@@ -17701,11 +17701,11 @@ function _typeof(o) {
17701
17701
  out["".concat(token.toUpperCase(), "_").concat(cur.toUpperCase())] = val;
17702
17702
  }
17703
17703
  }
17704
- return _context20.abrupt("return", [ out ]);
17704
+ return _context21.abrupt("return", [ out ]);
17705
17705
 
17706
17706
  case 39:
17707
- _data = Array.isArray(json) ? json : [ json ];
17708
- return _context20.abrupt("return", _data.map((function(item) {
17707
+ _data2 = Array.isArray(json) ? json : [ json ];
17708
+ return _context21.abrupt("return", _data2.map((function(item) {
17709
17709
  var flat = {};
17710
17710
  for (var _i13 = 0, _Object$entries3 = Object.entries(item); _i13 < _Object$entries3.length; _i13++) {
17711
17711
  var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i13], 2), key = _Object$entries3$_i[0], _value15 = _Object$entries3$_i[1];
@@ -17717,15 +17717,15 @@ function _typeof(o) {
17717
17717
  })));
17718
17718
 
17719
17719
  case 43:
17720
- _context20.prev = 43;
17721
- _context20.t1 = _context20["catch"](0);
17722
- return _context20.abrupt("return", errorMessageHandler(_context20.t1, "COINGECKO"));
17720
+ _context21.prev = 43;
17721
+ _context21.t1 = _context21["catch"](0);
17722
+ return _context21.abrupt("return", errorMessageHandler(_context21.t1, "COINGECKO"));
17723
17723
 
17724
17724
  case 46:
17725
17725
  case "end":
17726
- return _context20.stop();
17726
+ return _context21.stop();
17727
17727
  }
17728
- }), _callee17, null, [ [ 0, 43 ] ]);
17728
+ }), _callee18, null, [ [ 0, 43 ] ]);
17729
17729
  })));
17730
17730
  return _COINGECKO.apply(this, arguments);
17731
17731
  }
@@ -17743,60 +17743,60 @@ function _typeof(o) {
17743
17743
  return _DEFILLAMA.apply(this, arguments);
17744
17744
  }
17745
17745
  function _DEFILLAMA() {
17746
- _DEFILLAMA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee18() {
17747
- var _argsToArray11, _argsToArray12, category, url, res, json, _args21 = arguments;
17748
- return _regeneratorRuntime().wrap((function _callee18$(_context21) {
17749
- while (1) switch (_context21.prev = _context21.next) {
17746
+ _DEFILLAMA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee19() {
17747
+ var _argsToArray11, _argsToArray12, category, url, res, json, _args22 = arguments;
17748
+ return _regeneratorRuntime().wrap((function _callee19$(_context22) {
17749
+ while (1) switch (_context22.prev = _context22.next) {
17750
17750
  case 0:
17751
- _context21.prev = 0;
17752
- _argsToArray11 = argsToArray(_args21), _argsToArray12 = _slicedToArray(_argsToArray11, 1),
17751
+ _context22.prev = 0;
17752
+ _argsToArray11 = argsToArray(_args22), _argsToArray12 = _slicedToArray(_argsToArray11, 1),
17753
17753
  category = _argsToArray12[0];
17754
17754
  validateParams(defillamaParamsSchema, {
17755
17755
  category: category
17756
17756
  });
17757
17757
  url = CATEGORY_URLS[category];
17758
17758
  if (url) {
17759
- _context21.next = 6;
17759
+ _context22.next = 6;
17760
17760
  break;
17761
17761
  }
17762
17762
  throw new ValidationError("Invalid category: ".concat(category));
17763
17763
 
17764
17764
  case 6:
17765
- _context21.next = 8;
17765
+ _context22.next = 8;
17766
17766
  return fetch(url);
17767
17767
 
17768
17768
  case 8:
17769
- res = _context21.sent;
17769
+ res = _context22.sent;
17770
17770
  if (res.ok) {
17771
- _context21.next = 11;
17771
+ _context22.next = 11;
17772
17772
  break;
17773
17773
  }
17774
17774
  throw new NetworkError(SERVICES_API_KEY.Defillama, res.status);
17775
17775
 
17776
17776
  case 11:
17777
- _context21.next = 13;
17777
+ _context22.next = 13;
17778
17778
  return res.json();
17779
17779
 
17780
17780
  case 13:
17781
- json = _context21.sent;
17782
- _context21.t0 = category;
17783
- _context21.next = _context21.t0 === "protocols" ? 17 : _context21.t0 === "yields" ? 19 : _context21.t0 === "dex" ? 21 : _context21.t0 === "fees" ? 21 : 23;
17781
+ json = _context22.sent;
17782
+ _context22.t0 = category;
17783
+ _context22.next = _context22.t0 === "protocols" ? 17 : _context22.t0 === "yields" ? 19 : _context22.t0 === "dex" ? 21 : _context22.t0 === "fees" ? 21 : 23;
17784
17784
  break;
17785
17785
 
17786
17786
  case 17:
17787
17787
  json = Array.isArray(json) ? json.slice(0, 500) : [];
17788
- return _context21.abrupt("break", 23);
17788
+ return _context22.abrupt("break", 23);
17789
17789
 
17790
17790
  case 19:
17791
17791
  json = Array.isArray(json.data) ? json.data.slice(0, 500) : [];
17792
- return _context21.abrupt("break", 23);
17792
+ return _context22.abrupt("break", 23);
17793
17793
 
17794
17794
  case 21:
17795
17795
  json = Array.isArray(json.protocols) ? json.protocols.slice(0, 500) : [];
17796
- return _context21.abrupt("break", 23);
17796
+ return _context22.abrupt("break", 23);
17797
17797
 
17798
17798
  case 23:
17799
- return _context21.abrupt("return", (Array.isArray(json) ? json : [ json ]).map((function(item) {
17799
+ return _context22.abrupt("return", (Array.isArray(json) ? json : [ json ]).map((function(item) {
17800
17800
  var out = {};
17801
17801
  for (var _i14 = 0, _Object$entries4 = Object.entries(item); _i14 < _Object$entries4.length; _i14++) {
17802
17802
  var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i14], 2), k = _Object$entries4$_i[0], v = _Object$entries4$_i[1];
@@ -17806,15 +17806,15 @@ function _typeof(o) {
17806
17806
  })));
17807
17807
 
17808
17808
  case 26:
17809
- _context21.prev = 26;
17810
- _context21.t1 = _context21["catch"](0);
17811
- return _context21.abrupt("return", errorMessageHandler(_context21.t1, "DEFILLAMA"));
17809
+ _context22.prev = 26;
17810
+ _context22.t1 = _context22["catch"](0);
17811
+ return _context22.abrupt("return", errorMessageHandler(_context22.t1, "DEFILLAMA"));
17812
17812
 
17813
17813
  case 29:
17814
17814
  case "end":
17815
- return _context21.stop();
17815
+ return _context22.stop();
17816
17816
  }
17817
- }), _callee18, null, [ [ 0, 26 ] ]);
17817
+ }), _callee19, null, [ [ 0, 26 ] ]);
17818
17818
  })));
17819
17819
  return _DEFILLAMA.apply(this, arguments);
17820
17820
  }
@@ -17843,13 +17843,13 @@ function _typeof(o) {
17843
17843
  return _ETHERSCAN.apply(this, arguments);
17844
17844
  }
17845
17845
  function _ETHERSCAN() {
17846
- _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee19() {
17847
- var _argsToArray13, _argsToArray14, type, chain, address, startDate, endDate, _argsToArray14$, page, _argsToArray14$2, limit, chainId, apiKey, _args22 = arguments;
17848
- return _regeneratorRuntime().wrap((function _callee19$(_context22) {
17849
- while (1) switch (_context22.prev = _context22.next) {
17846
+ _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20() {
17847
+ var _argsToArray13, _argsToArray14, type, chain, address, startDate, endDate, _argsToArray14$, page, _argsToArray14$2, limit, chainId, apiKey, _args23 = arguments;
17848
+ return _regeneratorRuntime().wrap((function _callee20$(_context23) {
17849
+ while (1) switch (_context23.prev = _context23.next) {
17850
17850
  case 0:
17851
- _context22.prev = 0;
17852
- _argsToArray13 = argsToArray(_args22), _argsToArray14 = _slicedToArray(_argsToArray13, 7),
17851
+ _context23.prev = 0;
17852
+ _argsToArray13 = argsToArray(_args23), _argsToArray14 = _slicedToArray(_argsToArray13, 7),
17853
17853
  type = _argsToArray14[0], chain = _argsToArray14[1], address = _argsToArray14[2],
17854
17854
  startDate = _argsToArray14[3], endDate = _argsToArray14[4], _argsToArray14$ = _argsToArray14[5],
17855
17855
  page = _argsToArray14$ === void 0 ? 1 : _argsToArray14$, _argsToArray14$2 = _argsToArray14[6],
@@ -17865,14 +17865,14 @@ function _typeof(o) {
17865
17865
  });
17866
17866
  chainId = CHAIN_ID_MAP[chain];
17867
17867
  if (chainId) {
17868
- _context22.next = 6;
17868
+ _context23.next = 6;
17869
17869
  break;
17870
17870
  }
17871
17871
  throw new ValidationError("Invalid chain: ".concat(chain));
17872
17872
 
17873
17873
  case 6:
17874
17874
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Etherscan);
17875
- _context22.next = 9;
17875
+ _context23.next = 9;
17876
17876
  return handleScanRequest({
17877
17877
  type: type,
17878
17878
  address: address,
@@ -17887,18 +17887,18 @@ function _typeof(o) {
17887
17887
  });
17888
17888
 
17889
17889
  case 9:
17890
- return _context22.abrupt("return", _context22.sent);
17890
+ return _context23.abrupt("return", _context23.sent);
17891
17891
 
17892
17892
  case 12:
17893
- _context22.prev = 12;
17894
- _context22.t0 = _context22["catch"](0);
17895
- return _context22.abrupt("return", errorMessageHandler(_context22.t0, "ETHERSCAN"));
17893
+ _context23.prev = 12;
17894
+ _context23.t0 = _context23["catch"](0);
17895
+ return _context23.abrupt("return", errorMessageHandler(_context23.t0, "ETHERSCAN"));
17896
17896
 
17897
17897
  case 15:
17898
17898
  case "end":
17899
- return _context22.stop();
17899
+ return _context23.stop();
17900
17900
  }
17901
- }), _callee19, null, [ [ 0, 12 ] ]);
17901
+ }), _callee20, null, [ [ 0, 12 ] ]);
17902
17902
  })));
17903
17903
  return _ETHERSCAN.apply(this, arguments);
17904
17904
  }
@@ -17914,13 +17914,13 @@ function _typeof(o) {
17914
17914
  return _FARCASTER.apply(this, arguments);
17915
17915
  }
17916
17916
  function _FARCASTER() {
17917
- _FARCASTER = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20() {
17918
- var _argsToArray15, _argsToArray16, contentType, identifier, _argsToArray16$, start, _argsToArray16$2, end, apiKey, url, typeMap, _getUrlAndHeaders6, finalUrl, HEADERS, response, _yield$response$json, _data2, _args23 = arguments;
17919
- return _regeneratorRuntime().wrap((function _callee20$(_context23) {
17920
- while (1) switch (_context23.prev = _context23.next) {
17917
+ _FARCASTER = _asyncToGenerator(_regeneratorRuntime().mark((function _callee21() {
17918
+ var _argsToArray15, _argsToArray16, contentType, identifier, _argsToArray16$, start, _argsToArray16$2, end, apiKey, url, typeMap, _getUrlAndHeaders6, finalUrl, HEADERS, response, _yield$response$json, _data3, _args24 = arguments;
17919
+ return _regeneratorRuntime().wrap((function _callee21$(_context24) {
17920
+ while (1) switch (_context24.prev = _context24.next) {
17921
17921
  case 0:
17922
- _context23.prev = 0;
17923
- _argsToArray15 = argsToArray(_args23), _argsToArray16 = _slicedToArray(_argsToArray15, 4),
17922
+ _context24.prev = 0;
17923
+ _argsToArray15 = argsToArray(_args24), _argsToArray16 = _slicedToArray(_argsToArray15, 4),
17924
17924
  contentType = _argsToArray16[0], identifier = _argsToArray16[1], _argsToArray16$ = _argsToArray16[2],
17925
17925
  start = _argsToArray16$ === void 0 ? 0 : _argsToArray16$, _argsToArray16$2 = _argsToArray16[3],
17926
17926
  end = _argsToArray16$2 === void 0 ? 10 : _argsToArray16$2;
@@ -17950,35 +17950,35 @@ function _typeof(o) {
17950
17950
  "x-api-key": apiKey
17951
17951
  }
17952
17952
  }), finalUrl = _getUrlAndHeaders6.URL, HEADERS = _getUrlAndHeaders6.HEADERS;
17953
- _context23.next = 13;
17953
+ _context24.next = 13;
17954
17954
  return fetch(finalUrl, {
17955
17955
  method: "GET",
17956
17956
  headers: HEADERS
17957
17957
  });
17958
17958
 
17959
17959
  case 13:
17960
- response = _context23.sent;
17960
+ response = _context24.sent;
17961
17961
  if (response.ok) {
17962
- _context23.next = 16;
17962
+ _context24.next = 16;
17963
17963
  break;
17964
17964
  }
17965
17965
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
17966
17966
 
17967
17967
  case 16:
17968
- _context23.next = 18;
17968
+ _context24.next = 18;
17969
17969
  return response.json();
17970
17970
 
17971
17971
  case 18:
17972
- _yield$response$json = _context23.sent;
17973
- _data2 = _yield$response$json.data;
17974
- if (Array.isArray(_data2)) {
17975
- _context23.next = 22;
17972
+ _yield$response$json = _context24.sent;
17973
+ _data3 = _yield$response$json.data;
17974
+ if (Array.isArray(_data3)) {
17975
+ _context24.next = 22;
17976
17976
  break;
17977
17977
  }
17978
- return _context23.abrupt("return", []);
17978
+ return _context24.abrupt("return", []);
17979
17979
 
17980
17980
  case 22:
17981
- return _context23.abrupt("return", _data2.map((function(item) {
17981
+ return _context24.abrupt("return", _data3.map((function(item) {
17982
17982
  var flat = {};
17983
17983
  for (var _i15 = 0, _Object$entries5 = Object.entries(item); _i15 < _Object$entries5.length; _i15++) {
17984
17984
  var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i15], 2), k = _Object$entries5$_i[0], v = _Object$entries5$_i[1];
@@ -17991,15 +17991,15 @@ function _typeof(o) {
17991
17991
  })));
17992
17992
 
17993
17993
  case 25:
17994
- _context23.prev = 25;
17995
- _context23.t0 = _context23["catch"](0);
17996
- return _context23.abrupt("return", errorMessageHandler(_context23.t0, "FARCASTER"));
17994
+ _context24.prev = 25;
17995
+ _context24.t0 = _context24["catch"](0);
17996
+ return _context24.abrupt("return", errorMessageHandler(_context24.t0, "FARCASTER"));
17997
17997
 
17998
17998
  case 28:
17999
17999
  case "end":
18000
- return _context23.stop();
18000
+ return _context24.stop();
18001
18001
  }
18002
- }), _callee20, null, [ [ 0, 25 ] ]);
18002
+ }), _callee21, null, [ [ 0, 25 ] ]);
18003
18003
  })));
18004
18004
  return _FARCASTER.apply(this, arguments);
18005
18005
  }
@@ -18037,13 +18037,13 @@ function _typeof(o) {
18037
18037
  return _FIREFLY.apply(this, arguments);
18038
18038
  }
18039
18039
  function _FIREFLY() {
18040
- _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee21() {
18041
- var _argsToArray17, _argsToArray18, platform, contentType, identifier, _argsToArray18$, start, _argsToArray18$2, end, apiKey, url, _getUrlAndHeaders7, finalUrl, HEADERS, response, _yield$response$json2, _data3, _args24 = arguments;
18042
- return _regeneratorRuntime().wrap((function _callee21$(_context24) {
18043
- while (1) switch (_context24.prev = _context24.next) {
18040
+ _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee22() {
18041
+ var _argsToArray17, _argsToArray18, platform, contentType, identifier, _argsToArray18$, start, _argsToArray18$2, end, apiKey, url, _getUrlAndHeaders7, finalUrl, HEADERS, response, _yield$response$json2, _data4, _args25 = arguments;
18042
+ return _regeneratorRuntime().wrap((function _callee22$(_context25) {
18043
+ while (1) switch (_context25.prev = _context25.next) {
18044
18044
  case 0:
18045
- _context24.prev = 0;
18046
- _argsToArray17 = argsToArray(_args24), _argsToArray18 = _slicedToArray(_argsToArray17, 5),
18045
+ _context25.prev = 0;
18046
+ _argsToArray17 = argsToArray(_args25), _argsToArray18 = _slicedToArray(_argsToArray17, 5),
18047
18047
  platform = _argsToArray18[0], contentType = _argsToArray18[1], identifier = _argsToArray18[2],
18048
18048
  _argsToArray18$ = _argsToArray18[3], start = _argsToArray18$ === void 0 ? 0 : _argsToArray18$,
18049
18049
  _argsToArray18$2 = _argsToArray18[4], end = _argsToArray18$2 === void 0 ? 10 : _argsToArray18$2;
@@ -18069,35 +18069,35 @@ function _typeof(o) {
18069
18069
  "x-api-key": apiKey
18070
18070
  }
18071
18071
  }), finalUrl = _getUrlAndHeaders7.URL, HEADERS = _getUrlAndHeaders7.HEADERS;
18072
- _context24.next = 12;
18072
+ _context25.next = 12;
18073
18073
  return fetch(finalUrl, {
18074
18074
  method: "GET",
18075
18075
  headers: HEADERS
18076
18076
  });
18077
18077
 
18078
18078
  case 12:
18079
- response = _context24.sent;
18079
+ response = _context25.sent;
18080
18080
  if (response.ok) {
18081
- _context24.next = 15;
18081
+ _context25.next = 15;
18082
18082
  break;
18083
18083
  }
18084
18084
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
18085
18085
 
18086
18086
  case 15:
18087
- _context24.next = 17;
18087
+ _context25.next = 17;
18088
18088
  return response.json();
18089
18089
 
18090
18090
  case 17:
18091
- _yield$response$json2 = _context24.sent;
18092
- _data3 = _yield$response$json2.data;
18093
- if (Array.isArray(_data3)) {
18094
- _context24.next = 21;
18091
+ _yield$response$json2 = _context25.sent;
18092
+ _data4 = _yield$response$json2.data;
18093
+ if (Array.isArray(_data4)) {
18094
+ _context25.next = 21;
18095
18095
  break;
18096
18096
  }
18097
- return _context24.abrupt("return", []);
18097
+ return _context25.abrupt("return", []);
18098
18098
 
18099
18099
  case 21:
18100
- return _context24.abrupt("return", _data3.map((function(item) {
18100
+ return _context25.abrupt("return", _data4.map((function(item) {
18101
18101
  var flat = {};
18102
18102
  for (var _i16 = 0, _Object$entries6 = Object.entries(item); _i16 < _Object$entries6.length; _i16++) {
18103
18103
  var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i16], 2), key = _Object$entries6$_i[0], _value16 = _Object$entries6$_i[1];
@@ -18110,15 +18110,15 @@ function _typeof(o) {
18110
18110
  })));
18111
18111
 
18112
18112
  case 24:
18113
- _context24.prev = 24;
18114
- _context24.t0 = _context24["catch"](0);
18115
- return _context24.abrupt("return", errorMessageHandler(_context24.t0, "FIREFLY"));
18113
+ _context25.prev = 24;
18114
+ _context25.t0 = _context25["catch"](0);
18115
+ return _context25.abrupt("return", errorMessageHandler(_context25.t0, "FIREFLY"));
18116
18116
 
18117
18117
  case 27:
18118
18118
  case "end":
18119
- return _context24.stop();
18119
+ return _context25.stop();
18120
18120
  }
18121
- }), _callee21, null, [ [ 0, 24 ] ]);
18121
+ }), _callee22, null, [ [ 0, 24 ] ]);
18122
18122
  })));
18123
18123
  return _FIREFLY.apply(this, arguments);
18124
18124
  }
@@ -18126,13 +18126,13 @@ function _typeof(o) {
18126
18126
  return _GNOSIS.apply(this, arguments);
18127
18127
  }
18128
18128
  function _GNOSIS() {
18129
- _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee22() {
18130
- var _argsToArray19, _argsToArray20, type, address, startDate, endDate, _argsToArray20$, page, _argsToArray20$2, limit, apiKey, _args25 = arguments;
18131
- return _regeneratorRuntime().wrap((function _callee22$(_context25) {
18132
- while (1) switch (_context25.prev = _context25.next) {
18129
+ _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee23() {
18130
+ var _argsToArray19, _argsToArray20, type, address, startDate, endDate, _argsToArray20$, page, _argsToArray20$2, limit, apiKey, _args26 = arguments;
18131
+ return _regeneratorRuntime().wrap((function _callee23$(_context26) {
18132
+ while (1) switch (_context26.prev = _context26.next) {
18133
18133
  case 0:
18134
- _context25.prev = 0;
18135
- _argsToArray19 = argsToArray(_args25), _argsToArray20 = _slicedToArray(_argsToArray19, 6),
18134
+ _context26.prev = 0;
18135
+ _argsToArray19 = argsToArray(_args26), _argsToArray20 = _slicedToArray(_argsToArray19, 6),
18136
18136
  type = _argsToArray20[0], address = _argsToArray20[1], startDate = _argsToArray20[2],
18137
18137
  endDate = _argsToArray20[3], _argsToArray20$ = _argsToArray20[4], page = _argsToArray20$ === void 0 ? 1 : _argsToArray20$,
18138
18138
  _argsToArray20$2 = _argsToArray20[5], limit = _argsToArray20$2 === void 0 ? 10 : _argsToArray20$2;
@@ -18145,7 +18145,7 @@ function _typeof(o) {
18145
18145
  limit: limit
18146
18146
  });
18147
18147
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Gnosisscan);
18148
- _context25.next = 6;
18148
+ _context26.next = 6;
18149
18149
  return handleScanRequest({
18150
18150
  type: type,
18151
18151
  address: address,
@@ -18160,18 +18160,18 @@ function _typeof(o) {
18160
18160
  });
18161
18161
 
18162
18162
  case 6:
18163
- return _context25.abrupt("return", _context25.sent);
18163
+ return _context26.abrupt("return", _context26.sent);
18164
18164
 
18165
18165
  case 9:
18166
- _context25.prev = 9;
18167
- _context25.t0 = _context25["catch"](0);
18168
- return _context25.abrupt("return", errorMessageHandler(_context25.t0, "GNOSIS"));
18166
+ _context26.prev = 9;
18167
+ _context26.t0 = _context26["catch"](0);
18168
+ return _context26.abrupt("return", errorMessageHandler(_context26.t0, "GNOSIS"));
18169
18169
 
18170
18170
  case 12:
18171
18171
  case "end":
18172
- return _context25.stop();
18172
+ return _context26.stop();
18173
18173
  }
18174
- }), _callee22, null, [ [ 0, 9 ] ]);
18174
+ }), _callee23, null, [ [ 0, 9 ] ]);
18175
18175
  })));
18176
18176
  return _GNOSIS.apply(this, arguments);
18177
18177
  }
@@ -18187,13 +18187,13 @@ function _typeof(o) {
18187
18187
  return _LENS.apply(this, arguments);
18188
18188
  }
18189
18189
  function _LENS() {
18190
- _LENS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee23() {
18191
- var _argsToArray21, _argsToArray22, contentType, identifier, _argsToArray22$, start, _argsToArray22$2, end, apiKey, url, typeMap, _getUrlAndHeaders8, finalUrl, HEADERS, response, _yield$response$json3, _data4, _args26 = arguments;
18192
- return _regeneratorRuntime().wrap((function _callee23$(_context26) {
18193
- while (1) switch (_context26.prev = _context26.next) {
18190
+ _LENS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee24() {
18191
+ var _argsToArray21, _argsToArray22, contentType, identifier, _argsToArray22$, start, _argsToArray22$2, end, apiKey, url, typeMap, _getUrlAndHeaders8, finalUrl, HEADERS, response, _yield$response$json3, _data5, _args27 = arguments;
18192
+ return _regeneratorRuntime().wrap((function _callee24$(_context27) {
18193
+ while (1) switch (_context27.prev = _context27.next) {
18194
18194
  case 0:
18195
- _context26.prev = 0;
18196
- _argsToArray21 = argsToArray(_args26), _argsToArray22 = _slicedToArray(_argsToArray21, 4),
18195
+ _context27.prev = 0;
18196
+ _argsToArray21 = argsToArray(_args27), _argsToArray22 = _slicedToArray(_argsToArray21, 4),
18197
18197
  contentType = _argsToArray22[0], identifier = _argsToArray22[1], _argsToArray22$ = _argsToArray22[2],
18198
18198
  start = _argsToArray22$ === void 0 ? 0 : _argsToArray22$, _argsToArray22$2 = _argsToArray22[3],
18199
18199
  end = _argsToArray22$2 === void 0 ? 10 : _argsToArray22$2;
@@ -18222,35 +18222,35 @@ function _typeof(o) {
18222
18222
  "x-api-key": apiKey
18223
18223
  }
18224
18224
  }), finalUrl = _getUrlAndHeaders8.URL, HEADERS = _getUrlAndHeaders8.HEADERS;
18225
- _context26.next = 13;
18225
+ _context27.next = 13;
18226
18226
  return fetch(finalUrl, {
18227
18227
  method: "GET",
18228
18228
  headers: HEADERS
18229
18229
  });
18230
18230
 
18231
18231
  case 13:
18232
- response = _context26.sent;
18232
+ response = _context27.sent;
18233
18233
  if (response.ok) {
18234
- _context26.next = 16;
18234
+ _context27.next = 16;
18235
18235
  break;
18236
18236
  }
18237
18237
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
18238
18238
 
18239
18239
  case 16:
18240
- _context26.next = 18;
18240
+ _context27.next = 18;
18241
18241
  return response.json();
18242
18242
 
18243
18243
  case 18:
18244
- _yield$response$json3 = _context26.sent;
18245
- _data4 = _yield$response$json3.data;
18246
- if (Array.isArray(_data4)) {
18247
- _context26.next = 22;
18244
+ _yield$response$json3 = _context27.sent;
18245
+ _data5 = _yield$response$json3.data;
18246
+ if (Array.isArray(_data5)) {
18247
+ _context27.next = 22;
18248
18248
  break;
18249
18249
  }
18250
- return _context26.abrupt("return", []);
18250
+ return _context27.abrupt("return", []);
18251
18251
 
18252
18252
  case 22:
18253
- return _context26.abrupt("return", _data4.map((function(item) {
18253
+ return _context27.abrupt("return", _data5.map((function(item) {
18254
18254
  var flat = {};
18255
18255
  for (var _i17 = 0, _Object$entries7 = Object.entries(item); _i17 < _Object$entries7.length; _i17++) {
18256
18256
  var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i17], 2), key = _Object$entries7$_i[0], _value17 = _Object$entries7$_i[1];
@@ -18263,15 +18263,15 @@ function _typeof(o) {
18263
18263
  })));
18264
18264
 
18265
18265
  case 25:
18266
- _context26.prev = 25;
18267
- _context26.t0 = _context26["catch"](0);
18268
- return _context26.abrupt("return", errorMessageHandler(_context26.t0, "LENS"));
18266
+ _context27.prev = 25;
18267
+ _context27.t0 = _context27["catch"](0);
18268
+ return _context27.abrupt("return", errorMessageHandler(_context27.t0, "LENS"));
18269
18269
 
18270
18270
  case 28:
18271
18271
  case "end":
18272
- return _context26.stop();
18272
+ return _context27.stop();
18273
18273
  }
18274
- }), _callee23, null, [ [ 0, 25 ] ]);
18274
+ }), _callee24, null, [ [ 0, 25 ] ]);
18275
18275
  })));
18276
18276
  return _LENS.apply(this, arguments);
18277
18277
  }
@@ -18336,25 +18336,25 @@ function _typeof(o) {
18336
18336
  return _NEYNAR.apply(this, arguments);
18337
18337
  }
18338
18338
  function _NEYNAR() {
18339
- _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee24() {
18340
- var _argsToArray23, _argsToArray24, username, apiKey, fid, url, _getUrlAndHeaders9, finalUrl, HEADERS, response, json, users, _args27 = arguments;
18341
- return _regeneratorRuntime().wrap((function _callee24$(_context27) {
18342
- while (1) switch (_context27.prev = _context27.next) {
18339
+ _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee25() {
18340
+ var _argsToArray23, _argsToArray24, username, apiKey, fid, url, _getUrlAndHeaders9, finalUrl, HEADERS, response, json, users, _args28 = arguments;
18341
+ return _regeneratorRuntime().wrap((function _callee25$(_context28) {
18342
+ while (1) switch (_context28.prev = _context28.next) {
18343
18343
  case 0:
18344
- _context27.prev = 0;
18345
- _argsToArray23 = argsToArray(_args27), _argsToArray24 = _slicedToArray(_argsToArray23, 1),
18344
+ _context28.prev = 0;
18345
+ _argsToArray23 = argsToArray(_args28), _argsToArray24 = _slicedToArray(_argsToArray23, 1),
18346
18346
  username = _argsToArray24[0];
18347
18347
  validateParams(neynarParamsSchema, {
18348
18348
  username: username
18349
18349
  });
18350
18350
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Neynar);
18351
- _context27.next = 6;
18351
+ _context28.next = 6;
18352
18352
  return fromUsernameToFid$1.fromUsernameToFid(username, apiKey);
18353
18353
 
18354
18354
  case 6:
18355
- fid = _context27.sent;
18355
+ fid = _context28.sent;
18356
18356
  if (fid) {
18357
- _context27.next = 9;
18357
+ _context28.next = 9;
18358
18358
  break;
18359
18359
  }
18360
18360
  throw new ValidationError("Invalid username: ".concat(username));
@@ -18369,37 +18369,37 @@ function _typeof(o) {
18369
18369
  "x-neynar-experimental": "false"
18370
18370
  }
18371
18371
  }), finalUrl = _getUrlAndHeaders9.URL, HEADERS = _getUrlAndHeaders9.HEADERS;
18372
- _context27.next = 13;
18372
+ _context28.next = 13;
18373
18373
  return fetch(finalUrl, {
18374
18374
  method: "GET",
18375
18375
  headers: HEADERS
18376
18376
  });
18377
18377
 
18378
18378
  case 13:
18379
- response = _context27.sent;
18379
+ response = _context28.sent;
18380
18380
  if (response.ok) {
18381
- _context27.next = 16;
18381
+ _context28.next = 16;
18382
18382
  break;
18383
18383
  }
18384
18384
  throw new NetworkError(SERVICES_API_KEY.Neynar, response.status);
18385
18385
 
18386
18386
  case 16:
18387
- _context27.next = 18;
18387
+ _context28.next = 18;
18388
18388
  return response.json();
18389
18389
 
18390
18390
  case 18:
18391
- json = _context27.sent;
18391
+ json = _context28.sent;
18392
18392
  users = (json === null || json === void 0 ? void 0 : json.users) || [];
18393
18393
  if (users.length) {
18394
- _context27.next = 22;
18394
+ _context28.next = 22;
18395
18395
  break;
18396
18396
  }
18397
- return _context27.abrupt("return", []);
18397
+ return _context28.abrupt("return", []);
18398
18398
 
18399
18399
  case 22:
18400
- return _context27.abrupt("return", users.map((function(_ref18) {
18400
+ return _context28.abrupt("return", users.map((function(_ref19) {
18401
18401
  var _user$profile, _user$profile2;
18402
- var user = _ref18.user;
18402
+ var user = _ref19.user;
18403
18403
  return {
18404
18404
  username: user.username,
18405
18405
  custody_address: user.custody_address,
@@ -18410,15 +18410,15 @@ function _typeof(o) {
18410
18410
  })));
18411
18411
 
18412
18412
  case 25:
18413
- _context27.prev = 25;
18414
- _context27.t0 = _context27["catch"](0);
18415
- return _context27.abrupt("return", errorMessageHandler(_context27.t0, "NEYNAR"));
18413
+ _context28.prev = 25;
18414
+ _context28.t0 = _context28["catch"](0);
18415
+ return _context28.abrupt("return", errorMessageHandler(_context28.t0, "NEYNAR"));
18416
18416
 
18417
18417
  case 28:
18418
18418
  case "end":
18419
- return _context27.stop();
18419
+ return _context28.stop();
18420
18420
  }
18421
- }), _callee24, null, [ [ 0, 25 ] ]);
18421
+ }), _callee25, null, [ [ 0, 25 ] ]);
18422
18422
  })));
18423
18423
  return _NEYNAR.apply(this, arguments);
18424
18424
  }
@@ -18435,13 +18435,13 @@ function _typeof(o) {
18435
18435
  return _SAFE.apply(this, arguments);
18436
18436
  }
18437
18437
  function _SAFE() {
18438
- _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee25() {
18439
- var _argsToArray25, _argsToArray26, address, utility, chain, _argsToArray26$, limit, _argsToArray26$2, offset, apiKey, chainId, resolved, url, _getUrlAndHeaders0, finalUrl, HEADERS, res, json, _args28 = arguments;
18440
- return _regeneratorRuntime().wrap((function _callee25$(_context28) {
18441
- while (1) switch (_context28.prev = _context28.next) {
18438
+ _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee26() {
18439
+ var _argsToArray25, _argsToArray26, address, utility, chain, _argsToArray26$, limit, _argsToArray26$2, offset, apiKey, chainId, resolved, url, _getUrlAndHeaders0, finalUrl, HEADERS, res, json, _args29 = arguments;
18440
+ return _regeneratorRuntime().wrap((function _callee26$(_context29) {
18441
+ while (1) switch (_context29.prev = _context29.next) {
18442
18442
  case 0:
18443
- _context28.prev = 0;
18444
- _argsToArray25 = argsToArray(_args28), _argsToArray26 = _slicedToArray(_argsToArray25, 5),
18443
+ _context29.prev = 0;
18444
+ _argsToArray25 = argsToArray(_args29), _argsToArray26 = _slicedToArray(_argsToArray25, 5),
18445
18445
  address = _argsToArray26[0], utility = _argsToArray26[1], chain = _argsToArray26[2],
18446
18446
  _argsToArray26$ = _argsToArray26[3], limit = _argsToArray26$ === void 0 ? 10 : _argsToArray26$,
18447
18447
  _argsToArray26$2 = _argsToArray26[4], offset = _argsToArray26$2 === void 0 ? 0 : _argsToArray26$2;
@@ -18455,17 +18455,17 @@ function _typeof(o) {
18455
18455
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Safe);
18456
18456
  chainId = SAFE_CHAIN_MAP[chain];
18457
18457
  if (chainId) {
18458
- _context28.next = 7;
18458
+ _context29.next = 7;
18459
18459
  break;
18460
18460
  }
18461
18461
  throw new ValidationError("Invalid chain: ".concat(chain));
18462
18462
 
18463
18463
  case 7:
18464
- _context28.next = 9;
18464
+ _context29.next = 9;
18465
18465
  return fromEnsNameToAddress$1.validateAndGetAddress(address);
18466
18466
 
18467
18467
  case 9:
18468
- resolved = _context28.sent;
18468
+ resolved = _context29.sent;
18469
18469
  url = "https://api.safe.global/tx-service/".concat(chainId, "/api/v2/safes/").concat(resolved, "/multisig-transactions?limit=").concat(limit, "&offset=").concat(offset);
18470
18470
  _getUrlAndHeaders0 = getUrlAndHeaders({
18471
18471
  url: url,
@@ -18474,47 +18474,47 @@ function _typeof(o) {
18474
18474
  Authorization: "Bearer ".concat(apiKey)
18475
18475
  }
18476
18476
  }), finalUrl = _getUrlAndHeaders0.URL, HEADERS = _getUrlAndHeaders0.HEADERS;
18477
- _context28.next = 14;
18477
+ _context29.next = 14;
18478
18478
  return fetch(finalUrl, {
18479
18479
  headers: HEADERS
18480
18480
  });
18481
18481
 
18482
18482
  case 14:
18483
- res = _context28.sent;
18483
+ res = _context29.sent;
18484
18484
  if (res.ok) {
18485
- _context28.next = 17;
18485
+ _context29.next = 17;
18486
18486
  break;
18487
18487
  }
18488
18488
  throw new NetworkError(SERVICES_API_KEY.Safe, res.status);
18489
18489
 
18490
18490
  case 17:
18491
- _context28.next = 19;
18491
+ _context29.next = 19;
18492
18492
  return res.json();
18493
18493
 
18494
18494
  case 19:
18495
- json = _context28.sent;
18495
+ json = _context29.sent;
18496
18496
  if (Array.isArray(json.results)) {
18497
- _context28.next = 22;
18497
+ _context29.next = 22;
18498
18498
  break;
18499
18499
  }
18500
18500
  throw new ValidationError("Invalid API response");
18501
18501
 
18502
18502
  case 22:
18503
- return _context28.abrupt("return", json.results.map((function(_ref19) {
18504
- var confirmations = _ref19.confirmations, dataDecoded = _ref19.dataDecoded, rest = _objectWithoutProperties(_ref19, _excluded);
18503
+ return _context29.abrupt("return", json.results.map((function(_ref20) {
18504
+ var confirmations = _ref20.confirmations, dataDecoded = _ref20.dataDecoded, rest = _objectWithoutProperties(_ref20, _excluded);
18505
18505
  return rest;
18506
18506
  })));
18507
18507
 
18508
18508
  case 25:
18509
- _context28.prev = 25;
18510
- _context28.t0 = _context28["catch"](0);
18511
- return _context28.abrupt("return", errorMessageHandler(_context28.t0, "SAFE"));
18509
+ _context29.prev = 25;
18510
+ _context29.t0 = _context29["catch"](0);
18511
+ return _context29.abrupt("return", errorMessageHandler(_context29.t0, "SAFE"));
18512
18512
 
18513
18513
  case 28:
18514
18514
  case "end":
18515
- return _context28.stop();
18515
+ return _context29.stop();
18516
18516
  }
18517
- }), _callee25, null, [ [ 0, 25 ] ]);
18517
+ }), _callee26, null, [ [ 0, 25 ] ]);
18518
18518
  })));
18519
18519
  return _SAFE.apply(this, arguments);
18520
18520
  }
@@ -18528,13 +18528,13 @@ function _typeof(o) {
18528
18528
  return _UNISWAP.apply(this, arguments);
18529
18529
  }
18530
18530
  function _UNISWAP() {
18531
- _UNISWAP = _asyncToGenerator(_regeneratorRuntime().mark((function _callee26() {
18532
- var _argsToArray27, _argsToArray28, graphType, category, param1, param2, baseUrl, url, res, json, _args29 = arguments;
18533
- return _regeneratorRuntime().wrap((function _callee26$(_context29) {
18534
- while (1) switch (_context29.prev = _context29.next) {
18531
+ _UNISWAP = _asyncToGenerator(_regeneratorRuntime().mark((function _callee27() {
18532
+ var _argsToArray27, _argsToArray28, graphType, category, param1, param2, baseUrl, url, res, json, _args30 = arguments;
18533
+ return _regeneratorRuntime().wrap((function _callee27$(_context30) {
18534
+ while (1) switch (_context30.prev = _context30.next) {
18535
18535
  case 0:
18536
- _context29.prev = 0;
18537
- _argsToArray27 = argsToArray(_args29), _argsToArray28 = _slicedToArray(_argsToArray27, 4),
18536
+ _context30.prev = 0;
18537
+ _argsToArray27 = argsToArray(_args30), _argsToArray28 = _slicedToArray(_argsToArray27, 4),
18538
18538
  graphType = _argsToArray28[0], category = _argsToArray28[1], param1 = _argsToArray28[2],
18539
18539
  param2 = _argsToArray28[3];
18540
18540
  validateParams(uniswapParamsSchema, {
@@ -18545,49 +18545,49 @@ function _typeof(o) {
18545
18545
  });
18546
18546
  baseUrl = "https://onchain-proxy.fileverse.io/third-party";
18547
18547
  url = "".concat(baseUrl) + "?service=uniswap" + "&graphType=".concat(graphType) + "&category=".concat(category) + "&input1=".concat(encodeURIComponent(param1)) + (param2 ? "&input2=".concat(encodeURIComponent(param2)) : "");
18548
- _context29.next = 7;
18548
+ _context30.next = 7;
18549
18549
  return fetch(url);
18550
18550
 
18551
18551
  case 7:
18552
- res = _context29.sent;
18552
+ res = _context30.sent;
18553
18553
  if (res.ok) {
18554
- _context29.next = 10;
18554
+ _context30.next = 10;
18555
18555
  break;
18556
18556
  }
18557
18557
  throw new NetworkError("UNISWAP", res.status);
18558
18558
 
18559
18559
  case 10:
18560
- _context29.next = 12;
18560
+ _context30.next = 12;
18561
18561
  return res.json();
18562
18562
 
18563
18563
  case 12:
18564
- json = _context29.sent;
18564
+ json = _context30.sent;
18565
18565
  if (!Array.isArray(json)) {
18566
- _context29.next = 15;
18566
+ _context30.next = 15;
18567
18567
  break;
18568
18568
  }
18569
- return _context29.abrupt("return", json.map((function(item) {
18569
+ return _context30.abrupt("return", json.map((function(item) {
18570
18570
  var flat = {};
18571
- Object.entries(item).forEach((function(_ref20) {
18572
- var _ref21 = _slicedToArray(_ref20, 2), k = _ref21[0], v = _ref21[1];
18571
+ Object.entries(item).forEach((function(_ref21) {
18572
+ var _ref22 = _slicedToArray(_ref21, 2), k = _ref22[0], v = _ref22[1];
18573
18573
  if (v === null || _typeof(v) !== "object") flat[k] = v;
18574
18574
  }));
18575
18575
  return flat;
18576
18576
  })));
18577
18577
 
18578
18578
  case 15:
18579
- return _context29.abrupt("return", json);
18579
+ return _context30.abrupt("return", json);
18580
18580
 
18581
18581
  case 18:
18582
- _context29.prev = 18;
18583
- _context29.t0 = _context29["catch"](0);
18584
- return _context29.abrupt("return", errorMessageHandler(_context29.t0, "UNISWAP"));
18582
+ _context30.prev = 18;
18583
+ _context30.t0 = _context30["catch"](0);
18584
+ return _context30.abrupt("return", errorMessageHandler(_context30.t0, "UNISWAP"));
18585
18585
 
18586
18586
  case 21:
18587
18587
  case "end":
18588
- return _context29.stop();
18588
+ return _context30.stop();
18589
18589
  }
18590
- }), _callee26, null, [ [ 0, 18 ] ]);
18590
+ }), _callee27, null, [ [ 0, 18 ] ]);
18591
18591
  })));
18592
18592
  return _UNISWAP.apply(this, arguments);
18593
18593
  }
@@ -18595,14 +18595,14 @@ function _typeof(o) {
18595
18595
  return _SMARTCONTRACT.apply(this, arguments);
18596
18596
  }
18597
18597
  function _SMARTCONTRACT() {
18598
- _SMARTCONTRACT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee27() {
18599
- var args, _args30 = arguments;
18600
- return _regeneratorRuntime().wrap((function _callee27$(_context30) {
18601
- while (1) switch (_context30.prev = _context30.next) {
18598
+ _SMARTCONTRACT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee28() {
18599
+ var args, _args31 = arguments;
18600
+ return _regeneratorRuntime().wrap((function _callee28$(_context31) {
18601
+ while (1) switch (_context31.prev = _context31.next) {
18602
18602
  case 0:
18603
- _context30.prev = 0;
18604
- args = argsToArray(_args30);
18605
- return _context30.abrupt("return", new Promise((function(resolve) {
18603
+ _context31.prev = 0;
18604
+ args = argsToArray(_args31);
18605
+ return _context31.abrupt("return", new Promise((function(resolve) {
18606
18606
  resolve({
18607
18607
  callSignature: args,
18608
18608
  responseType: "smart-contract"
@@ -18610,15 +18610,15 @@ function _typeof(o) {
18610
18610
  })));
18611
18611
 
18612
18612
  case 5:
18613
- _context30.prev = 5;
18614
- _context30.t0 = _context30["catch"](0);
18615
- return _context30.abrupt("return", errorMessageHandler(_context30.t0, "SMARTCONTRACT"));
18613
+ _context31.prev = 5;
18614
+ _context31.t0 = _context31["catch"](0);
18615
+ return _context31.abrupt("return", errorMessageHandler(_context31.t0, "SMARTCONTRACT"));
18616
18616
 
18617
18617
  case 8:
18618
18618
  case "end":
18619
- return _context30.stop();
18619
+ return _context31.stop();
18620
18620
  }
18621
- }), _callee27, null, [ [ 0, 5 ] ]);
18621
+ }), _callee28, null, [ [ 0, 5 ] ]);
18622
18622
  })));
18623
18623
  return _SMARTCONTRACT.apply(this, arguments);
18624
18624
  }
@@ -18630,13 +18630,13 @@ function _typeof(o) {
18630
18630
  return _TALLY.apply(this, arguments);
18631
18631
  }
18632
18632
  function _TALLY() {
18633
- _TALLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee28() {
18634
- var _argsToArray29, _argsToArray30, query, slug, baseUrl, url, res, _data5, _args31 = arguments;
18635
- return _regeneratorRuntime().wrap((function _callee28$(_context31) {
18636
- while (1) switch (_context31.prev = _context31.next) {
18633
+ _TALLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee29() {
18634
+ var _argsToArray29, _argsToArray30, query, slug, baseUrl, url, res, _data6, _args32 = arguments;
18635
+ return _regeneratorRuntime().wrap((function _callee29$(_context32) {
18636
+ while (1) switch (_context32.prev = _context32.next) {
18637
18637
  case 0:
18638
- _context31.prev = 0;
18639
- _argsToArray29 = argsToArray(_args31), _argsToArray30 = _slicedToArray(_argsToArray29, 2),
18638
+ _context32.prev = 0;
18639
+ _argsToArray29 = argsToArray(_args32), _argsToArray30 = _slicedToArray(_argsToArray29, 2),
18640
18640
  query = _argsToArray30[0], slug = _argsToArray30[1];
18641
18641
  validateParams(tallyParamsSchema, {
18642
18642
  query: query,
@@ -18644,35 +18644,35 @@ function _typeof(o) {
18644
18644
  });
18645
18645
  baseUrl = "https://onchain-proxy.fileverse.io/third-party";
18646
18646
  url = "".concat(baseUrl) + "?service=tally" + "&input1=".concat(encodeURIComponent(query)) + "&input2=".concat(encodeURIComponent(slug));
18647
- _context31.next = 7;
18647
+ _context32.next = 7;
18648
18648
  return fetch(url);
18649
18649
 
18650
18650
  case 7:
18651
- res = _context31.sent;
18651
+ res = _context32.sent;
18652
18652
  if (res.ok) {
18653
- _context31.next = 10;
18653
+ _context32.next = 10;
18654
18654
  break;
18655
18655
  }
18656
18656
  throw new NetworkError("TALLY", res.status);
18657
18657
 
18658
18658
  case 10:
18659
- _context31.next = 12;
18659
+ _context32.next = 12;
18660
18660
  return res.json();
18661
18661
 
18662
18662
  case 12:
18663
- _data5 = _context31.sent;
18664
- return _context31.abrupt("return", _data5);
18663
+ _data6 = _context32.sent;
18664
+ return _context32.abrupt("return", _data6);
18665
18665
 
18666
18666
  case 16:
18667
- _context31.prev = 16;
18668
- _context31.t0 = _context31["catch"](0);
18669
- return _context31.abrupt("return", errorMessageHandler(_context31.t0, "TALLY"));
18667
+ _context32.prev = 16;
18668
+ _context32.t0 = _context32["catch"](0);
18669
+ return _context32.abrupt("return", errorMessageHandler(_context32.t0, "TALLY"));
18670
18670
 
18671
18671
  case 19:
18672
18672
  case "end":
18673
- return _context31.stop();
18673
+ return _context32.stop();
18674
18674
  }
18675
- }), _callee28, null, [ [ 0, 16 ] ]);
18675
+ }), _callee29, null, [ [ 0, 16 ] ]);
18676
18676
  })));
18677
18677
  return _TALLY.apply(this, arguments);
18678
18678
  }
@@ -18761,51 +18761,51 @@ function _typeof(o) {
18761
18761
  return _getChainName.apply(this, arguments);
18762
18762
  }
18763
18763
  function _getChainName() {
18764
- _getChainName = _asyncToGenerator(_regeneratorRuntime().mark((function _callee29(chainId) {
18764
+ _getChainName = _asyncToGenerator(_regeneratorRuntime().mark((function _callee30(chainId) {
18765
18765
  var res, chain;
18766
- return _regeneratorRuntime().wrap((function _callee29$(_context32) {
18767
- while (1) switch (_context32.prev = _context32.next) {
18766
+ return _regeneratorRuntime().wrap((function _callee30$(_context33) {
18767
+ while (1) switch (_context33.prev = _context33.next) {
18768
18768
  case 0:
18769
- _context32.prev = 0;
18769
+ _context33.prev = 0;
18770
18770
  if (cachedChains) {
18771
- _context32.next = 10;
18771
+ _context33.next = 10;
18772
18772
  break;
18773
18773
  }
18774
- _context32.next = 4;
18774
+ _context33.next = 4;
18775
18775
  return fetch("https://chainid.network/chains_mini.json");
18776
18776
 
18777
18777
  case 4:
18778
- res = _context32.sent;
18778
+ res = _context33.sent;
18779
18779
  if (res.ok) {
18780
- _context32.next = 7;
18780
+ _context33.next = 7;
18781
18781
  break;
18782
18782
  }
18783
18783
  throw new Error("Failed to fetch chains.json");
18784
18784
 
18785
18785
  case 7:
18786
- _context32.next = 9;
18786
+ _context33.next = 9;
18787
18787
  return res.json();
18788
18788
 
18789
18789
  case 9:
18790
- cachedChains = _context32.sent;
18790
+ cachedChains = _context33.sent;
18791
18791
 
18792
18792
  case 10:
18793
18793
  chain = cachedChains.find((function(c) {
18794
18794
  return c.chainId === chainId;
18795
18795
  }));
18796
- return _context32.abrupt("return", chain ? chain.name : chainId);
18796
+ return _context33.abrupt("return", chain ? chain.name : chainId);
18797
18797
 
18798
18798
  case 14:
18799
- _context32.prev = 14;
18800
- _context32.t0 = _context32["catch"](0);
18801
- console.log(_context32.t0);
18802
- return _context32.abrupt("return", chainId);
18799
+ _context33.prev = 14;
18800
+ _context33.t0 = _context33["catch"](0);
18801
+ console.log(_context33.t0);
18802
+ return _context33.abrupt("return", chainId);
18803
18803
 
18804
18804
  case 18:
18805
18805
  case "end":
18806
- return _context32.stop();
18806
+ return _context33.stop();
18807
18807
  }
18808
- }), _callee29, null, [ [ 0, 14 ] ]);
18808
+ }), _callee30, null, [ [ 0, 14 ] ]);
18809
18809
  })));
18810
18810
  return _getChainName.apply(this, arguments);
18811
18811
  }
@@ -18813,13 +18813,13 @@ function _typeof(o) {
18813
18813
  return _DUNE.apply(this, arguments);
18814
18814
  }
18815
18815
  function _DUNE() {
18816
- _DUNE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee30() {
18817
- 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, _data6, json, _data7, result, _final, globalDecimals, _iterator47, _step47, _loop4, _args34 = arguments;
18818
- return _regeneratorRuntime().wrap((function _callee30$(_context34) {
18819
- while (1) switch (_context34.prev = _context34.next) {
18816
+ _DUNE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee31() {
18817
+ 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, _data7, json, _data8, result, _final, globalDecimals, _iterator48, _step48, _loop4, _args35 = arguments;
18818
+ return _regeneratorRuntime().wrap((function _callee31$(_context35) {
18819
+ while (1) switch (_context35.prev = _context35.next) {
18820
18820
  case 0:
18821
- _context34.prev = 0;
18822
- _argsToArray31 = argsToArray(_args34), _argsToArray32 = _slicedToArray(_argsToArray31, 5),
18821
+ _context35.prev = 0;
18822
+ _argsToArray31 = argsToArray(_args35), _argsToArray32 = _slicedToArray(_argsToArray31, 5),
18823
18823
  type = _argsToArray32[0], input1 = _argsToArray32[1], input2 = _argsToArray32[2],
18824
18824
  input3 = _argsToArray32[3], input4 = _argsToArray32[4];
18825
18825
  validateParams(duneSimParamsSchema, {
@@ -18831,24 +18831,24 @@ function _typeof(o) {
18831
18831
  });
18832
18832
  route = "";
18833
18833
  buildQuery = function buildQuery(pairs) {
18834
- var parts = pairs.filter((function(_ref22) {
18835
- var _ref23 = _slicedToArray(_ref22, 2), _ = _ref23[0], v = _ref23[1];
18834
+ var parts = pairs.filter((function(_ref23) {
18835
+ var _ref24 = _slicedToArray(_ref23, 2), _ = _ref24[0], v = _ref24[1];
18836
18836
  return v !== undefined && v !== "";
18837
- })).map((function(_ref24) {
18838
- var _ref25 = _slicedToArray(_ref24, 2), k = _ref25[0], v = _ref25[1];
18837
+ })).map((function(_ref25) {
18838
+ var _ref26 = _slicedToArray(_ref25, 2), k = _ref26[0], v = _ref26[1];
18839
18839
  return "".concat(k, "=").concat(encodeURIComponent(v));
18840
18840
  }));
18841
18841
  return parts.length ? "?".concat(parts.join("&")) : "";
18842
18842
  };
18843
18843
  if (!(type === "activity")) {
18844
- _context34.next = 11;
18844
+ _context35.next = 11;
18845
18845
  break;
18846
18846
  }
18847
- _context34.next = 8;
18847
+ _context35.next = 8;
18848
18848
  return fromEnsNameToAddress$1.validateAndGetAddress(input1);
18849
18849
 
18850
18850
  case 8:
18851
- address = _context34.sent;
18851
+ address = _context35.sent;
18852
18852
  qs = buildQuery([ [ "chain_ids", SUPPORTED_TOKEN_NAMES[input2] || input2 ], [ "limit", input3 ] ]);
18853
18853
  route = "activity/".concat(address).concat(qs);
18854
18854
 
@@ -18873,49 +18873,49 @@ function _typeof(o) {
18873
18873
  "X-Sim-Api-Key": apiKey
18874
18874
  }
18875
18875
  }), finalUrl = _getUrlAndHeaders1.URL, HEADERS = _getUrlAndHeaders1.HEADERS;
18876
- _context34.next = 18;
18876
+ _context35.next = 18;
18877
18877
  return fetch(finalUrl, {
18878
18878
  method: "GET",
18879
18879
  headers: HEADERS
18880
18880
  });
18881
18881
 
18882
18882
  case 18:
18883
- res = _context34.sent;
18883
+ res = _context35.sent;
18884
18884
  if (res.ok) {
18885
- _context34.next = 26;
18885
+ _context35.next = 26;
18886
18886
  break;
18887
18887
  }
18888
18888
  if (!(res.status === 400)) {
18889
- _context34.next = 25;
18889
+ _context35.next = 25;
18890
18890
  break;
18891
18891
  }
18892
- _context34.next = 23;
18892
+ _context35.next = 23;
18893
18893
  return res.json();
18894
18894
 
18895
18895
  case 23:
18896
- _data6 = _context34.sent;
18897
- throw new ValidationError(_data6.message);
18896
+ _data7 = _context35.sent;
18897
+ throw new ValidationError(_data7.message);
18898
18898
 
18899
18899
  case 25:
18900
18900
  throw new NetworkError(SERVICES_API_KEY.DuneSim, res.status);
18901
18901
 
18902
18902
  case 26:
18903
- _context34.next = 28;
18903
+ _context35.next = 28;
18904
18904
  return res.json();
18905
18905
 
18906
18906
  case 28:
18907
- json = _context34.sent;
18908
- _data7 = 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 : [];
18909
- result = Array.isArray(_data7) ? _data7 : [ _data7 ];
18907
+ json = _context35.sent;
18908
+ _data8 = 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 : [];
18909
+ result = Array.isArray(_data8) ? _data8 : [ _data8 ];
18910
18910
  _final = [];
18911
- _iterator47 = _createForOfIteratorHelper(result);
18912
- _context34.prev = 33;
18911
+ _iterator48 = _createForOfIteratorHelper(result);
18912
+ _context35.prev = 33;
18913
18913
  _loop4 = _regeneratorRuntime().mark((function _loop4() {
18914
18914
  var item, prices, _resData$tokens$, _chain2, _url, _getUrlAndHeaders10, _finalUrl, _HEADERS, _res, resData, decimals;
18915
- return _regeneratorRuntime().wrap((function _loop4$(_context33) {
18916
- while (1) switch (_context33.prev = _context33.next) {
18915
+ return _regeneratorRuntime().wrap((function _loop4$(_context34) {
18916
+ while (1) switch (_context34.prev = _context34.next) {
18917
18917
  case 0:
18918
- item = _step47.value;
18918
+ item = _step48.value;
18919
18919
  if (item !== null && item !== void 0 && item.decimals) {
18920
18920
  if (item !== null && item !== void 0 && item.total_supply) {
18921
18921
  item.total_supply = formatNumber(item === null || item === void 0 ? void 0 : item.total_supply, item.decimals);
@@ -18947,29 +18947,29 @@ function _typeof(o) {
18947
18947
  delete item["logo"];
18948
18948
  }
18949
18949
  if (!(type === "activity")) {
18950
- _context33.next = 9;
18950
+ _context34.next = 9;
18951
18951
  break;
18952
18952
  }
18953
- _context33.next = 8;
18953
+ _context34.next = 8;
18954
18954
  return getChainName(item.chain_id);
18955
18955
 
18956
18956
  case 8:
18957
- item.chain_id = _context33.sent;
18957
+ item.chain_id = _context34.sent;
18958
18958
 
18959
18959
  case 9:
18960
18960
  if (!(type === "token-holders")) {
18961
- _context33.next = 30;
18961
+ _context34.next = 30;
18962
18962
  break;
18963
18963
  }
18964
18964
  if (!item.balance) {
18965
- _context33.next = 30;
18965
+ _context34.next = 30;
18966
18966
  break;
18967
18967
  }
18968
18968
  if (globalDecimals) {
18969
- _context33.next = 29;
18969
+ _context34.next = 29;
18970
18970
  break;
18971
18971
  }
18972
- _context33.prev = 12;
18972
+ _context34.prev = 12;
18973
18973
  _chain2 = SUPPORTED_TOKEN_NAMES[input2] || input2;
18974
18974
  _url = "https://api.sim.dune.com/v1/evm/token-info/".concat(input1, "?chain_ids=").concat(_chain2);
18975
18975
  _getUrlAndHeaders10 = getUrlAndHeaders({
@@ -18979,28 +18979,28 @@ function _typeof(o) {
18979
18979
  "X-Sim-Api-Key": apiKey
18980
18980
  }
18981
18981
  }), _finalUrl = _getUrlAndHeaders10.URL, _HEADERS = _getUrlAndHeaders10.HEADERS;
18982
- _context33.next = 18;
18982
+ _context34.next = 18;
18983
18983
  return fetch(_finalUrl, {
18984
18984
  method: "GET",
18985
18985
  headers: _HEADERS
18986
18986
  });
18987
18987
 
18988
18988
  case 18:
18989
- _res = _context33.sent;
18990
- _context33.next = 21;
18989
+ _res = _context34.sent;
18990
+ _context34.next = 21;
18991
18991
  return _res.json();
18992
18992
 
18993
18993
  case 21:
18994
- resData = _context33.sent;
18994
+ resData = _context34.sent;
18995
18995
  decimals = (_resData$tokens$ = resData.tokens[0]) === null || _resData$tokens$ === void 0 ? void 0 : _resData$tokens$.decimals;
18996
18996
  globalDecimals = decimals;
18997
- _context33.next = 29;
18997
+ _context34.next = 29;
18998
18998
  break;
18999
18999
 
19000
19000
  case 26:
19001
- _context33.prev = 26;
19002
- _context33.t0 = _context33["catch"](12);
19003
- console.log(_context33.t0);
19001
+ _context34.prev = 26;
19002
+ _context34.t0 = _context34["catch"](12);
19003
+ console.log(_context34.t0);
19004
19004
 
19005
19005
  case 29:
19006
19006
  item.balance = formatNumber(item.balance, globalDecimals);
@@ -19010,62 +19010,326 @@ function _typeof(o) {
19010
19010
 
19011
19011
  case 31:
19012
19012
  case "end":
19013
- return _context33.stop();
19013
+ return _context34.stop();
19014
19014
  }
19015
19015
  }), _loop4, null, [ [ 12, 26 ] ]);
19016
19016
  }));
19017
- _iterator47.s();
19017
+ _iterator48.s();
19018
19018
 
19019
19019
  case 36:
19020
- if ((_step47 = _iterator47.n()).done) {
19021
- _context34.next = 40;
19020
+ if ((_step48 = _iterator48.n()).done) {
19021
+ _context35.next = 40;
19022
19022
  break;
19023
19023
  }
19024
- return _context34.delegateYield(_loop4(), "t0", 38);
19024
+ return _context35.delegateYield(_loop4(), "t0", 38);
19025
19025
 
19026
19026
  case 38:
19027
- _context34.next = 36;
19027
+ _context35.next = 36;
19028
19028
  break;
19029
19029
 
19030
19030
  case 40:
19031
- _context34.next = 45;
19031
+ _context35.next = 45;
19032
19032
  break;
19033
19033
 
19034
19034
  case 42:
19035
- _context34.prev = 42;
19036
- _context34.t1 = _context34["catch"](33);
19037
- _iterator47.e(_context34.t1);
19035
+ _context35.prev = 42;
19036
+ _context35.t1 = _context35["catch"](33);
19037
+ _iterator48.e(_context35.t1);
19038
19038
 
19039
19039
  case 45:
19040
- _context34.prev = 45;
19041
- _iterator47.f();
19042
- return _context34.finish(45);
19040
+ _context35.prev = 45;
19041
+ _iterator48.f();
19042
+ return _context35.finish(45);
19043
19043
 
19044
19044
  case 48:
19045
- return _context34.abrupt("return", _final);
19045
+ return _context35.abrupt("return", _final);
19046
19046
 
19047
19047
  case 51:
19048
- _context34.prev = 51;
19049
- _context34.t2 = _context34["catch"](0);
19050
- return _context34.abrupt("return", errorMessageHandler(_context34.t2, "DUNE"));
19048
+ _context35.prev = 51;
19049
+ _context35.t2 = _context35["catch"](0);
19050
+ return _context35.abrupt("return", errorMessageHandler(_context35.t2, "DUNE"));
19051
19051
 
19052
19052
  case 54:
19053
19053
  case "end":
19054
- return _context34.stop();
19054
+ return _context35.stop();
19055
19055
  }
19056
- }), _callee30, null, [ [ 0, 51 ], [ 33, 42, 45, 48 ] ]);
19056
+ }), _callee31, null, [ [ 0, 51 ], [ 33, 42, 45, 48 ] ]);
19057
19057
  })));
19058
19058
  return _DUNE.apply(this, arguments);
19059
19059
  }
19060
+ var priceSchema = objectType({
19061
+ input1: stringType().nonempty(),
19062
+ input2: stringType().optional(),
19063
+ input3: stringType().optional()
19064
+ }).superRefine((function(data, ctx) {
19065
+ var _data$input, _data$input2;
19066
+ if (!isAddress$1.isAddress(data.input1)) return;
19067
+ if (!data.input2) {
19068
+ ctx.addIssue({
19069
+ code: ZodIssueCode.custom,
19070
+ message: "Chain is required to query token price ",
19071
+ path: [ "input2" ]
19072
+ });
19073
+ }
19074
+ if (((_data$input = data.input2) === null || _data$input === void 0 || (_data$input = _data$input.split(",")) === null || _data$input === void 0 ? void 0 : _data$input.length) > 1) {
19075
+ ctx.addIssue({
19076
+ code: ZodIssueCode.custom,
19077
+ message: "Token address can query only one chain ",
19078
+ path: [ "input2" ]
19079
+ });
19080
+ }
19081
+ if (((_data$input2 = data.input1) === null || _data$input2 === void 0 ? void 0 : _data$input2.split(",").length) > 1) {
19082
+ ctx.addIssue({
19083
+ code: ZodIssueCode.custom,
19084
+ message: "You can query a single token address at a time.",
19085
+ path: [ "input1" ]
19086
+ });
19087
+ }
19088
+ }));
19089
+ function PRICE() {
19090
+ return _PRICE.apply(this, arguments);
19091
+ }
19092
+ function _PRICE() {
19093
+ _PRICE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee32() {
19094
+ var _input, _input2, _input3, _argsToArray33, _argsToArray34, input1, input2, input3, baseUrl, url, returnSingleValue, tokenAddress, coin, res, errorData, _data9, _args36 = arguments;
19095
+ return _regeneratorRuntime().wrap((function _callee32$(_context36) {
19096
+ while (1) switch (_context36.prev = _context36.next) {
19097
+ case 0:
19098
+ _context36.prev = 0;
19099
+ _argsToArray33 = argsToArray(_args36), _argsToArray34 = _slicedToArray(_argsToArray33, 3),
19100
+ input1 = _argsToArray34[0], input2 = _argsToArray34[1], input3 = _argsToArray34[2];
19101
+ input1 = (_input = input1) === null || _input === void 0 ? void 0 : _input.replace(/\s+/g, "");
19102
+ input2 = (_input2 = input2) === null || _input2 === void 0 ? void 0 : _input2.replace(/\s+/g, "");
19103
+ input3 = (_input3 = input3) === null || _input3 === void 0 ? void 0 : _input3.replace(/\s+/g, "");
19104
+ validateParams(priceSchema, {
19105
+ input1: input1,
19106
+ input2: input2,
19107
+ input3: input3
19108
+ });
19109
+ baseUrl = window.useLocal ? "http://localhost:3000" : "https://onchain-proxy.fileverse.io";
19110
+ url = "".concat(baseUrl) + "/third-party?service=price";
19111
+ returnSingleValue = false;
19112
+ if (isAddress$1.isAddress(input1)) {
19113
+ tokenAddress = input1;
19114
+ url += "&token=".concat(tokenAddress, "&chain=").concat(input2);
19115
+ if (input3) {
19116
+ url += "&time=".concat(input3);
19117
+ }
19118
+ } else {
19119
+ coin = input1;
19120
+ url += "&coin=".concat(coin);
19121
+ if (input2) {
19122
+ url += "&time=".concat(input2);
19123
+ } else if (coin.split(",").length === 1) {
19124
+ returnSingleValue = true;
19125
+ }
19126
+ }
19127
+ _context36.next = 12;
19128
+ return fetch(url);
19129
+
19130
+ case 12:
19131
+ res = _context36.sent;
19132
+ if (!(res.status === 400)) {
19133
+ _context36.next = 18;
19134
+ break;
19135
+ }
19136
+ _context36.next = 16;
19137
+ return res.json();
19138
+
19139
+ case 16:
19140
+ errorData = _context36.sent;
19141
+ throw new ValidationError(errorData.message);
19142
+
19143
+ case 18:
19144
+ if (res.ok) {
19145
+ _context36.next = 20;
19146
+ break;
19147
+ }
19148
+ throw new NetworkError("PRICE", res.status);
19149
+
19150
+ case 20:
19151
+ _context36.next = 22;
19152
+ return res.json();
19153
+
19154
+ case 22:
19155
+ _data9 = _context36.sent;
19156
+ if (!returnSingleValue) {
19157
+ _context36.next = 25;
19158
+ break;
19159
+ }
19160
+ return _context36.abrupt("return", _data9[0].price);
19161
+
19162
+ case 25:
19163
+ return _context36.abrupt("return", _data9);
19164
+
19165
+ case 28:
19166
+ _context36.prev = 28;
19167
+ _context36.t0 = _context36["catch"](0);
19168
+ return _context36.abrupt("return", errorMessageHandler(_context36.t0, "PRICE"));
19169
+
19170
+ case 31:
19171
+ case "end":
19172
+ return _context36.stop();
19173
+ }
19174
+ }), _callee32, null, [ [ 0, 28 ] ]);
19175
+ })));
19176
+ return _PRICE.apply(this, arguments);
19177
+ }
19178
+ var walletParamsSchema = objectType({
19179
+ query: enumType([ "txns", "balance" ]),
19180
+ addresses: stringType().nonempty(),
19181
+ chains: stringType(),
19182
+ time: stringType().optional()
19183
+ }).superRefine((function(data, ctx) {
19184
+ if (data.addresses.split(",").length > 20) {
19185
+ ctx.addIssue({
19186
+ code: ZodIssueCode.custom,
19187
+ message: "Max number of addresses to query is 20",
19188
+ path: [ "addresses" ]
19189
+ });
19190
+ }
19191
+ }));
19192
+ var getResolvedAddresses = function() {
19193
+ var _ref15 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(addresses) {
19194
+ var addressesList, resolvedAddresses, _iterator45, _step45, address, _data;
19195
+ return _regeneratorRuntime().wrap((function _callee10$(_context10) {
19196
+ while (1) switch (_context10.prev = _context10.next) {
19197
+ case 0:
19198
+ addressesList = addresses.split(",");
19199
+ resolvedAddresses = [];
19200
+ _iterator45 = _createForOfIteratorHelper(addressesList);
19201
+ _context10.prev = 3;
19202
+ _iterator45.s();
19203
+
19204
+ case 5:
19205
+ if ((_step45 = _iterator45.n()).done) {
19206
+ _context10.next = 13;
19207
+ break;
19208
+ }
19209
+ address = _step45.value;
19210
+ _context10.next = 9;
19211
+ return fromEnsNameToAddress$1.validateAndGetAddress(address);
19212
+
19213
+ case 9:
19214
+ _data = _context10.sent;
19215
+ resolvedAddresses.push(_data);
19216
+
19217
+ case 11:
19218
+ _context10.next = 5;
19219
+ break;
19220
+
19221
+ case 13:
19222
+ _context10.next = 18;
19223
+ break;
19224
+
19225
+ case 15:
19226
+ _context10.prev = 15;
19227
+ _context10.t0 = _context10["catch"](3);
19228
+ _iterator45.e(_context10.t0);
19229
+
19230
+ case 18:
19231
+ _context10.prev = 18;
19232
+ _iterator45.f();
19233
+ return _context10.finish(18);
19234
+
19235
+ case 21:
19236
+ return _context10.abrupt("return", resolvedAddresses.join(","));
19237
+
19238
+ case 22:
19239
+ case "end":
19240
+ return _context10.stop();
19241
+ }
19242
+ }), _callee10, null, [ [ 3, 15, 18, 21 ] ]);
19243
+ })));
19244
+ return function getResolvedAddresses(_x17) {
19245
+ return _ref15.apply(this, arguments);
19246
+ };
19247
+ }();
19248
+ function WALLET() {
19249
+ return _WALLET.apply(this, arguments);
19250
+ }
19251
+ function _WALLET() {
19252
+ _WALLET = _asyncToGenerator(_regeneratorRuntime().mark((function _callee33() {
19253
+ var _addresses, _chains, _chains2, _argsToArray35, _argsToArray36, addresses, chains, query, time, baseUrl, resolvedAddresses, url, res, errorData, json, _args37 = arguments;
19254
+ return _regeneratorRuntime().wrap((function _callee33$(_context37) {
19255
+ while (1) switch (_context37.prev = _context37.next) {
19256
+ case 0:
19257
+ _context37.prev = 0;
19258
+ _argsToArray35 = argsToArray(_args37), _argsToArray36 = _slicedToArray(_argsToArray35, 4),
19259
+ addresses = _argsToArray36[0], chains = _argsToArray36[1], query = _argsToArray36[2],
19260
+ time = _argsToArray36[3];
19261
+ validateParams(walletParamsSchema, {
19262
+ addresses: addresses,
19263
+ chains: chains,
19264
+ query: query,
19265
+ time: time
19266
+ });
19267
+ addresses = (_addresses = addresses) === null || _addresses === void 0 ? void 0 : _addresses.replace(/\s+/g, "");
19268
+ chains = (_chains = chains) === null || _chains === void 0 ? void 0 : _chains.replace(/\s+/g, "");
19269
+ time = (_chains2 = chains) === null || _chains2 === void 0 ? void 0 : _chains2.replace(/\s+/g, "");
19270
+ baseUrl = "https://onchain-proxy.fileverse.io";
19271
+ _context37.next = 9;
19272
+ return getResolvedAddresses(addresses);
19273
+
19274
+ case 9:
19275
+ resolvedAddresses = _context37.sent;
19276
+ url = "".concat(baseUrl, "/third-party?service=wallet&addresses=").concat(resolvedAddresses, "&chains=").concat(chains, "&query=").concat(query);
19277
+ if (time) {
19278
+ url += "&time=".concat(time);
19279
+ }
19280
+ _context37.next = 14;
19281
+ return fetch(url);
19282
+
19283
+ case 14:
19284
+ res = _context37.sent;
19285
+ if (!(res.status === 400)) {
19286
+ _context37.next = 20;
19287
+ break;
19288
+ }
19289
+ _context37.next = 18;
19290
+ return res.json();
19291
+
19292
+ case 18:
19293
+ errorData = _context37.sent;
19294
+ throw new ValidationError(errorData.message);
19295
+
19296
+ case 20:
19297
+ if (res.ok) {
19298
+ _context37.next = 22;
19299
+ break;
19300
+ }
19301
+ throw new NetworkError("WALLET", res.status);
19302
+
19303
+ case 22:
19304
+ _context37.next = 24;
19305
+ return res.json();
19306
+
19307
+ case 24:
19308
+ json = _context37.sent;
19309
+ return _context37.abrupt("return", json);
19310
+
19311
+ case 28:
19312
+ _context37.prev = 28;
19313
+ _context37.t0 = _context37["catch"](0);
19314
+ return _context37.abrupt("return", errorMessageHandler(_context37.t0, "WALLET"));
19315
+
19316
+ case 31:
19317
+ case "end":
19318
+ return _context37.stop();
19319
+ }
19320
+ }), _callee33, null, [ [ 0, 28 ] ]);
19321
+ })));
19322
+ return _WALLET.apply(this, arguments);
19323
+ }
19060
19324
  function FLVURL() {
19061
19325
  return _FLVURL.apply(this, arguments);
19062
19326
  }
19063
19327
  function _FLVURL() {
19064
- _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee31() {
19065
- return _regeneratorRuntime().wrap((function _callee31$(_context35) {
19066
- while (1) switch (_context35.prev = _context35.next) {
19328
+ _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee34() {
19329
+ return _regeneratorRuntime().wrap((function _callee34$(_context38) {
19330
+ while (1) switch (_context38.prev = _context38.next) {
19067
19331
  case 0:
19068
- return _context35.abrupt("return", new Promise((function(resolve) {
19332
+ return _context38.abrupt("return", new Promise((function(resolve) {
19069
19333
  setTimeout((function() {
19070
19334
  resolve([ {
19071
19335
  Yoo: "gotcha"
@@ -19075,9 +19339,9 @@ function _typeof(o) {
19075
19339
 
19076
19340
  case 1:
19077
19341
  case "end":
19078
- return _context35.stop();
19342
+ return _context38.stop();
19079
19343
  }
19080
- }), _callee31);
19344
+ }), _callee34);
19081
19345
  })));
19082
19346
  return _FLVURL.apply(this, arguments);
19083
19347
  }
@@ -19408,6 +19672,7 @@ function _typeof(o) {
19408
19672
  exports.POLYMARKET = POLYMARKET;
19409
19673
  exports.POWER = POWER;
19410
19674
  exports.PPMT = PPMT;
19675
+ exports.PRICE = PRICE;
19411
19676
  exports.PRICEDISC = PRICEDISC;
19412
19677
  exports.PRIVACYPOOL = PRIVACYPOOL;
19413
19678
  exports.PROB = PROB;
@@ -19509,6 +19774,7 @@ function _typeof(o) {
19509
19774
  exports.VARPA = VARPA;
19510
19775
  exports.VARS = VARS;
19511
19776
  exports.VLOOKUP = VLOOKUP;
19777
+ exports.WALLET = WALLET;
19512
19778
  exports.WEEKDAY = WEEKDAY;
19513
19779
  exports.WEEKNUM = WEEKNUM;
19514
19780
  exports.WEIBULL = WEIBULL;