@fileverse-dev/formulajs 4.4.11-mod-68-patch-1 → 4.4.11-mod-70

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.11-mod-68-patch-1 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-70 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -21,6 +21,38 @@ function _objectWithoutPropertiesLoose(r, e) {
21
21
  return t;
22
22
  }
23
23
 
24
+ function ownKeys(e, r) {
25
+ var t = Object.keys(e);
26
+ if (Object.getOwnPropertySymbols) {
27
+ var o = Object.getOwnPropertySymbols(e);
28
+ r && (o = o.filter((function(r) {
29
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
30
+ }))), t.push.apply(t, o);
31
+ }
32
+ return t;
33
+ }
34
+
35
+ function _objectSpread(e) {
36
+ for (var r = 1; r < arguments.length; r++) {
37
+ var t = null != arguments[r] ? arguments[r] : {};
38
+ r % 2 ? ownKeys(Object(t), !0).forEach((function(r) {
39
+ _defineProperty(e, r, t[r]);
40
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach((function(r) {
41
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
42
+ }));
43
+ }
44
+ return e;
45
+ }
46
+
47
+ function _defineProperty(e, r, t) {
48
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
49
+ value: t,
50
+ enumerable: !0,
51
+ configurable: !0,
52
+ writable: !0
53
+ }) : e[r] = t, e;
54
+ }
55
+
24
56
  function _createForOfIteratorHelper(r, e) {
25
57
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
26
58
  if (!t) {
@@ -81,6 +113,22 @@ function _createClass(e, r, t) {
81
113
  }), e;
82
114
  }
83
115
 
116
+ function _toPropertyKey(t) {
117
+ var i = _toPrimitive(t, "string");
118
+ return "symbol" == _typeof(i) ? i : i + "";
119
+ }
120
+
121
+ function _toPrimitive(t, r) {
122
+ if ("object" != _typeof(t) || !t) return t;
123
+ var e = t[Symbol.toPrimitive];
124
+ if (void 0 !== e) {
125
+ var i = e.call(t, r || "default");
126
+ if ("object" != _typeof(i)) return i;
127
+ throw new TypeError("@@toPrimitive must return a primitive value.");
128
+ }
129
+ return ("string" === r ? String : Number)(t);
130
+ }
131
+
84
132
  function _classCallCheck(a, n) {
85
133
  if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
86
134
  }
@@ -463,54 +511,6 @@ function _asyncToGenerator(n) {
463
511
  };
464
512
  }
465
513
 
466
- function ownKeys(e, r) {
467
- var t = Object.keys(e);
468
- if (Object.getOwnPropertySymbols) {
469
- var o = Object.getOwnPropertySymbols(e);
470
- r && (o = o.filter((function(r) {
471
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
472
- }))), t.push.apply(t, o);
473
- }
474
- return t;
475
- }
476
-
477
- function _objectSpread(e) {
478
- for (var r = 1; r < arguments.length; r++) {
479
- var t = null != arguments[r] ? arguments[r] : {};
480
- r % 2 ? ownKeys(Object(t), !0).forEach((function(r) {
481
- _defineProperty(e, r, t[r]);
482
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach((function(r) {
483
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
484
- }));
485
- }
486
- return e;
487
- }
488
-
489
- function _defineProperty(e, r, t) {
490
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
491
- value: t,
492
- enumerable: !0,
493
- configurable: !0,
494
- writable: !0
495
- }) : e[r] = t, e;
496
- }
497
-
498
- function _toPropertyKey(t) {
499
- var i = _toPrimitive(t, "string");
500
- return "symbol" == _typeof(i) ? i : i + "";
501
- }
502
-
503
- function _toPrimitive(t, r) {
504
- if ("object" != _typeof(t) || !t) return t;
505
- var e = t[Symbol.toPrimitive];
506
- if (void 0 !== e) {
507
- var i = e.call(t, r || "default");
508
- if ("object" != _typeof(i)) return i;
509
- throw new TypeError("@@toPrimitive must return a primitive value.");
510
- }
511
- return ("string" === r ? String : Number)(t);
512
- }
513
-
514
514
  function _slicedToArray(r, e) {
515
515
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
516
516
  }
@@ -11068,85 +11068,9 @@ function _typeof(o) {
11068
11068
  Neynar: "Neynar",
11069
11069
  Defillama: "Defillama"
11070
11070
  };
11071
- var PROXY_MAP = {
11072
- Etherscan: {
11073
- url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
11074
- removeParams: [ "apikey" ]
11075
- },
11076
- Basescan: {
11077
- url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
11078
- removeParams: [ "apikey" ]
11079
- },
11080
- Gnosisscan: {
11081
- url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
11082
- removeParams: [ "apikey" ]
11083
- },
11084
- Coingecko: {
11085
- url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
11086
- removeParams: [ "apikey" ]
11087
- },
11088
- Firefly: {
11089
- url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
11090
- removeParams: [ "apikey" ]
11091
- },
11092
- Neynar: {
11093
- url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
11094
- removeParams: [ "api_key" ]
11095
- },
11096
- Safe: {
11097
- url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
11098
- removeParams: [ "api_key" ]
11099
- },
11100
- Defillama: {
11101
- url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
11102
- removeParams: [ "api_key" ]
11103
- },
11104
- GnosisPay: {
11105
- url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
11106
- removeParams: [ "api_key" ]
11107
- }
11108
- };
11109
- function removeUrlParams(url, paramsToRemove) {
11110
- if (!paramsToRemove || paramsToRemove.length === 0) {
11111
- return url;
11112
- }
11113
- var urlObj = new URL(url);
11114
- paramsToRemove.forEach((function(param) {
11115
- if (urlObj.searchParams.has(param)) {
11116
- urlObj.searchParams["delete"](param);
11117
- }
11118
- }));
11119
- return urlObj.toString();
11120
- }
11121
- function getUrlAndHeaders(_ref) {
11122
- var url = _ref.url, serviceName = _ref.serviceName, _ref$headers = _ref.headers, headers = _ref$headers === void 0 ? {} : _ref$headers;
11123
- console.log("getUrlAndHeaders new modified function from formulajs", url, apiKeyName, serviceName);
11124
- var apiKeyLS = window.localStorage.getItem(SERVICES_API_KEY[serviceName]);
11125
- var isProxyModeEnabledValue = apiKeyLS === "DEFAULT_PROXY_MODE";
11126
- var proxyConfig = PROXY_MAP[serviceName];
11127
- if (isProxyModeEnabledValue && proxyConfig && serviceName && SERVICES_API_KEY[serviceName]) {
11128
- console.log("isProxyModeEnabledValue", isProxyModeEnabledValue);
11129
- var cleanedUrl = removeUrlParams(url, proxyConfig.removeParams);
11130
- return {
11131
- URL: proxyConfig.url,
11132
- HEADERS: {
11133
- "target-url": cleanedUrl,
11134
- method: "GET",
11135
- "Content-Type": "application/json"
11136
- }
11137
- };
11138
- }
11139
- return {
11140
- URL: url,
11141
- HEADERS: _objectSpread(_objectSpread({}, headers), {}, {
11142
- method: "GET",
11143
- "Content-Type": "application/json"
11144
- })
11145
- };
11146
- }
11147
11071
  var fromTimeStampToBlock = function() {
11148
- var _ref2 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(timestamp, chain, apiKey) {
11149
- var chainId, url, _getUrlAndHeaders, finalUrl, HEADERS, res, json;
11072
+ var _ref = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(timestamp, chain, apiKey) {
11073
+ var chainId, url, res, json;
11150
11074
  return _regeneratorRuntime().wrap((function _callee$(_context) {
11151
11075
  while (1) switch (_context.prev = _context.next) {
11152
11076
  case 0:
@@ -11159,30 +11083,26 @@ function _typeof(o) {
11159
11083
  case 2:
11160
11084
  chainId = CHAIN_ID_MAP[chain];
11161
11085
  url = "https://api.etherscan.io/v2/api?module=block&action=getblocknobytime&timestamp=".concat(timestamp, "&closest=before&apikey=").concat(apiKey, "&chainId=").concat(chainId);
11162
- _getUrlAndHeaders = getUrlAndHeaders(url), finalUrl = _getUrlAndHeaders.URL, HEADERS = _getUrlAndHeaders.HEADERS;
11163
- _context.next = 7;
11164
- return fetch(finalUrl, {
11165
- method: "GET",
11166
- headers: HEADERS
11167
- });
11086
+ _context.next = 6;
11087
+ return fetch(url);
11168
11088
 
11169
- case 7:
11089
+ case 6:
11170
11090
  res = _context.sent;
11171
- _context.next = 10;
11091
+ _context.next = 9;
11172
11092
  return res.json();
11173
11093
 
11174
- case 10:
11094
+ case 9:
11175
11095
  json = _context.sent;
11176
11096
  return _context.abrupt("return", parseInt(json.result));
11177
11097
 
11178
- case 12:
11098
+ case 11:
11179
11099
  case "end":
11180
11100
  return _context.stop();
11181
11101
  }
11182
11102
  }), _callee);
11183
11103
  })));
11184
11104
  return function fromTimeStampToBlock(_x2, _x3, _x4) {
11185
- return _ref2.apply(this, arguments);
11105
+ return _ref.apply(this, arguments);
11186
11106
  };
11187
11107
  }();
11188
11108
  var fromTimestampToBlock = {
@@ -11319,15 +11239,15 @@ function _typeof(o) {
11319
11239
  return _handleScanRequest.apply(this, arguments);
11320
11240
  }
11321
11241
  function _handleScanRequest() {
11322
- _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(_ref3) {
11323
- var type, address, startDate, endDate, _ref3$page, page, _ref3$offset, offset, apiKey, functionName, chainId, network, API_INFO_MAP, ensName, apiInfo, baseUrl, ACTION_MAP, action, url, _yield$Promise$all, _yield$Promise$all2, startBlock, endBlock, _getUrlAndHeaders3, finalUrl, HEADERS, res, json;
11242
+ _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(_ref2) {
11243
+ var type, address, startDate, endDate, _ref2$page, page, _ref2$offset, offset, apiKey, functionName, chainId, network, API_INFO_MAP, ensName, apiInfo, baseUrl, ACTION_MAP, action, module, url, _yield$Promise$all, _yield$Promise$all2, startBlock, endBlock, res, json;
11324
11244
  return _regeneratorRuntime().wrap((function _callee10$(_context10) {
11325
11245
  while (1) switch (_context10.prev = _context10.next) {
11326
11246
  case 0:
11327
- type = _ref3.type, address = _ref3.address, startDate = _ref3.startDate, endDate = _ref3.endDate,
11328
- _ref3$page = _ref3.page, page = _ref3$page === void 0 ? 1 : _ref3$page, _ref3$offset = _ref3.offset,
11329
- offset = _ref3$offset === void 0 ? 10 : _ref3$offset, apiKey = _ref3.apiKey, functionName = _ref3.functionName,
11330
- chainId = _ref3.chainId, network = _ref3.network;
11247
+ type = _ref2.type, address = _ref2.address, startDate = _ref2.startDate, endDate = _ref2.endDate,
11248
+ _ref2$page = _ref2.page, page = _ref2$page === void 0 ? 1 : _ref2$page, _ref2$offset = _ref2.offset,
11249
+ offset = _ref2$offset === void 0 ? 10 : _ref2$offset, apiKey = _ref2.apiKey, functionName = _ref2.functionName,
11250
+ chainId = _ref2.chainId, network = _ref2.network;
11331
11251
  API_INFO_MAP = {
11332
11252
  BASE: {
11333
11253
  url: "https://api.basescan.org/api",
@@ -11372,7 +11292,7 @@ function _typeof(o) {
11372
11292
  "all-txns": "txlist",
11373
11293
  "token-txns": "tokentx",
11374
11294
  "nft-txns": "tokennfttx",
11375
- gas: "gastracker"
11295
+ gas: "gasoracle"
11376
11296
  };
11377
11297
  action = ACTION_MAP[type];
11378
11298
  if (action) {
@@ -11382,40 +11302,33 @@ function _typeof(o) {
11382
11302
  throw new ValidationError("Invalid type: ".concat(type));
11383
11303
 
11384
11304
  case 17:
11385
- url = "".concat(baseUrl, "?chainid=").concat(chainId, "&module=account&action=").concat(action, "&apikey=").concat(apiKey);
11305
+ module = action === "gasoracle" ? "gastracker" : "account";
11306
+ url = "".concat(baseUrl, "?chainid=").concat(chainId, "&module=").concat(module, "&action=").concat(action, "&apikey=").concat(apiKey);
11386
11307
  if (![ "all-txns", "token-txns", "nft-txns" ].includes(type)) {
11387
- _context10.next = 29;
11308
+ _context10.next = 30;
11388
11309
  break;
11389
11310
  }
11390
11311
  url += "&address=".concat(address, "&startblock=0&endblock=99999999&sort=asc");
11391
11312
  if (!(!isNaN(startDate) && !isNaN(endDate))) {
11392
- _context10.next = 28;
11313
+ _context10.next = 29;
11393
11314
  break;
11394
11315
  }
11395
- _context10.next = 23;
11316
+ _context10.next = 24;
11396
11317
  return Promise.all([ fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startDate), network, apiKey), fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endDate), network, apiKey) ]);
11397
11318
 
11398
- case 23:
11319
+ case 24:
11399
11320
  _yield$Promise$all = _context10.sent;
11400
11321
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
11401
11322
  startBlock = _yield$Promise$all2[0];
11402
11323
  endBlock = _yield$Promise$all2[1];
11403
11324
  url += "&startblock=".concat(startBlock || "0", "&endblock=").concat(endBlock || "99999999");
11404
11325
 
11405
- case 28:
11326
+ case 29:
11406
11327
  url += "&page=".concat(page, "&offset=").concat(offset);
11407
11328
 
11408
- case 29:
11409
- _getUrlAndHeaders3 = getUrlAndHeaders({
11410
- url: url,
11411
- serviceName: "Etherscan",
11412
- headers: {}
11413
- }), finalUrl = _getUrlAndHeaders3.URL, HEADERS = _getUrlAndHeaders3.HEADERS;
11329
+ case 30:
11414
11330
  _context10.next = 32;
11415
- return fetch(finalUrl, {
11416
- method: "GET",
11417
- headers: HEADERS
11418
- });
11331
+ return fetch(url);
11419
11332
 
11420
11333
  case 32:
11421
11334
  res = _context10.sent;
@@ -11449,7 +11362,7 @@ function _typeof(o) {
11449
11362
  throw new RateLimitError(apiInfo.apiKeyName);
11450
11363
 
11451
11364
  case 43:
11452
- return _context10.abrupt("return", json.result);
11365
+ return _context10.abrupt("return", type === "gas" ? [ json.result ] : json.result);
11453
11366
 
11454
11367
  case 44:
11455
11368
  case "end":
@@ -11460,8 +11373,8 @@ function _typeof(o) {
11460
11373
  return _handleScanRequest.apply(this, arguments);
11461
11374
  }
11462
11375
  var fromUsernameToFid = function() {
11463
- var _ref4 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(username, apiKey) {
11464
- var url, _getUrlAndHeaders2, finalUrl, HEADERS, res, json, users, user;
11376
+ var _ref3 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(username, apiKey) {
11377
+ var url, res, json, users, user;
11465
11378
  return _regeneratorRuntime().wrap((function _callee2$(_context2) {
11466
11379
  while (1) switch (_context2.prev = _context2.next) {
11467
11380
  case 0:
@@ -11473,26 +11386,20 @@ function _typeof(o) {
11473
11386
 
11474
11387
  case 2:
11475
11388
  url = "https://api.neynar.com/v2/farcaster/user/search/?q=".concat(username, "&limit=5");
11476
- _getUrlAndHeaders2 = getUrlAndHeaders({
11477
- url: url,
11478
- serviceName: "Neynar",
11389
+ _context2.next = 5;
11390
+ return fetch(url, {
11479
11391
  headers: {
11480
11392
  "x-api-key": apiKey,
11481
11393
  "x-neynar-experimental": "false"
11482
11394
  }
11483
- }), finalUrl = _getUrlAndHeaders2.URL, HEADERS = _getUrlAndHeaders2.HEADERS;
11484
- _context2.next = 6;
11485
- return fetch(finalUrl, {
11486
- method: "GET",
11487
- headers: HEADERS
11488
11395
  });
11489
11396
 
11490
- case 6:
11397
+ case 5:
11491
11398
  res = _context2.sent;
11492
- _context2.next = 9;
11399
+ _context2.next = 8;
11493
11400
  return res.json();
11494
11401
 
11495
- case 9:
11402
+ case 8:
11496
11403
  json = _context2.sent;
11497
11404
  users = json.result ? json.result.users : [];
11498
11405
  user = users.find((function(user) {
@@ -11500,14 +11407,14 @@ function _typeof(o) {
11500
11407
  }));
11501
11408
  return _context2.abrupt("return", user && user.fid || null);
11502
11409
 
11503
- case 13:
11410
+ case 12:
11504
11411
  case "end":
11505
11412
  return _context2.stop();
11506
11413
  }
11507
11414
  }), _callee2);
11508
11415
  })));
11509
11416
  return function fromUsernameToFid(_x7, _x8) {
11510
- return _ref4.apply(this, arguments);
11417
+ return _ref3.apply(this, arguments);
11511
11418
  };
11512
11419
  }();
11513
11420
  var fromUsernameToFid$1 = {
@@ -12254,7 +12161,7 @@ function _typeof(o) {
12254
12161
  description: description
12255
12162
  };
12256
12163
  var customMap = function customMap(iss, ctx) {
12257
- var _ref6;
12164
+ var _ref5;
12258
12165
  var message = params.message;
12259
12166
  if (iss.code === "invalid_enum_value") {
12260
12167
  return {
@@ -12262,16 +12169,16 @@ function _typeof(o) {
12262
12169
  };
12263
12170
  }
12264
12171
  if (typeof ctx.data === "undefined") {
12265
- var _ref5;
12172
+ var _ref4;
12266
12173
  return {
12267
- message: (_ref5 = message !== null && message !== void 0 ? message : required_error) !== null && _ref5 !== void 0 ? _ref5 : ctx.defaultError
12174
+ message: (_ref4 = message !== null && message !== void 0 ? message : required_error) !== null && _ref4 !== void 0 ? _ref4 : ctx.defaultError
12268
12175
  };
12269
12176
  }
12270
12177
  if (iss.code !== "invalid_type") return {
12271
12178
  message: ctx.defaultError
12272
12179
  };
12273
12180
  return {
12274
- message: (_ref6 = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _ref6 !== void 0 ? _ref6 : ctx.defaultError
12181
+ message: (_ref5 = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _ref5 !== void 0 ? _ref5 : ctx.defaultError
12275
12182
  };
12276
12183
  };
12277
12184
  return {
@@ -15011,7 +14918,7 @@ function _typeof(o) {
15011
14918
  }
15012
14919
  if (ctx.common.async) {
15013
14920
  return Promise.all(options.map(function() {
15014
- var _ref8 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7(option) {
14921
+ var _ref7 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7(option) {
15015
14922
  var childCtx;
15016
14923
  return _regeneratorRuntime().wrap((function _callee7$(_context7) {
15017
14924
  while (1) switch (_context7.prev = _context7.next) {
@@ -15044,7 +14951,7 @@ function _typeof(o) {
15044
14951
  }), _callee7);
15045
14952
  })));
15046
14953
  return function(_x13) {
15047
- return _ref8.apply(this, arguments);
14954
+ return _ref7.apply(this, arguments);
15048
14955
  };
15049
14956
  }())).then(handleResults);
15050
14957
  } else {
@@ -15346,8 +15253,8 @@ function _typeof(o) {
15346
15253
  data: ctx.data,
15347
15254
  path: ctx.path,
15348
15255
  parent: ctx
15349
- }) ]).then((function(_ref9) {
15350
- var _ref0 = _slicedToArray(_ref9, 2), left = _ref0[0], right = _ref0[1];
15256
+ }) ]).then((function(_ref8) {
15257
+ var _ref9 = _slicedToArray(_ref8, 2), left = _ref9[0], right = _ref9[1];
15351
15258
  return handleParsed(left, right);
15352
15259
  }));
15353
15260
  } else {
@@ -15480,8 +15387,8 @@ function _typeof(o) {
15480
15387
  }
15481
15388
  var keyType = this._def.keyType;
15482
15389
  var valueType = this._def.valueType;
15483
- var pairs = _toConsumableArray(ctx.data.entries()).map((function(_ref1, index) {
15484
- var _ref10 = _slicedToArray(_ref1, 2), key = _ref10[0], value = _ref10[1];
15390
+ var pairs = _toConsumableArray(ctx.data.entries()).map((function(_ref0, index) {
15391
+ var _ref1 = _slicedToArray(_ref0, 2), key = _ref1[0], value = _ref1[1];
15485
15392
  return {
15486
15393
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [ index, "key" ])),
15487
15394
  value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [ index, "value" ]))
@@ -16015,7 +15922,7 @@ function _typeof(o) {
16015
15922
  var processed = effect.transform(ctx.data, checkCtx);
16016
15923
  if (ctx.common.async) {
16017
15924
  return Promise.resolve(processed).then(function() {
16018
- var _ref12 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9(processed) {
15925
+ var _ref11 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9(processed) {
16019
15926
  var result;
16020
15927
  return _regeneratorRuntime().wrap((function _callee9$(_context9) {
16021
15928
  while (1) switch (_context9.prev = _context9.next) {
@@ -16066,7 +15973,7 @@ function _typeof(o) {
16066
15973
  }), _callee9);
16067
15974
  })));
16068
15975
  return function(_x14) {
16069
- return _ref12.apply(this, arguments);
15976
+ return _ref11.apply(this, arguments);
16070
15977
  };
16071
15978
  }());
16072
15979
  } else {
@@ -16397,7 +16304,7 @@ function _typeof(o) {
16397
16304
  var _this$_processInputPa13 = this._processInputParams(input), status = _this$_processInputPa13.status, ctx = _this$_processInputPa13.ctx;
16398
16305
  if (ctx.common.async) {
16399
16306
  var handleAsync = function() {
16400
- var _ref13 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
16307
+ var _ref12 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
16401
16308
  var inResult;
16402
16309
  return _regeneratorRuntime().wrap((function _callee0$(_context0) {
16403
16310
  while (1) switch (_context0.prev = _context0.next) {
@@ -16439,7 +16346,7 @@ function _typeof(o) {
16439
16346
  }), _callee0);
16440
16347
  })));
16441
16348
  return function handleAsync() {
16442
- return _ref13.apply(this, arguments);
16349
+ return _ref12.apply(this, arguments);
16443
16350
  };
16444
16351
  }();
16445
16352
  return handleAsync();
@@ -16569,14 +16476,18 @@ function _typeof(o) {
16569
16476
  contentType: enumType([ "posts", "replies", "channels" ]),
16570
16477
  identifier: stringType().nonempty(),
16571
16478
  start: numberType()["int"]().nonnegative()["default"](0),
16572
- end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
16479
+ end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT, {
16480
+ message: '"end" must be less than or equal to '.concat(MAX_PAGE_LIMIT)
16481
+ })["default"](10)
16573
16482
  });
16574
16483
  var lensSchema = objectType({
16575
16484
  platform: literalType("lens"),
16576
16485
  contentType: enumType([ "posts", "replies" ]),
16577
16486
  identifier: stringType().nonempty(),
16578
16487
  start: numberType()["int"]().nonnegative()["default"](0),
16579
- end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
16488
+ end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT, {
16489
+ message: '"end" must be less than or equal to '.concat(MAX_PAGE_LIMIT)
16490
+ })["default"](10)
16580
16491
  });
16581
16492
  var fireflyParamsSchema = discriminatedUnionType("platform", [ farcasterSchema, lensSchema ]);
16582
16493
  var fireFlyPlaformType = {
@@ -16594,21 +16505,33 @@ function _typeof(o) {
16594
16505
  contentType: enumType([ "posts", "replies" ]),
16595
16506
  identifier: stringType().nonempty(),
16596
16507
  start: numberType()["int"]().nonnegative()["default"](0),
16597
- end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
16508
+ end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT, {
16509
+ message: '"end" must be less than or equal to '.concat(MAX_PAGE_LIMIT)
16510
+ })["default"](10)
16598
16511
  });
16599
16512
  var farcasterParamsSchema = objectType({
16600
16513
  contentType: enumType([ "posts", "replies", "channels" ]),
16601
16514
  identifier: stringType().nonempty(),
16602
16515
  start: numberType()["int"]().nonnegative()["default"](0),
16603
- end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
16516
+ end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT, {
16517
+ message: '"end" must be less than or equal to '.concat(MAX_PAGE_LIMIT)
16518
+ })["default"](10)
16604
16519
  });
16605
16520
  var dateStringToTimestamp = function dateStringToTimestamp(val) {
16606
- var _val$split = val.split("/"), _val$split2 = _slicedToArray(_val$split, 3), mm = _val$split2[0], dd = _val$split2[1], yyyy = _val$split2[2];
16607
- return Math.floor(new Date("".concat(yyyy, "-").concat(mm, "-").concat(dd)).getTime() / 1e3);
16521
+ var _val$split = val.split("/"), _val$split2 = _slicedToArray(_val$split, 3), dd = _val$split2[0], mm = _val$split2[1], yyyy = _val$split2[2];
16522
+ var date = new Date("".concat(yyyy, "-").concat(mm.padStart(2, "0"), "-").concat(dd.padStart(2, "0")));
16523
+ var timestamp = date.getTime();
16524
+ return isNaN(timestamp) ? NaN : Math.floor(timestamp / 1e3);
16608
16525
  };
16609
16526
  var dateOrTimestamp = preprocessType((function(val) {
16610
- return typeof val === "string" && /^\d{2}\/\d{2}\/\d{4}$/.test(val) ? dateStringToTimestamp(val) : val;
16611
- }), numberType()["int"]().nonnegative());
16527
+ return typeof val === "string" && /^\d{1,2}\/\d{1,2}\/\d{4}$/.test(val) ? dateStringToTimestamp(val) : val;
16528
+ }), numberType({
16529
+ invalid_type_error: "Date must be a valid DD/MM/YYYY or timestamp"
16530
+ })["int"]("Date must be an integer timestamp").nonnegative("Date must be a nonnegative timestamp").refine((function(n) {
16531
+ return !isNaN(n);
16532
+ }), {
16533
+ message: "Invalid date format or value: expected DD/MM/YYYY"
16534
+ }));
16612
16535
  var blockscoutParamsSchema = objectType({
16613
16536
  address: stringType().nonempty(),
16614
16537
  type: enumType([ "stat", "txns", "tokens" ]),
@@ -16616,14 +16539,18 @@ function _typeof(o) {
16616
16539
  startTimestamp: dateOrTimestamp.optional(),
16617
16540
  endTimestamp: dateOrTimestamp.optional(),
16618
16541
  page: numberType()["int"]().nonnegative()["default"](1),
16619
- offset: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
16542
+ offset: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT, {
16543
+ message: '"offset" must be less than or equal to '.concat(MAX_PAGE_LIMIT)
16544
+ })["default"](10)
16620
16545
  });
16621
16546
  var gasSchema$1 = objectType({
16622
16547
  type: literalType("gas"),
16623
16548
  startDate: dateOrTimestamp.optional(),
16624
16549
  endDate: dateOrTimestamp.optional(),
16625
16550
  page: numberType()["int"]().nonnegative()["default"](1),
16626
- limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
16551
+ limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT, {
16552
+ message: '"limit" must be less than or equal to '.concat(MAX_PAGE_LIMIT)
16553
+ })["default"](10)
16627
16554
  });
16628
16555
  var txnSchema$1 = objectType({
16629
16556
  type: enumType([ "all-txns", "token-txns", "nft-txns" ]),
@@ -16631,7 +16558,9 @@ function _typeof(o) {
16631
16558
  startDate: dateOrTimestamp.optional(),
16632
16559
  endDate: dateOrTimestamp.optional(),
16633
16560
  page: numberType()["int"]().nonnegative()["default"](1),
16634
- limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
16561
+ limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT, {
16562
+ message: '"limit" must be less than or equal to '.concat(MAX_PAGE_LIMIT)
16563
+ })["default"](10)
16635
16564
  });
16636
16565
  var baseParamsSchema = discriminatedUnionType("type", [ gasSchema$1, txnSchema$1 ]);
16637
16566
  var gasSchema = objectType({
@@ -16639,7 +16568,9 @@ function _typeof(o) {
16639
16568
  startDate: dateOrTimestamp.optional(),
16640
16569
  endDate: dateOrTimestamp.optional(),
16641
16570
  page: numberType()["int"]().nonnegative()["default"](1),
16642
- limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
16571
+ limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT, {
16572
+ message: '"limit" must be less than or equal to '.concat(MAX_PAGE_LIMIT)
16573
+ })["default"](10)
16643
16574
  });
16644
16575
  var txnSchema = objectType({
16645
16576
  type: enumType([ "all-txns", "token-txns", "nft-txns" ]),
@@ -16648,9 +16579,24 @@ function _typeof(o) {
16648
16579
  endDate: dateOrTimestamp.optional(),
16649
16580
  chain: enumType([ "ethereum", "base", "gnosis" ]),
16650
16581
  page: numberType()["int"]().nonnegative()["default"](1),
16651
- limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
16582
+ limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT, {
16583
+ message: '"limit" must be less than or equal to '.concat(MAX_PAGE_LIMIT)
16584
+ })["default"](10)
16652
16585
  });
16653
16586
  var etherscanParamsSchema = discriminatedUnionType("type", [ gasSchema, txnSchema ]);
16587
+ var allowedValues = [ "1h", "24h", "7d" ];
16588
+ var param2Schema = stringType().refine((function(val) {
16589
+ var tokens = val.split(",").map((function(t) {
16590
+ return t.trim().toLowerCase();
16591
+ }));
16592
+ return tokens.some((function(token) {
16593
+ return allowedValues.some((function(allowed) {
16594
+ return token.includes(allowed);
16595
+ }));
16596
+ }));
16597
+ }), {
16598
+ message: "param2 must contain at least one of: '1h', '24h', '7d'"
16599
+ }).optional();
16654
16600
  var priceSchema = objectType({
16655
16601
  category: literalType("price"),
16656
16602
  param1: stringType().nonempty(),
@@ -16660,13 +16606,13 @@ function _typeof(o) {
16660
16606
  var marketSchema = objectType({
16661
16607
  category: literalType("market"),
16662
16608
  param1: enumType(marketEcosystems),
16663
- param2: enumType([ "1h", "24h", "7d" ]).optional()
16609
+ param2: param2Schema
16664
16610
  });
16665
16611
  var stablecoinsTypes = [ "all", "yield-bearing-stablecoins", "crypto-backed-stablecoin" ];
16666
16612
  var stablecoinsSchema = objectType({
16667
16613
  category: literalType("stablecoins"),
16668
16614
  param1: enumType(stablecoinsTypes),
16669
- param2: enumType([ "1h", "24h", "7d" ]).optional()
16615
+ param2: param2Schema
16670
16616
  });
16671
16617
  var derivativesSchema = objectType({
16672
16618
  category: literalType("derivatives"),
@@ -16685,7 +16631,9 @@ function _typeof(o) {
16685
16631
  startTime: dateOrTimestamp.optional(),
16686
16632
  endTime: dateOrTimestamp.optional(),
16687
16633
  page: numberType()["int"]().nonnegative()["default"](1),
16688
- offset: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
16634
+ offset: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT, {
16635
+ message: '"offset" must be less than or equal to '.concat(MAX_PAGE_LIMIT)
16636
+ })["default"](10)
16689
16637
  });
16690
16638
  var eoaParamsSchema = preprocessType((function(val) {
16691
16639
  var obj = _objectSpread({}, val || {});
@@ -16707,7 +16655,9 @@ function _typeof(o) {
16707
16655
  address: stringType().nonempty(),
16708
16656
  utility: literalType("txns"),
16709
16657
  chain: enumType([ "ethereum", "gnosis" ]),
16710
- limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10),
16658
+ limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT, {
16659
+ message: '"limit" must be less than or equal to '.concat(MAX_PAGE_LIMIT)
16660
+ })["default"](10),
16711
16661
  offset: numberType()["int"]().nonnegative()["default"](0)
16712
16662
  });
16713
16663
  var categories = [ "protocols", "yields", "dex", "fees" ];
@@ -16737,7 +16687,7 @@ function _typeof(o) {
16737
16687
  }
16738
16688
  function _FIREFLY() {
16739
16689
  _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11() {
16740
- var _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, apiKey, url, _getUrlAndHeaders4, finalUrl, HEADERS, response, _yield$response$json, _data, _args11 = arguments;
16690
+ var _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, apiKey, url, response, _yield$response$json, _data, _args11 = arguments;
16741
16691
  return _regeneratorRuntime().wrap((function _callee11$(_context11) {
16742
16692
  while (1) switch (_context11.prev = _context11.next) {
16743
16693
  case 0:
@@ -16768,39 +16718,35 @@ function _typeof(o) {
16768
16718
  url.searchParams.set("type", fireFlyPlaformType[platform][contentType]);
16769
16719
  url.searchParams.set("start", String(start));
16770
16720
  url.searchParams.set("end", String(end));
16771
- _getUrlAndHeaders4 = getUrlAndHeaders({
16772
- url: url.toString(),
16773
- serviceName: "Firefly",
16774
- headers: headers
16775
- }), finalUrl = _getUrlAndHeaders4.URL, HEADERS = _getUrlAndHeaders4.HEADERS;
16776
- _context11.next = 14;
16777
- return fetch(finalUrl, {
16778
- method: "GET",
16779
- headers: HEADERS
16721
+ _context11.next = 13;
16722
+ return fetch(url.toString(), {
16723
+ headers: {
16724
+ "x-api-key": apiKey
16725
+ }
16780
16726
  });
16781
16727
 
16782
- case 14:
16728
+ case 13:
16783
16729
  response = _context11.sent;
16784
16730
  if (response.ok) {
16785
- _context11.next = 17;
16731
+ _context11.next = 16;
16786
16732
  break;
16787
16733
  }
16788
16734
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
16789
16735
 
16790
- case 17:
16791
- _context11.next = 19;
16736
+ case 16:
16737
+ _context11.next = 18;
16792
16738
  return response.json();
16793
16739
 
16794
- case 19:
16740
+ case 18:
16795
16741
  _yield$response$json = _context11.sent;
16796
16742
  _data = _yield$response$json.data;
16797
16743
  if (Array.isArray(_data)) {
16798
- _context11.next = 23;
16744
+ _context11.next = 22;
16799
16745
  break;
16800
16746
  }
16801
16747
  return _context11.abrupt("return", []);
16802
16748
 
16803
- case 23:
16749
+ case 22:
16804
16750
  return _context11.abrupt("return", _data.map((function(item) {
16805
16751
  var flat = {};
16806
16752
  for (var _i10 = 0, _Object$entries = Object.entries(item); _i10 < _Object$entries.length; _i10++) {
@@ -16813,16 +16759,16 @@ function _typeof(o) {
16813
16759
  return flat;
16814
16760
  })));
16815
16761
 
16816
- case 26:
16817
- _context11.prev = 26;
16762
+ case 25:
16763
+ _context11.prev = 25;
16818
16764
  _context11.t0 = _context11["catch"](0);
16819
16765
  return _context11.abrupt("return", errorMessageHandler(_context11.t0, "FIREFLY"));
16820
16766
 
16821
- case 29:
16767
+ case 28:
16822
16768
  case "end":
16823
16769
  return _context11.stop();
16824
16770
  }
16825
- }), _callee11, null, [ [ 0, 26 ] ]);
16771
+ }), _callee11, null, [ [ 0, 25 ] ]);
16826
16772
  })));
16827
16773
  return _FIREFLY.apply(this, arguments);
16828
16774
  }
@@ -16831,7 +16777,7 @@ function _typeof(o) {
16831
16777
  }
16832
16778
  function _LENS() {
16833
16779
  _LENS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12() {
16834
- var _argsToArray5, _argsToArray6, contentType, identifier, _argsToArray6$, start, _argsToArray6$2, end, apiKey, url, typeMap, _getUrlAndHeaders5, finalUrl, HEADERS, response, _yield$response$json2, _data2, _args12 = arguments;
16780
+ var _argsToArray5, _argsToArray6, contentType, identifier, _argsToArray6$, start, _argsToArray6$2, end, apiKey, url, typeMap, response, _yield$response$json2, _data2, _args12 = arguments;
16835
16781
  return _regeneratorRuntime().wrap((function _callee12$(_context12) {
16836
16782
  while (1) switch (_context12.prev = _context12.next) {
16837
16783
  case 0:
@@ -16865,39 +16811,35 @@ function _typeof(o) {
16865
16811
  url.searchParams.set("type", typeMap[contentType]);
16866
16812
  url.searchParams.set("start", String(start));
16867
16813
  url.searchParams.set("end", String(end));
16868
- _getUrlAndHeaders5 = getUrlAndHeaders({
16869
- url: url.toString(),
16870
- serviceName: "Firefly",
16871
- headers: headers
16872
- }), finalUrl = _getUrlAndHeaders5.URL, HEADERS = _getUrlAndHeaders5.HEADERS;
16873
- _context12.next = 15;
16874
- return fetch(finalUrl, {
16875
- method: "GET",
16876
- headers: HEADERS
16814
+ _context12.next = 14;
16815
+ return fetch(url.toString(), {
16816
+ headers: {
16817
+ "x-api-key": apiKey
16818
+ }
16877
16819
  });
16878
16820
 
16879
- case 15:
16821
+ case 14:
16880
16822
  response = _context12.sent;
16881
16823
  if (response.ok) {
16882
- _context12.next = 18;
16824
+ _context12.next = 17;
16883
16825
  break;
16884
16826
  }
16885
16827
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
16886
16828
 
16887
- case 18:
16888
- _context12.next = 20;
16829
+ case 17:
16830
+ _context12.next = 19;
16889
16831
  return response.json();
16890
16832
 
16891
- case 20:
16833
+ case 19:
16892
16834
  _yield$response$json2 = _context12.sent;
16893
16835
  _data2 = _yield$response$json2.data;
16894
16836
  if (Array.isArray(_data2)) {
16895
- _context12.next = 24;
16837
+ _context12.next = 23;
16896
16838
  break;
16897
16839
  }
16898
16840
  return _context12.abrupt("return", []);
16899
16841
 
16900
- case 24:
16842
+ case 23:
16901
16843
  return _context12.abrupt("return", _data2.map((function(item) {
16902
16844
  var flat = {};
16903
16845
  for (var _i11 = 0, _Object$entries2 = Object.entries(item); _i11 < _Object$entries2.length; _i11++) {
@@ -16910,16 +16852,16 @@ function _typeof(o) {
16910
16852
  return flat;
16911
16853
  })));
16912
16854
 
16913
- case 27:
16914
- _context12.prev = 27;
16855
+ case 26:
16856
+ _context12.prev = 26;
16915
16857
  _context12.t0 = _context12["catch"](0);
16916
16858
  return _context12.abrupt("return", errorMessageHandler(_context12.t0, "LENS"));
16917
16859
 
16918
- case 30:
16860
+ case 29:
16919
16861
  case "end":
16920
16862
  return _context12.stop();
16921
16863
  }
16922
- }), _callee12, null, [ [ 0, 27 ] ]);
16864
+ }), _callee12, null, [ [ 0, 26 ] ]);
16923
16865
  })));
16924
16866
  return _LENS.apply(this, arguments);
16925
16867
  }
@@ -16928,7 +16870,7 @@ function _typeof(o) {
16928
16870
  }
16929
16871
  function _FARCASTER() {
16930
16872
  _FARCASTER = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
16931
- var _argsToArray7, _argsToArray8, contentType, identifier, _argsToArray8$, start, _argsToArray8$2, end, apiKey, url, typeMap, _getUrlAndHeaders6, finalUrl, HEADERS, response, _yield$response$json3, _data3, _args13 = arguments;
16873
+ var _argsToArray7, _argsToArray8, contentType, identifier, _argsToArray8$, start, _argsToArray8$2, end, apiKey, url, typeMap, response, _yield$response$json3, _data3, _args13 = arguments;
16932
16874
  return _regeneratorRuntime().wrap((function _callee13$(_context13) {
16933
16875
  while (1) switch (_context13.prev = _context13.next) {
16934
16876
  case 0:
@@ -16963,39 +16905,35 @@ function _typeof(o) {
16963
16905
  url.searchParams.set("type", typeMap[contentType]);
16964
16906
  url.searchParams.set("start", String(start));
16965
16907
  url.searchParams.set("end", String(end));
16966
- _getUrlAndHeaders6 = getUrlAndHeaders({
16967
- url: url.toString(),
16968
- serviceName: "Firefly",
16969
- headers: headers
16970
- }), finalUrl = _getUrlAndHeaders6.URL, HEADERS = _getUrlAndHeaders6.HEADERS;
16971
- _context13.next = 15;
16972
- return fetch(finalUrl, {
16973
- method: "GET",
16974
- headers: HEADERS
16908
+ _context13.next = 14;
16909
+ return fetch(url.toString(), {
16910
+ headers: {
16911
+ "x-api-key": apiKey
16912
+ }
16975
16913
  });
16976
16914
 
16977
- case 15:
16915
+ case 14:
16978
16916
  response = _context13.sent;
16979
16917
  if (response.ok) {
16980
- _context13.next = 18;
16918
+ _context13.next = 17;
16981
16919
  break;
16982
16920
  }
16983
16921
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
16984
16922
 
16985
- case 18:
16986
- _context13.next = 20;
16923
+ case 17:
16924
+ _context13.next = 19;
16987
16925
  return response.json();
16988
16926
 
16989
- case 20:
16927
+ case 19:
16990
16928
  _yield$response$json3 = _context13.sent;
16991
16929
  _data3 = _yield$response$json3.data;
16992
16930
  if (Array.isArray(_data3)) {
16993
- _context13.next = 24;
16931
+ _context13.next = 23;
16994
16932
  break;
16995
16933
  }
16996
16934
  return _context13.abrupt("return", []);
16997
16935
 
16998
- case 24:
16936
+ case 23:
16999
16937
  return _context13.abrupt("return", _data3.map((function(item) {
17000
16938
  var flat = {};
17001
16939
  for (var _i12 = 0, _Object$entries3 = Object.entries(item); _i12 < _Object$entries3.length; _i12++) {
@@ -17008,16 +16946,16 @@ function _typeof(o) {
17008
16946
  return flat;
17009
16947
  })));
17010
16948
 
17011
- case 27:
17012
- _context13.prev = 27;
16949
+ case 26:
16950
+ _context13.prev = 26;
17013
16951
  _context13.t0 = _context13["catch"](0);
17014
16952
  return _context13.abrupt("return", errorMessageHandler(_context13.t0, "FARCASTER"));
17015
16953
 
17016
- case 30:
16954
+ case 29:
17017
16955
  case "end":
17018
16956
  return _context13.stop();
17019
16957
  }
17020
- }), _callee13, null, [ [ 0, 27 ] ]);
16958
+ }), _callee13, null, [ [ 0, 26 ] ]);
17021
16959
  })));
17022
16960
  return _FARCASTER.apply(this, arguments);
17023
16961
  }
@@ -17133,7 +17071,7 @@ function _typeof(o) {
17133
17071
  }
17134
17072
  function _BASE() {
17135
17073
  _BASE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15() {
17136
- var _argsToArray1, _argsToArray10, type, address, startDate, endDate, page, limit, _API_KEY, _args15 = arguments;
17074
+ var _argsToArray1, _argsToArray10, type, address, startDate, endDate, page, limit, API_KEY, _args15 = arguments;
17137
17075
  return _regeneratorRuntime().wrap((function _callee15$(_context15) {
17138
17076
  while (1) switch (_context15.prev = _context15.next) {
17139
17077
  case 0:
@@ -17149,8 +17087,8 @@ function _typeof(o) {
17149
17087
  page: page,
17150
17088
  limit: limit
17151
17089
  });
17152
- _API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Basescan);
17153
- if (_API_KEY) {
17090
+ API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Basescan);
17091
+ if (API_KEY) {
17154
17092
  _context15.next = 6;
17155
17093
  break;
17156
17094
  }
@@ -17165,7 +17103,7 @@ function _typeof(o) {
17165
17103
  endDate: endDate,
17166
17104
  page: page,
17167
17105
  offset: limit,
17168
- apiKey: _API_KEY,
17106
+ apiKey: API_KEY,
17169
17107
  functionName: "BASE",
17170
17108
  chainId: CHAIN_ID_MAP.base,
17171
17109
  network: "base"
@@ -17252,7 +17190,7 @@ function _typeof(o) {
17252
17190
  }
17253
17191
  function _NEYNAR() {
17254
17192
  _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
17255
- var neynarParamsSchema, _argsToArray13, _argsToArray14, username, apiKey, fid, url, _getUrlAndHeaders7, finalUrl, HEADERS, response, json, users, _args17 = arguments;
17193
+ var neynarParamsSchema, _argsToArray13, _argsToArray14, username, apiKey, fid, url, response, json, users, _args17 = arguments;
17256
17194
  return _regeneratorRuntime().wrap((function _callee17$(_context17) {
17257
17195
  while (1) switch (_context17.prev = _context17.next) {
17258
17196
  case 0:
@@ -17286,47 +17224,39 @@ function _typeof(o) {
17286
17224
 
17287
17225
  case 12:
17288
17226
  url = "https://api.neynar.com/v2/farcaster/followers?fid=".concat(fid);
17289
- _getUrlAndHeaders7 = getUrlAndHeaders({
17290
- url: url.toString(),
17291
- serviceName: "Firefly",
17227
+ _context17.next = 15;
17228
+ return fetch(url, {
17292
17229
  headers: {
17293
- headers: {
17294
- "x-api-key": API_KEY,
17295
- "x-neynar-experimental": "false"
17296
- }
17230
+ "x-api-key": apiKey,
17231
+ "x-neynar-experimental": "false"
17297
17232
  }
17298
- }), finalUrl = _getUrlAndHeaders7.URL, HEADERS = _getUrlAndHeaders7.HEADERS;
17299
- _context17.next = 16;
17300
- return fetch(finalUrl, {
17301
- method: "GET",
17302
- headers: HEADERS
17303
17233
  });
17304
17234
 
17305
- case 16:
17235
+ case 15:
17306
17236
  response = _context17.sent;
17307
17237
  if (response.ok) {
17308
- _context17.next = 19;
17238
+ _context17.next = 18;
17309
17239
  break;
17310
17240
  }
17311
17241
  throw new NetworkError(SERVICES_API_KEY.Neynar, response.status);
17312
17242
 
17313
- case 19:
17314
- _context17.next = 21;
17243
+ case 18:
17244
+ _context17.next = 20;
17315
17245
  return response.json();
17316
17246
 
17317
- case 21:
17247
+ case 20:
17318
17248
  json = _context17.sent;
17319
17249
  users = (json === null || json === void 0 ? void 0 : json.users) || [];
17320
17250
  if (users.length) {
17321
- _context17.next = 25;
17251
+ _context17.next = 24;
17322
17252
  break;
17323
17253
  }
17324
17254
  return _context17.abrupt("return", []);
17325
17255
 
17326
- case 25:
17327
- return _context17.abrupt("return", users.map((function(_ref14) {
17256
+ case 24:
17257
+ return _context17.abrupt("return", users.map((function(_ref13) {
17328
17258
  var _user$profile, _user$profile2;
17329
- var user = _ref14.user;
17259
+ var user = _ref13.user;
17330
17260
  return {
17331
17261
  username: user.username,
17332
17262
  custody_address: user.custody_address,
@@ -17336,16 +17266,16 @@ function _typeof(o) {
17336
17266
  };
17337
17267
  })));
17338
17268
 
17339
- case 28:
17340
- _context17.prev = 28;
17269
+ case 27:
17270
+ _context17.prev = 27;
17341
17271
  _context17.t0 = _context17["catch"](0);
17342
17272
  return _context17.abrupt("return", errorMessageHandler(_context17.t0, "NEYNAR"));
17343
17273
 
17344
- case 31:
17274
+ case 30:
17345
17275
  case "end":
17346
17276
  return _context17.stop();
17347
17277
  }
17348
- }), _callee17, null, [ [ 0, 28 ] ]);
17278
+ }), _callee17, null, [ [ 0, 27 ] ]);
17349
17279
  })));
17350
17280
  return _NEYNAR.apply(this, arguments);
17351
17281
  }
@@ -17424,7 +17354,7 @@ function _typeof(o) {
17424
17354
  }
17425
17355
  function _COINGECKO() {
17426
17356
  _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee19() {
17427
- var _category$toLowerCase, _argsToArray17, _argsToArray18, category, param1, param2, apiKey, _headers, url, vs, map, _category, trend, _category2, _trend, res, json, _json$status, msg, out, _i13, _Object$entries4, _Object$entries4$_i, token, prices, _i14, _Object$entries5, _Object$entries5$_i, cur, val, _data4, _args19 = arguments;
17357
+ var _category$toLowerCase, _argsToArray17, _argsToArray18, category, param1, param2, apiKey, headers, url, vs, map, _category, trend, _category2, _trend, res, json, _json$status, msg, out, _i13, _Object$entries4, _Object$entries4$_i, token, prices, _i14, _Object$entries5, _Object$entries5$_i, cur, val, _data4, _args19 = arguments;
17428
17358
  return _regeneratorRuntime().wrap((function _callee19$(_context19) {
17429
17359
  while (1) switch (_context19.prev = _context19.next) {
17430
17360
  case 0:
@@ -17444,7 +17374,7 @@ function _typeof(o) {
17444
17374
  throw new MissingApiKeyError(SERVICES_API_KEY.Coingecko);
17445
17375
 
17446
17376
  case 6:
17447
- _headers = {
17377
+ headers = {
17448
17378
  accept: "application/json",
17449
17379
  "x-cg-demo-api-key": apiKey
17450
17380
  };
@@ -17488,7 +17418,7 @@ function _typeof(o) {
17488
17418
  case 25:
17489
17419
  _context19.next = 27;
17490
17420
  return fetch(url, {
17491
- headers: _headers
17421
+ headers: headers
17492
17422
  });
17493
17423
 
17494
17424
  case 27:
@@ -17564,68 +17494,58 @@ function _typeof(o) {
17564
17494
  return _regeneratorRuntime().wrap((function _callee21$(_context24) {
17565
17495
  while (1) switch (_context24.prev = _context24.next) {
17566
17496
  case 0:
17567
- console.log("EOA");
17568
- _context24.prev = 1;
17497
+ _context24.prev = 0;
17569
17498
  fetchJSON = function() {
17570
- var _ref15 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20(url) {
17571
- var _getUrlAndHeaders8, finalUrl, HEADERS, res, json;
17499
+ var _ref14 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20(url) {
17500
+ var res, json;
17572
17501
  return _regeneratorRuntime().wrap((function _callee20$(_context20) {
17573
17502
  while (1) switch (_context20.prev = _context20.next) {
17574
17503
  case 0:
17575
- _getUrlAndHeaders8 = getUrlAndHeaders({
17576
- url: url,
17577
- serviceName: "Etherscan",
17578
- headers: {}
17579
- }), finalUrl = _getUrlAndHeaders8.URL, HEADERS = _getUrlAndHeaders8.HEADERS;
17580
- console.log("finalUrl", finalUrl, HEADERS);
17581
- _context20.next = 4;
17582
- return fetch(finalUrl, {
17583
- method: "GET",
17584
- headers: HEADERS
17585
- });
17504
+ _context20.next = 2;
17505
+ return fetch(url);
17586
17506
 
17587
- case 4:
17507
+ case 2:
17588
17508
  res = _context20.sent;
17589
17509
  if (res.ok) {
17590
- _context20.next = 7;
17510
+ _context20.next = 5;
17591
17511
  break;
17592
17512
  }
17593
17513
  throw new NetworkError(SERVICES_API_KEY.Etherscan, res.status);
17594
17514
 
17595
- case 7:
17596
- _context20.next = 9;
17515
+ case 5:
17516
+ _context20.next = 7;
17597
17517
  return res.json();
17598
17518
 
17599
- case 9:
17519
+ case 7:
17600
17520
  json = _context20.sent;
17601
17521
  if (!(typeof json.result === "string")) {
17602
- _context20.next = 15;
17522
+ _context20.next = 13;
17603
17523
  break;
17604
17524
  }
17605
17525
  if (!json.result.includes("Invalid API Key")) {
17606
- _context20.next = 13;
17526
+ _context20.next = 11;
17607
17527
  break;
17608
17528
  }
17609
17529
  throw new InvalidApiKeyError(SERVICES_API_KEY.Etherscan);
17610
17530
 
17611
- case 13:
17531
+ case 11:
17612
17532
  if (!json.result.includes("Max rate limit reached")) {
17613
- _context20.next = 15;
17533
+ _context20.next = 13;
17614
17534
  break;
17615
17535
  }
17616
17536
  throw new RateLimitError(SERVICES_API_KEY.Etherscan);
17617
17537
 
17618
- case 15:
17538
+ case 13:
17619
17539
  return _context20.abrupt("return", json.result);
17620
17540
 
17621
- case 16:
17541
+ case 14:
17622
17542
  case "end":
17623
17543
  return _context20.stop();
17624
17544
  }
17625
17545
  }), _callee20);
17626
17546
  })));
17627
17547
  return function fetchJSON(_x17) {
17628
- return _ref15.apply(this, arguments);
17548
+ return _ref14.apply(this, arguments);
17629
17549
  };
17630
17550
  }();
17631
17551
  _argsToArray19 = argsToArray(_args24), _argsToArray20 = _slicedToArray(_argsToArray19, 7),
@@ -17644,12 +17564,12 @@ function _typeof(o) {
17644
17564
  });
17645
17565
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Etherscan);
17646
17566
  if (apiKey) {
17647
- _context24.next = 8;
17567
+ _context24.next = 7;
17648
17568
  break;
17649
17569
  }
17650
17570
  throw new MissingApiKeyError(SERVICES_API_KEY.Etherscan);
17651
17571
 
17652
- case 8:
17572
+ case 7:
17653
17573
  INPUTS = addresses.split(",").map((function(s) {
17654
17574
  return s.trim();
17655
17575
  })).filter(Boolean);
@@ -17658,62 +17578,62 @@ function _typeof(o) {
17658
17578
  })).filter(Boolean);
17659
17579
  ADDRESS_MAP = {};
17660
17580
  _iterator41 = _createForOfIteratorHelper(INPUTS);
17661
- _context24.prev = 12;
17581
+ _context24.prev = 11;
17662
17582
  _iterator41.s();
17663
17583
 
17664
- case 14:
17584
+ case 13:
17665
17585
  if ((_step41 = _iterator41.n()).done) {
17666
- _context24.next = 29;
17586
+ _context24.next = 28;
17667
17587
  break;
17668
17588
  }
17669
17589
  inp = _step41.value;
17670
17590
  if (!isAddress$1.isAddress(inp)) {
17671
- _context24.next = 20;
17591
+ _context24.next = 19;
17672
17592
  break;
17673
17593
  }
17674
17594
  ADDRESS_MAP[inp.toLowerCase()] = null;
17675
- _context24.next = 27;
17595
+ _context24.next = 26;
17676
17596
  break;
17677
17597
 
17678
- case 20:
17598
+ case 19:
17679
17599
  ens = inp;
17680
- _context24.next = 23;
17600
+ _context24.next = 22;
17681
17601
  return fromEnsNameToAddress$1.fromEnsNameToAddress(ens);
17682
17602
 
17683
- case 23:
17603
+ case 22:
17684
17604
  resolved = _context24.sent;
17685
17605
  if (resolved) {
17686
- _context24.next = 26;
17606
+ _context24.next = 25;
17687
17607
  break;
17688
17608
  }
17689
17609
  throw new EnsError(ens);
17690
17610
 
17691
- case 26:
17611
+ case 25:
17692
17612
  ADDRESS_MAP[resolved.toLowerCase()] = ens;
17693
17613
 
17694
- case 27:
17695
- _context24.next = 14;
17614
+ case 26:
17615
+ _context24.next = 13;
17696
17616
  break;
17697
17617
 
17698
- case 29:
17699
- _context24.next = 34;
17618
+ case 28:
17619
+ _context24.next = 33;
17700
17620
  break;
17701
17621
 
17702
- case 31:
17703
- _context24.prev = 31;
17704
- _context24.t0 = _context24["catch"](12);
17622
+ case 30:
17623
+ _context24.prev = 30;
17624
+ _context24.t0 = _context24["catch"](11);
17705
17625
  _iterator41.e(_context24.t0);
17706
17626
 
17707
- case 34:
17708
- _context24.prev = 34;
17627
+ case 33:
17628
+ _context24.prev = 33;
17709
17629
  _iterator41.f();
17710
- return _context24.finish(34);
17630
+ return _context24.finish(33);
17711
17631
 
17712
- case 37:
17632
+ case 36:
17713
17633
  ADDRS = Object.keys(ADDRESS_MAP);
17714
17634
  out = [];
17715
17635
  _iterator42 = _createForOfIteratorHelper(CHAINS);
17716
- _context24.prev = 40;
17636
+ _context24.prev = 39;
17717
17637
  _loop = _regeneratorRuntime().mark((function _loop() {
17718
17638
  var chain, chainId, _loop2, _ret2, i, sb, eb, _loop3, _ret3, _i16, _ADDRS;
17719
17639
  return _regeneratorRuntime().wrap((function _loop$(_context23) {
@@ -17887,52 +17807,52 @@ function _typeof(o) {
17887
17807
  }));
17888
17808
  _iterator42.s();
17889
17809
 
17890
- case 43:
17810
+ case 42:
17891
17811
  if ((_step42 = _iterator42.n()).done) {
17892
- _context24.next = 50;
17812
+ _context24.next = 49;
17893
17813
  break;
17894
17814
  }
17895
- return _context24.delegateYield(_loop(), "t1", 45);
17815
+ return _context24.delegateYield(_loop(), "t1", 44);
17896
17816
 
17897
- case 45:
17817
+ case 44:
17898
17818
  _ret = _context24.t1;
17899
17819
  if (!_ret) {
17900
- _context24.next = 48;
17820
+ _context24.next = 47;
17901
17821
  break;
17902
17822
  }
17903
17823
  return _context24.abrupt("return", _ret.v);
17904
17824
 
17905
- case 48:
17906
- _context24.next = 43;
17825
+ case 47:
17826
+ _context24.next = 42;
17907
17827
  break;
17908
17828
 
17909
- case 50:
17910
- _context24.next = 55;
17829
+ case 49:
17830
+ _context24.next = 54;
17911
17831
  break;
17912
17832
 
17913
- case 52:
17914
- _context24.prev = 52;
17915
- _context24.t2 = _context24["catch"](40);
17833
+ case 51:
17834
+ _context24.prev = 51;
17835
+ _context24.t2 = _context24["catch"](39);
17916
17836
  _iterator42.e(_context24.t2);
17917
17837
 
17918
- case 55:
17919
- _context24.prev = 55;
17838
+ case 54:
17839
+ _context24.prev = 54;
17920
17840
  _iterator42.f();
17921
- return _context24.finish(55);
17841
+ return _context24.finish(54);
17922
17842
 
17923
- case 58:
17843
+ case 57:
17924
17844
  return _context24.abrupt("return", out);
17925
17845
 
17926
- case 61:
17927
- _context24.prev = 61;
17928
- _context24.t3 = _context24["catch"](1);
17846
+ case 60:
17847
+ _context24.prev = 60;
17848
+ _context24.t3 = _context24["catch"](0);
17929
17849
  return _context24.abrupt("return", errorMessageHandler(_context24.t3, "EOA"));
17930
17850
 
17931
- case 64:
17851
+ case 63:
17932
17852
  case "end":
17933
17853
  return _context24.stop();
17934
17854
  }
17935
- }), _callee21, null, [ [ 1, 61 ], [ 12, 31, 34, 37 ], [ 40, 52, 55, 58 ] ]);
17855
+ }), _callee21, null, [ [ 0, 60 ], [ 11, 30, 33, 36 ], [ 39, 51, 54, 57 ] ]);
17936
17856
  })));
17937
17857
  return _EOA.apply(this, arguments);
17938
17858
  }
@@ -18044,8 +17964,8 @@ function _typeof(o) {
18044
17964
  throw new ValidationError("Invalid API response");
18045
17965
 
18046
17966
  case 28:
18047
- return _context26.abrupt("return", json.results.map((function(_ref16) {
18048
- var confirmations = _ref16.confirmations, dataDecoded = _ref16.dataDecoded, rest = _objectWithoutProperties(_ref16, _excluded);
17967
+ return _context26.abrupt("return", json.results.map((function(_ref15) {
17968
+ var confirmations = _ref15.confirmations, dataDecoded = _ref15.dataDecoded, rest = _objectWithoutProperties(_ref15, _excluded);
18049
17969
  return rest;
18050
17970
  })));
18051
17971
 
@@ -18193,8 +18113,8 @@ function _typeof(o) {
18193
18113
  }
18194
18114
  return _context28.abrupt("return", json.map((function(item) {
18195
18115
  var flat = {};
18196
- Object.entries(item).forEach((function(_ref17) {
18197
- var _ref18 = _slicedToArray(_ref17, 2), k = _ref18[0], v = _ref18[1];
18116
+ Object.entries(item).forEach((function(_ref16) {
18117
+ var _ref17 = _slicedToArray(_ref16, 2), k = _ref17[0], v = _ref17[1];
18198
18118
  if (v === null || _typeof(v) !== "object") flat[k] = v;
18199
18119
  }));
18200
18120
  return flat;
@@ -18260,8 +18180,8 @@ function _typeof(o) {
18260
18180
  }
18261
18181
  return _context29.abrupt("return", json.map((function(item) {
18262
18182
  var flat = {};
18263
- Object.entries(item).forEach((function(_ref19) {
18264
- var _ref20 = _slicedToArray(_ref19, 2), k = _ref20[0], v = _ref20[1];
18183
+ Object.entries(item).forEach((function(_ref18) {
18184
+ var _ref19 = _slicedToArray(_ref18, 2), k = _ref19[0], v = _ref19[1];
18265
18185
  if (v === null || _typeof(v) !== "object") flat[k] = v;
18266
18186
  }));
18267
18187
  return flat;