@fileverse-dev/formulajs 4.4.11-mod-71 → 4.4.11-mod-68-patch-8

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-71 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-68-patch-8 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -21,38 +21,6 @@ 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
-
56
24
  function _createForOfIteratorHelper(r, e) {
57
25
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
58
26
  if (!t) {
@@ -113,22 +81,6 @@ function _createClass(e, r, t) {
113
81
  }), e;
114
82
  }
115
83
 
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
-
132
84
  function _classCallCheck(a, n) {
133
85
  if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
134
86
  }
@@ -511,6 +463,54 @@ function _asyncToGenerator(n) {
511
463
  };
512
464
  }
513
465
 
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,41 +11068,130 @@ 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, 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
+ }
11071
11147
  var fromTimeStampToBlock = function() {
11072
- var _ref = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(timestamp, chain, apiKey) {
11073
- var chainId, url, res, json;
11148
+ var _ref2 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(timestamp, chain, apiKey) {
11149
+ var chainId, url, _getUrlAndHeaders, finalUrl, HEADERS, res, json;
11074
11150
  return _regeneratorRuntime().wrap((function _callee$(_context) {
11075
11151
  while (1) switch (_context.prev = _context.next) {
11076
11152
  case 0:
11153
+ console.log("fromTimeStampToBlock", timestamp, chain, apiKey);
11077
11154
  if (!(!timestamp || !chain || !apiKey)) {
11078
- _context.next = 2;
11155
+ _context.next = 3;
11079
11156
  break;
11080
11157
  }
11081
11158
  return _context.abrupt("return");
11082
11159
 
11083
- case 2:
11160
+ case 3:
11084
11161
  chainId = CHAIN_ID_MAP[chain];
11162
+ console.log("chainId", chainId);
11085
11163
  url = "https://api.etherscan.io/v2/api?module=block&action=getblocknobytime&timestamp=".concat(timestamp, "&closest=before&apikey=").concat(apiKey, "&chainId=").concat(chainId);
11086
- _context.next = 6;
11087
- return fetch(url);
11164
+ console.log("url", url, getUrlAndHeaders);
11165
+ _getUrlAndHeaders = getUrlAndHeaders({
11166
+ url: url,
11167
+ serviceName: "Etherscan",
11168
+ headers: {}
11169
+ }), finalUrl = _getUrlAndHeaders.URL, HEADERS = _getUrlAndHeaders.HEADERS;
11170
+ console.log("finalUrl", finalUrl, HEADERS);
11171
+ _context.next = 11;
11172
+ return fetch(finalUrl, {
11173
+ method: "GET",
11174
+ headers: HEADERS
11175
+ });
11088
11176
 
11089
- case 6:
11177
+ case 11:
11090
11178
  res = _context.sent;
11091
- _context.next = 9;
11179
+ console.log("res", res, finalUrl, HEADERS);
11180
+ _context.next = 15;
11092
11181
  return res.json();
11093
11182
 
11094
- case 9:
11183
+ case 15:
11095
11184
  json = _context.sent;
11096
11185
  return _context.abrupt("return", parseInt(json.result));
11097
11186
 
11098
- case 11:
11187
+ case 17:
11099
11188
  case "end":
11100
11189
  return _context.stop();
11101
11190
  }
11102
11191
  }), _callee);
11103
11192
  })));
11104
11193
  return function fromTimeStampToBlock(_x2, _x3, _x4) {
11105
- return _ref.apply(this, arguments);
11194
+ return _ref2.apply(this, arguments);
11106
11195
  };
11107
11196
  }();
11108
11197
  var fromTimestampToBlock = {
@@ -11239,15 +11328,15 @@ function _typeof(o) {
11239
11328
  return _handleScanRequest.apply(this, arguments);
11240
11329
  }
11241
11330
  function _handleScanRequest() {
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;
11331
+ _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(_ref3) {
11332
+ var type, address, startDate, endDate, _ref3$page, page, _ref3$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, _getUrlAndHeaders3, finalUrl, HEADERS, res, json;
11244
11333
  return _regeneratorRuntime().wrap((function _callee10$(_context10) {
11245
11334
  while (1) switch (_context10.prev = _context10.next) {
11246
11335
  case 0:
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;
11336
+ type = _ref3.type, address = _ref3.address, startDate = _ref3.startDate, endDate = _ref3.endDate,
11337
+ _ref3$page = _ref3.page, page = _ref3$page === void 0 ? 1 : _ref3$page, _ref3$offset = _ref3.offset,
11338
+ offset = _ref3$offset === void 0 ? 10 : _ref3$offset, apiKey = _ref3.apiKey, functionName = _ref3.functionName,
11339
+ chainId = _ref3.chainId, network = _ref3.network;
11251
11340
  API_INFO_MAP = {
11252
11341
  BASE: {
11253
11342
  url: "https://api.basescan.org/api",
@@ -11327,44 +11416,52 @@ function _typeof(o) {
11327
11416
  url += "&page=".concat(page, "&offset=").concat(offset);
11328
11417
 
11329
11418
  case 30:
11330
- _context10.next = 32;
11331
- return fetch(url);
11419
+ _getUrlAndHeaders3 = getUrlAndHeaders({
11420
+ url: url,
11421
+ serviceName: "Etherscan",
11422
+ headers: {}
11423
+ }), finalUrl = _getUrlAndHeaders3.URL, HEADERS = _getUrlAndHeaders3.HEADERS;
11424
+ _context10.next = 33;
11425
+ return fetch(finalUrl, {
11426
+ method: "GET",
11427
+ headers: HEADERS
11428
+ });
11332
11429
 
11333
- case 32:
11430
+ case 33:
11334
11431
  res = _context10.sent;
11335
11432
  if (res.ok) {
11336
- _context10.next = 35;
11433
+ _context10.next = 36;
11337
11434
  break;
11338
11435
  }
11339
11436
  throw new NetworkError(apiInfo.apiKeyName, res.status);
11340
11437
 
11341
- case 35:
11342
- _context10.next = 37;
11438
+ case 36:
11439
+ _context10.next = 38;
11343
11440
  return res.json();
11344
11441
 
11345
- case 37:
11442
+ case 38:
11346
11443
  json = _context10.sent;
11347
11444
  if (!(typeof json.result === "string")) {
11348
- _context10.next = 43;
11445
+ _context10.next = 44;
11349
11446
  break;
11350
11447
  }
11351
11448
  if (!json.result.includes("Invalid API Key")) {
11352
- _context10.next = 41;
11449
+ _context10.next = 42;
11353
11450
  break;
11354
11451
  }
11355
11452
  throw new InvalidApiKeyError(apiInfo.apiKeyName);
11356
11453
 
11357
- case 41:
11454
+ case 42:
11358
11455
  if (!json.result.includes("Max rate limit reached")) {
11359
- _context10.next = 43;
11456
+ _context10.next = 44;
11360
11457
  break;
11361
11458
  }
11362
11459
  throw new RateLimitError(apiInfo.apiKeyName);
11363
11460
 
11364
- case 43:
11461
+ case 44:
11365
11462
  return _context10.abrupt("return", type === "gas" && !Array.isArray(json.result) ? [ json.result ] : json.result);
11366
11463
 
11367
- case 44:
11464
+ case 45:
11368
11465
  case "end":
11369
11466
  return _context10.stop();
11370
11467
  }
@@ -11373,8 +11470,8 @@ function _typeof(o) {
11373
11470
  return _handleScanRequest.apply(this, arguments);
11374
11471
  }
11375
11472
  var fromUsernameToFid = function() {
11376
- var _ref3 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(username, apiKey) {
11377
- var url, res, json, users, user;
11473
+ var _ref4 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(username, apiKey) {
11474
+ var url, _getUrlAndHeaders2, finalUrl, HEADERS, res, json, users, user;
11378
11475
  return _regeneratorRuntime().wrap((function _callee2$(_context2) {
11379
11476
  while (1) switch (_context2.prev = _context2.next) {
11380
11477
  case 0:
@@ -11386,20 +11483,26 @@ function _typeof(o) {
11386
11483
 
11387
11484
  case 2:
11388
11485
  url = "https://api.neynar.com/v2/farcaster/user/search/?q=".concat(username, "&limit=5");
11389
- _context2.next = 5;
11390
- return fetch(url, {
11486
+ _getUrlAndHeaders2 = getUrlAndHeaders({
11487
+ url: url,
11488
+ serviceName: "Neynar",
11391
11489
  headers: {
11392
11490
  "x-api-key": apiKey,
11393
11491
  "x-neynar-experimental": "false"
11394
11492
  }
11493
+ }), finalUrl = _getUrlAndHeaders2.URL, HEADERS = _getUrlAndHeaders2.HEADERS;
11494
+ _context2.next = 6;
11495
+ return fetch(finalUrl, {
11496
+ method: "GET",
11497
+ headers: HEADERS
11395
11498
  });
11396
11499
 
11397
- case 5:
11500
+ case 6:
11398
11501
  res = _context2.sent;
11399
- _context2.next = 8;
11502
+ _context2.next = 9;
11400
11503
  return res.json();
11401
11504
 
11402
- case 8:
11505
+ case 9:
11403
11506
  json = _context2.sent;
11404
11507
  users = json.result ? json.result.users : [];
11405
11508
  user = users.find((function(user) {
@@ -11407,14 +11510,14 @@ function _typeof(o) {
11407
11510
  }));
11408
11511
  return _context2.abrupt("return", user && user.fid || null);
11409
11512
 
11410
- case 12:
11513
+ case 13:
11411
11514
  case "end":
11412
11515
  return _context2.stop();
11413
11516
  }
11414
11517
  }), _callee2);
11415
11518
  })));
11416
11519
  return function fromUsernameToFid(_x7, _x8) {
11417
- return _ref3.apply(this, arguments);
11520
+ return _ref4.apply(this, arguments);
11418
11521
  };
11419
11522
  }();
11420
11523
  var fromUsernameToFid$1 = {
@@ -12161,7 +12264,7 @@ function _typeof(o) {
12161
12264
  description: description
12162
12265
  };
12163
12266
  var customMap = function customMap(iss, ctx) {
12164
- var _ref5;
12267
+ var _ref6;
12165
12268
  var message = params.message;
12166
12269
  if (iss.code === "invalid_enum_value") {
12167
12270
  return {
@@ -12169,16 +12272,16 @@ function _typeof(o) {
12169
12272
  };
12170
12273
  }
12171
12274
  if (typeof ctx.data === "undefined") {
12172
- var _ref4;
12275
+ var _ref5;
12173
12276
  return {
12174
- message: (_ref4 = message !== null && message !== void 0 ? message : required_error) !== null && _ref4 !== void 0 ? _ref4 : ctx.defaultError
12277
+ message: (_ref5 = message !== null && message !== void 0 ? message : required_error) !== null && _ref5 !== void 0 ? _ref5 : ctx.defaultError
12175
12278
  };
12176
12279
  }
12177
12280
  if (iss.code !== "invalid_type") return {
12178
12281
  message: ctx.defaultError
12179
12282
  };
12180
12283
  return {
12181
- message: (_ref5 = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _ref5 !== void 0 ? _ref5 : ctx.defaultError
12284
+ message: (_ref6 = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _ref6 !== void 0 ? _ref6 : ctx.defaultError
12182
12285
  };
12183
12286
  };
12184
12287
  return {
@@ -14918,7 +15021,7 @@ function _typeof(o) {
14918
15021
  }
14919
15022
  if (ctx.common.async) {
14920
15023
  return Promise.all(options.map(function() {
14921
- var _ref7 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7(option) {
15024
+ var _ref8 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7(option) {
14922
15025
  var childCtx;
14923
15026
  return _regeneratorRuntime().wrap((function _callee7$(_context7) {
14924
15027
  while (1) switch (_context7.prev = _context7.next) {
@@ -14951,7 +15054,7 @@ function _typeof(o) {
14951
15054
  }), _callee7);
14952
15055
  })));
14953
15056
  return function(_x13) {
14954
- return _ref7.apply(this, arguments);
15057
+ return _ref8.apply(this, arguments);
14955
15058
  };
14956
15059
  }())).then(handleResults);
14957
15060
  } else {
@@ -15253,8 +15356,8 @@ function _typeof(o) {
15253
15356
  data: ctx.data,
15254
15357
  path: ctx.path,
15255
15358
  parent: ctx
15256
- }) ]).then((function(_ref8) {
15257
- var _ref9 = _slicedToArray(_ref8, 2), left = _ref9[0], right = _ref9[1];
15359
+ }) ]).then((function(_ref9) {
15360
+ var _ref0 = _slicedToArray(_ref9, 2), left = _ref0[0], right = _ref0[1];
15258
15361
  return handleParsed(left, right);
15259
15362
  }));
15260
15363
  } else {
@@ -15387,8 +15490,8 @@ function _typeof(o) {
15387
15490
  }
15388
15491
  var keyType = this._def.keyType;
15389
15492
  var valueType = this._def.valueType;
15390
- var pairs = _toConsumableArray(ctx.data.entries()).map((function(_ref0, index) {
15391
- var _ref1 = _slicedToArray(_ref0, 2), key = _ref1[0], value = _ref1[1];
15493
+ var pairs = _toConsumableArray(ctx.data.entries()).map((function(_ref1, index) {
15494
+ var _ref10 = _slicedToArray(_ref1, 2), key = _ref10[0], value = _ref10[1];
15392
15495
  return {
15393
15496
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [ index, "key" ])),
15394
15497
  value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [ index, "value" ]))
@@ -15922,7 +16025,7 @@ function _typeof(o) {
15922
16025
  var processed = effect.transform(ctx.data, checkCtx);
15923
16026
  if (ctx.common.async) {
15924
16027
  return Promise.resolve(processed).then(function() {
15925
- var _ref11 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9(processed) {
16028
+ var _ref12 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9(processed) {
15926
16029
  var result;
15927
16030
  return _regeneratorRuntime().wrap((function _callee9$(_context9) {
15928
16031
  while (1) switch (_context9.prev = _context9.next) {
@@ -15973,7 +16076,7 @@ function _typeof(o) {
15973
16076
  }), _callee9);
15974
16077
  })));
15975
16078
  return function(_x14) {
15976
- return _ref11.apply(this, arguments);
16079
+ return _ref12.apply(this, arguments);
15977
16080
  };
15978
16081
  }());
15979
16082
  } else {
@@ -16304,7 +16407,7 @@ function _typeof(o) {
16304
16407
  var _this$_processInputPa13 = this._processInputParams(input), status = _this$_processInputPa13.status, ctx = _this$_processInputPa13.ctx;
16305
16408
  if (ctx.common.async) {
16306
16409
  var handleAsync = function() {
16307
- var _ref12 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
16410
+ var _ref13 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
16308
16411
  var inResult;
16309
16412
  return _regeneratorRuntime().wrap((function _callee0$(_context0) {
16310
16413
  while (1) switch (_context0.prev = _context0.next) {
@@ -16346,7 +16449,7 @@ function _typeof(o) {
16346
16449
  }), _callee0);
16347
16450
  })));
16348
16451
  return function handleAsync() {
16349
- return _ref12.apply(this, arguments);
16452
+ return _ref13.apply(this, arguments);
16350
16453
  };
16351
16454
  }();
16352
16455
  return handleAsync();
@@ -16687,7 +16790,7 @@ function _typeof(o) {
16687
16790
  }
16688
16791
  function _FIREFLY() {
16689
16792
  _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11() {
16690
- var _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, apiKey, url, response, _yield$response$json, _data, _args11 = arguments;
16793
+ var _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, apiKey, url, _getUrlAndHeaders4, finalUrl, HEADERS, response, _yield$response$json, _data, _args11 = arguments;
16691
16794
  return _regeneratorRuntime().wrap((function _callee11$(_context11) {
16692
16795
  while (1) switch (_context11.prev = _context11.next) {
16693
16796
  case 0:
@@ -16718,35 +16821,41 @@ function _typeof(o) {
16718
16821
  url.searchParams.set("type", fireFlyPlaformType[platform][contentType]);
16719
16822
  url.searchParams.set("start", String(start));
16720
16823
  url.searchParams.set("end", String(end));
16721
- _context11.next = 13;
16722
- return fetch(url.toString(), {
16824
+ _getUrlAndHeaders4 = getUrlAndHeaders({
16825
+ url: url.toString(),
16826
+ serviceName: "Firefly",
16723
16827
  headers: {
16724
16828
  "x-api-key": apiKey
16725
16829
  }
16830
+ }), finalUrl = _getUrlAndHeaders4.URL, HEADERS = _getUrlAndHeaders4.HEADERS;
16831
+ _context11.next = 14;
16832
+ return fetch(finalUrl, {
16833
+ method: "GET",
16834
+ headers: HEADERS
16726
16835
  });
16727
16836
 
16728
- case 13:
16837
+ case 14:
16729
16838
  response = _context11.sent;
16730
16839
  if (response.ok) {
16731
- _context11.next = 16;
16840
+ _context11.next = 17;
16732
16841
  break;
16733
16842
  }
16734
16843
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
16735
16844
 
16736
- case 16:
16737
- _context11.next = 18;
16845
+ case 17:
16846
+ _context11.next = 19;
16738
16847
  return response.json();
16739
16848
 
16740
- case 18:
16849
+ case 19:
16741
16850
  _yield$response$json = _context11.sent;
16742
16851
  _data = _yield$response$json.data;
16743
16852
  if (Array.isArray(_data)) {
16744
- _context11.next = 22;
16853
+ _context11.next = 23;
16745
16854
  break;
16746
16855
  }
16747
16856
  return _context11.abrupt("return", []);
16748
16857
 
16749
- case 22:
16858
+ case 23:
16750
16859
  return _context11.abrupt("return", _data.map((function(item) {
16751
16860
  var flat = {};
16752
16861
  for (var _i10 = 0, _Object$entries = Object.entries(item); _i10 < _Object$entries.length; _i10++) {
@@ -16759,16 +16868,16 @@ function _typeof(o) {
16759
16868
  return flat;
16760
16869
  })));
16761
16870
 
16762
- case 25:
16763
- _context11.prev = 25;
16871
+ case 26:
16872
+ _context11.prev = 26;
16764
16873
  _context11.t0 = _context11["catch"](0);
16765
16874
  return _context11.abrupt("return", errorMessageHandler(_context11.t0, "FIREFLY"));
16766
16875
 
16767
- case 28:
16876
+ case 29:
16768
16877
  case "end":
16769
16878
  return _context11.stop();
16770
16879
  }
16771
- }), _callee11, null, [ [ 0, 25 ] ]);
16880
+ }), _callee11, null, [ [ 0, 26 ] ]);
16772
16881
  })));
16773
16882
  return _FIREFLY.apply(this, arguments);
16774
16883
  }
@@ -16777,7 +16886,7 @@ function _typeof(o) {
16777
16886
  }
16778
16887
  function _LENS() {
16779
16888
  _LENS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12() {
16780
- var _argsToArray5, _argsToArray6, contentType, identifier, _argsToArray6$, start, _argsToArray6$2, end, apiKey, url, typeMap, response, _yield$response$json2, _data2, _args12 = arguments;
16889
+ var _argsToArray5, _argsToArray6, contentType, identifier, _argsToArray6$, start, _argsToArray6$2, end, apiKey, url, typeMap, _getUrlAndHeaders5, finalUrl, HEADERS, response, _yield$response$json2, _data2, _args12 = arguments;
16781
16890
  return _regeneratorRuntime().wrap((function _callee12$(_context12) {
16782
16891
  while (1) switch (_context12.prev = _context12.next) {
16783
16892
  case 0:
@@ -16811,35 +16920,41 @@ function _typeof(o) {
16811
16920
  url.searchParams.set("type", typeMap[contentType]);
16812
16921
  url.searchParams.set("start", String(start));
16813
16922
  url.searchParams.set("end", String(end));
16814
- _context12.next = 14;
16815
- return fetch(url.toString(), {
16923
+ _getUrlAndHeaders5 = getUrlAndHeaders({
16924
+ url: url.toString(),
16925
+ serviceName: "Firefly",
16816
16926
  headers: {
16817
16927
  "x-api-key": apiKey
16818
16928
  }
16929
+ }), finalUrl = _getUrlAndHeaders5.URL, HEADERS = _getUrlAndHeaders5.HEADERS;
16930
+ _context12.next = 15;
16931
+ return fetch(finalUrl, {
16932
+ method: "GET",
16933
+ headers: HEADERS
16819
16934
  });
16820
16935
 
16821
- case 14:
16936
+ case 15:
16822
16937
  response = _context12.sent;
16823
16938
  if (response.ok) {
16824
- _context12.next = 17;
16939
+ _context12.next = 18;
16825
16940
  break;
16826
16941
  }
16827
16942
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
16828
16943
 
16829
- case 17:
16830
- _context12.next = 19;
16944
+ case 18:
16945
+ _context12.next = 20;
16831
16946
  return response.json();
16832
16947
 
16833
- case 19:
16948
+ case 20:
16834
16949
  _yield$response$json2 = _context12.sent;
16835
16950
  _data2 = _yield$response$json2.data;
16836
16951
  if (Array.isArray(_data2)) {
16837
- _context12.next = 23;
16952
+ _context12.next = 24;
16838
16953
  break;
16839
16954
  }
16840
16955
  return _context12.abrupt("return", []);
16841
16956
 
16842
- case 23:
16957
+ case 24:
16843
16958
  return _context12.abrupt("return", _data2.map((function(item) {
16844
16959
  var flat = {};
16845
16960
  for (var _i11 = 0, _Object$entries2 = Object.entries(item); _i11 < _Object$entries2.length; _i11++) {
@@ -16852,16 +16967,16 @@ function _typeof(o) {
16852
16967
  return flat;
16853
16968
  })));
16854
16969
 
16855
- case 26:
16856
- _context12.prev = 26;
16970
+ case 27:
16971
+ _context12.prev = 27;
16857
16972
  _context12.t0 = _context12["catch"](0);
16858
16973
  return _context12.abrupt("return", errorMessageHandler(_context12.t0, "LENS"));
16859
16974
 
16860
- case 29:
16975
+ case 30:
16861
16976
  case "end":
16862
16977
  return _context12.stop();
16863
16978
  }
16864
- }), _callee12, null, [ [ 0, 26 ] ]);
16979
+ }), _callee12, null, [ [ 0, 27 ] ]);
16865
16980
  })));
16866
16981
  return _LENS.apply(this, arguments);
16867
16982
  }
@@ -16870,7 +16985,7 @@ function _typeof(o) {
16870
16985
  }
16871
16986
  function _FARCASTER() {
16872
16987
  _FARCASTER = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
16873
- var _argsToArray7, _argsToArray8, contentType, identifier, _argsToArray8$, start, _argsToArray8$2, end, apiKey, url, typeMap, response, _yield$response$json3, _data3, _args13 = arguments;
16988
+ var _argsToArray7, _argsToArray8, contentType, identifier, _argsToArray8$, start, _argsToArray8$2, end, apiKey, url, typeMap, _getUrlAndHeaders6, finalUrl, HEADERS, response, _yield$response$json3, _data3, _args13 = arguments;
16874
16989
  return _regeneratorRuntime().wrap((function _callee13$(_context13) {
16875
16990
  while (1) switch (_context13.prev = _context13.next) {
16876
16991
  case 0:
@@ -16905,35 +17020,41 @@ function _typeof(o) {
16905
17020
  url.searchParams.set("type", typeMap[contentType]);
16906
17021
  url.searchParams.set("start", String(start));
16907
17022
  url.searchParams.set("end", String(end));
16908
- _context13.next = 14;
16909
- return fetch(url.toString(), {
17023
+ _getUrlAndHeaders6 = getUrlAndHeaders({
17024
+ url: url.toString(),
17025
+ serviceName: "Firefly",
16910
17026
  headers: {
16911
17027
  "x-api-key": apiKey
16912
17028
  }
17029
+ }), finalUrl = _getUrlAndHeaders6.URL, HEADERS = _getUrlAndHeaders6.HEADERS;
17030
+ _context13.next = 15;
17031
+ return fetch(finalUrl, {
17032
+ method: "GET",
17033
+ headers: HEADERS
16913
17034
  });
16914
17035
 
16915
- case 14:
17036
+ case 15:
16916
17037
  response = _context13.sent;
16917
17038
  if (response.ok) {
16918
- _context13.next = 17;
17039
+ _context13.next = 18;
16919
17040
  break;
16920
17041
  }
16921
17042
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
16922
17043
 
16923
- case 17:
16924
- _context13.next = 19;
17044
+ case 18:
17045
+ _context13.next = 20;
16925
17046
  return response.json();
16926
17047
 
16927
- case 19:
17048
+ case 20:
16928
17049
  _yield$response$json3 = _context13.sent;
16929
17050
  _data3 = _yield$response$json3.data;
16930
17051
  if (Array.isArray(_data3)) {
16931
- _context13.next = 23;
17052
+ _context13.next = 24;
16932
17053
  break;
16933
17054
  }
16934
17055
  return _context13.abrupt("return", []);
16935
17056
 
16936
- case 23:
17057
+ case 24:
16937
17058
  return _context13.abrupt("return", _data3.map((function(item) {
16938
17059
  var flat = {};
16939
17060
  for (var _i12 = 0, _Object$entries3 = Object.entries(item); _i12 < _Object$entries3.length; _i12++) {
@@ -16946,16 +17067,16 @@ function _typeof(o) {
16946
17067
  return flat;
16947
17068
  })));
16948
17069
 
16949
- case 26:
16950
- _context13.prev = 26;
17070
+ case 27:
17071
+ _context13.prev = 27;
16951
17072
  _context13.t0 = _context13["catch"](0);
16952
17073
  return _context13.abrupt("return", errorMessageHandler(_context13.t0, "FARCASTER"));
16953
17074
 
16954
- case 29:
17075
+ case 30:
16955
17076
  case "end":
16956
17077
  return _context13.stop();
16957
17078
  }
16958
- }), _callee13, null, [ [ 0, 26 ] ]);
17079
+ }), _callee13, null, [ [ 0, 27 ] ]);
16959
17080
  })));
16960
17081
  return _FARCASTER.apply(this, arguments);
16961
17082
  }
@@ -17190,7 +17311,7 @@ function _typeof(o) {
17190
17311
  }
17191
17312
  function _NEYNAR() {
17192
17313
  _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
17193
- var neynarParamsSchema, _argsToArray13, _argsToArray14, username, apiKey, fid, url, response, json, users, _args17 = arguments;
17314
+ var neynarParamsSchema, _argsToArray13, _argsToArray14, username, apiKey, fid, url, _getUrlAndHeaders7, finalUrl, HEADERS, response, json, users, _args17 = arguments;
17194
17315
  return _regeneratorRuntime().wrap((function _callee17$(_context17) {
17195
17316
  while (1) switch (_context17.prev = _context17.next) {
17196
17317
  case 0:
@@ -17224,39 +17345,45 @@ function _typeof(o) {
17224
17345
 
17225
17346
  case 12:
17226
17347
  url = "https://api.neynar.com/v2/farcaster/followers?fid=".concat(fid);
17227
- _context17.next = 15;
17228
- return fetch(url, {
17348
+ _getUrlAndHeaders7 = getUrlAndHeaders({
17349
+ url: url.toString(),
17350
+ serviceName: "Firefly",
17229
17351
  headers: {
17230
17352
  "x-api-key": apiKey,
17231
17353
  "x-neynar-experimental": "false"
17232
17354
  }
17355
+ }), finalUrl = _getUrlAndHeaders7.URL, HEADERS = _getUrlAndHeaders7.HEADERS;
17356
+ _context17.next = 16;
17357
+ return fetch(finalUrl, {
17358
+ method: "GET",
17359
+ headers: HEADERS
17233
17360
  });
17234
17361
 
17235
- case 15:
17362
+ case 16:
17236
17363
  response = _context17.sent;
17237
17364
  if (response.ok) {
17238
- _context17.next = 18;
17365
+ _context17.next = 19;
17239
17366
  break;
17240
17367
  }
17241
17368
  throw new NetworkError(SERVICES_API_KEY.Neynar, response.status);
17242
17369
 
17243
- case 18:
17244
- _context17.next = 20;
17370
+ case 19:
17371
+ _context17.next = 21;
17245
17372
  return response.json();
17246
17373
 
17247
- case 20:
17374
+ case 21:
17248
17375
  json = _context17.sent;
17249
17376
  users = (json === null || json === void 0 ? void 0 : json.users) || [];
17250
17377
  if (users.length) {
17251
- _context17.next = 24;
17378
+ _context17.next = 25;
17252
17379
  break;
17253
17380
  }
17254
17381
  return _context17.abrupt("return", []);
17255
17382
 
17256
- case 24:
17257
- return _context17.abrupt("return", users.map((function(_ref13) {
17383
+ case 25:
17384
+ return _context17.abrupt("return", users.map((function(_ref14) {
17258
17385
  var _user$profile, _user$profile2;
17259
- var user = _ref13.user;
17386
+ var user = _ref14.user;
17260
17387
  return {
17261
17388
  username: user.username,
17262
17389
  custody_address: user.custody_address,
@@ -17266,16 +17393,16 @@ function _typeof(o) {
17266
17393
  };
17267
17394
  })));
17268
17395
 
17269
- case 27:
17270
- _context17.prev = 27;
17396
+ case 28:
17397
+ _context17.prev = 28;
17271
17398
  _context17.t0 = _context17["catch"](0);
17272
17399
  return _context17.abrupt("return", errorMessageHandler(_context17.t0, "NEYNAR"));
17273
17400
 
17274
- case 30:
17401
+ case 31:
17275
17402
  case "end":
17276
17403
  return _context17.stop();
17277
17404
  }
17278
- }), _callee17, null, [ [ 0, 27 ] ]);
17405
+ }), _callee17, null, [ [ 0, 28 ] ]);
17279
17406
  })));
17280
17407
  return _NEYNAR.apply(this, arguments);
17281
17408
  }
@@ -17494,58 +17621,68 @@ function _typeof(o) {
17494
17621
  return _regeneratorRuntime().wrap((function _callee21$(_context24) {
17495
17622
  while (1) switch (_context24.prev = _context24.next) {
17496
17623
  case 0:
17497
- _context24.prev = 0;
17624
+ console.log("EOA");
17625
+ _context24.prev = 1;
17498
17626
  fetchJSON = function() {
17499
- var _ref14 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20(url) {
17500
- var res, json;
17627
+ var _ref15 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20(url) {
17628
+ var _getUrlAndHeaders8, finalUrl, HEADERS, res, json;
17501
17629
  return _regeneratorRuntime().wrap((function _callee20$(_context20) {
17502
17630
  while (1) switch (_context20.prev = _context20.next) {
17503
17631
  case 0:
17504
- _context20.next = 2;
17505
- return fetch(url);
17632
+ _getUrlAndHeaders8 = getUrlAndHeaders({
17633
+ url: url,
17634
+ serviceName: "Etherscan",
17635
+ headers: {}
17636
+ }), finalUrl = _getUrlAndHeaders8.URL, HEADERS = _getUrlAndHeaders8.HEADERS;
17637
+ console.log("finalUrl", finalUrl, HEADERS);
17638
+ _context20.next = 4;
17639
+ return fetch(finalUrl, {
17640
+ method: "GET",
17641
+ headers: HEADERS
17642
+ });
17506
17643
 
17507
- case 2:
17644
+ case 4:
17508
17645
  res = _context20.sent;
17509
17646
  if (res.ok) {
17510
- _context20.next = 5;
17647
+ _context20.next = 7;
17511
17648
  break;
17512
17649
  }
17513
17650
  throw new NetworkError(SERVICES_API_KEY.Etherscan, res.status);
17514
17651
 
17515
- case 5:
17516
- _context20.next = 7;
17652
+ case 7:
17653
+ _context20.next = 9;
17517
17654
  return res.json();
17518
17655
 
17519
- case 7:
17656
+ case 9:
17520
17657
  json = _context20.sent;
17521
17658
  if (!(typeof json.result === "string")) {
17522
- _context20.next = 13;
17659
+ _context20.next = 15;
17523
17660
  break;
17524
17661
  }
17525
17662
  if (!json.result.includes("Invalid API Key")) {
17526
- _context20.next = 11;
17663
+ _context20.next = 13;
17527
17664
  break;
17528
17665
  }
17529
17666
  throw new InvalidApiKeyError(SERVICES_API_KEY.Etherscan);
17530
17667
 
17531
- case 11:
17668
+ case 13:
17532
17669
  if (!json.result.includes("Max rate limit reached")) {
17533
- _context20.next = 13;
17670
+ _context20.next = 15;
17534
17671
  break;
17535
17672
  }
17536
17673
  throw new RateLimitError(SERVICES_API_KEY.Etherscan);
17537
17674
 
17538
- case 13:
17675
+ case 15:
17539
17676
  return _context20.abrupt("return", json.result);
17540
17677
 
17541
- case 14:
17678
+ case 16:
17542
17679
  case "end":
17543
17680
  return _context20.stop();
17544
17681
  }
17545
17682
  }), _callee20);
17546
17683
  })));
17547
17684
  return function fetchJSON(_x17) {
17548
- return _ref14.apply(this, arguments);
17685
+ return _ref15.apply(this, arguments);
17549
17686
  };
17550
17687
  }();
17551
17688
  _argsToArray19 = argsToArray(_args24), _argsToArray20 = _slicedToArray(_argsToArray19, 7),
@@ -17563,13 +17700,14 @@ function _typeof(o) {
17563
17700
  offset: offset
17564
17701
  });
17565
17702
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Etherscan);
17703
+ console.log("apiKey", apiKey);
17566
17704
  if (apiKey) {
17567
- _context24.next = 7;
17705
+ _context24.next = 9;
17568
17706
  break;
17569
17707
  }
17570
17708
  throw new MissingApiKeyError(SERVICES_API_KEY.Etherscan);
17571
17709
 
17572
- case 7:
17710
+ case 9:
17573
17711
  INPUTS = addresses.split(",").map((function(s) {
17574
17712
  return s.trim();
17575
17713
  })).filter(Boolean);
@@ -17578,80 +17716,84 @@ function _typeof(o) {
17578
17716
  })).filter(Boolean);
17579
17717
  ADDRESS_MAP = {};
17580
17718
  _iterator41 = _createForOfIteratorHelper(INPUTS);
17581
- _context24.prev = 11;
17719
+ _context24.prev = 13;
17582
17720
  _iterator41.s();
17583
17721
 
17584
- case 13:
17722
+ case 15:
17585
17723
  if ((_step41 = _iterator41.n()).done) {
17586
- _context24.next = 28;
17724
+ _context24.next = 30;
17587
17725
  break;
17588
17726
  }
17589
17727
  inp = _step41.value;
17590
17728
  if (!isAddress$1.isAddress(inp)) {
17591
- _context24.next = 19;
17729
+ _context24.next = 21;
17592
17730
  break;
17593
17731
  }
17594
17732
  ADDRESS_MAP[inp.toLowerCase()] = null;
17595
- _context24.next = 26;
17733
+ _context24.next = 28;
17596
17734
  break;
17597
17735
 
17598
- case 19:
17736
+ case 21:
17599
17737
  ens = inp;
17600
- _context24.next = 22;
17738
+ _context24.next = 24;
17601
17739
  return fromEnsNameToAddress$1.fromEnsNameToAddress(ens);
17602
17740
 
17603
- case 22:
17741
+ case 24:
17604
17742
  resolved = _context24.sent;
17605
17743
  if (resolved) {
17606
- _context24.next = 25;
17744
+ _context24.next = 27;
17607
17745
  break;
17608
17746
  }
17609
17747
  throw new EnsError(ens);
17610
17748
 
17611
- case 25:
17749
+ case 27:
17612
17750
  ADDRESS_MAP[resolved.toLowerCase()] = ens;
17613
17751
 
17614
- case 26:
17615
- _context24.next = 13;
17616
- break;
17617
-
17618
17752
  case 28:
17619
- _context24.next = 33;
17753
+ _context24.next = 15;
17620
17754
  break;
17621
17755
 
17622
17756
  case 30:
17623
- _context24.prev = 30;
17624
- _context24.t0 = _context24["catch"](11);
17757
+ _context24.next = 35;
17758
+ break;
17759
+
17760
+ case 32:
17761
+ _context24.prev = 32;
17762
+ _context24.t0 = _context24["catch"](13);
17625
17763
  _iterator41.e(_context24.t0);
17626
17764
 
17627
- case 33:
17628
- _context24.prev = 33;
17765
+ case 35:
17766
+ _context24.prev = 35;
17629
17767
  _iterator41.f();
17630
- return _context24.finish(33);
17768
+ return _context24.finish(35);
17631
17769
 
17632
- case 36:
17770
+ case 38:
17633
17771
  ADDRS = Object.keys(ADDRESS_MAP);
17772
+ console.log("ADDRS", ADDRS);
17634
17773
  out = [];
17635
17774
  _iterator42 = _createForOfIteratorHelper(CHAINS);
17636
- _context24.prev = 39;
17775
+ _context24.prev = 42;
17637
17776
  _loop = _regeneratorRuntime().mark((function _loop() {
17638
17777
  var chain, chainId, _loop2, _ret2, i, sb, eb, _loop3, _ret3, _i16, _ADDRS;
17639
17778
  return _regeneratorRuntime().wrap((function _loop$(_context23) {
17640
17779
  while (1) switch (_context23.prev = _context23.next) {
17641
17780
  case 0:
17642
17781
  chain = _step42.value;
17782
+ console.log("chain", chain);
17643
17783
  chainId = CHAIN_ID_MAP[chain];
17644
17784
  if (chainId) {
17645
- _context23.next = 4;
17785
+ _context23.next = 5;
17646
17786
  break;
17647
17787
  }
17648
17788
  throw new ValidationError("Invalid chain: ".concat(chain));
17649
17789
 
17650
- case 4:
17790
+ case 5:
17791
+ console.log("chain", chain);
17651
17792
  if (!(category === "balance")) {
17652
- _context23.next = 17;
17793
+ _context23.next = 20;
17653
17794
  break;
17654
17795
  }
17796
+ console.log("balance");
17655
17797
  _loop2 = _regeneratorRuntime().mark((function _loop2(i) {
17656
17798
  var slice, url, data;
17657
17799
  return _regeneratorRuntime().wrap((function _loop2$(_context21) {
@@ -17691,55 +17833,57 @@ function _typeof(o) {
17691
17833
  }));
17692
17834
  i = 0;
17693
17835
 
17694
- case 7:
17836
+ case 10:
17695
17837
  if (!(i < ADDRS.length)) {
17696
- _context23.next = 15;
17838
+ _context23.next = 18;
17697
17839
  break;
17698
17840
  }
17699
- return _context23.delegateYield(_loop2(i), "t0", 9);
17841
+ return _context23.delegateYield(_loop2(i), "t0", 12);
17700
17842
 
17701
- case 9:
17843
+ case 12:
17702
17844
  _ret2 = _context23.t0;
17703
17845
  if (!_ret2) {
17704
- _context23.next = 12;
17846
+ _context23.next = 15;
17705
17847
  break;
17706
17848
  }
17707
17849
  return _context23.abrupt("return", _ret2.v);
17708
17850
 
17709
- case 12:
17851
+ case 15:
17710
17852
  i += 20;
17711
- _context23.next = 7;
17853
+ _context23.next = 10;
17712
17854
  break;
17713
17855
 
17714
- case 15:
17715
- _context23.next = 37;
17856
+ case 18:
17857
+ _context23.next = 42;
17716
17858
  break;
17717
17859
 
17718
- case 17:
17719
- _context23.next = 19;
17860
+ case 20:
17861
+ console.log("startTime", startTime, "endTime", endTime, chain, apiKey);
17862
+ _context23.next = 23;
17720
17863
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startTime), chain, apiKey);
17721
17864
 
17722
- case 19:
17865
+ case 23:
17723
17866
  sb = _context23.sent;
17724
- _context23.next = 22;
17867
+ _context23.next = 26;
17725
17868
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endTime), chain, apiKey);
17726
17869
 
17727
- case 22:
17870
+ case 26:
17728
17871
  eb = _context23.sent;
17872
+ console.log("sb", sb, "eb", eb);
17729
17873
  if (sb) {
17730
- _context23.next = 25;
17874
+ _context23.next = 30;
17731
17875
  break;
17732
17876
  }
17733
17877
  throw new ValidationError("Invalid startTime: ".concat(startTime));
17734
17878
 
17735
- case 25:
17879
+ case 30:
17736
17880
  if (eb) {
17737
- _context23.next = 27;
17881
+ _context23.next = 32;
17738
17882
  break;
17739
17883
  }
17740
17884
  throw new ValidationError("Invalid endTime: ".concat(endTime));
17741
17885
 
17742
- case 27:
17886
+ case 32:
17743
17887
  _loop3 = _regeneratorRuntime().mark((function _loop3() {
17744
17888
  var addr, url, data;
17745
17889
  return _regeneratorRuntime().wrap((function _loop3$(_context22) {
@@ -17779,27 +17923,27 @@ function _typeof(o) {
17779
17923
  }));
17780
17924
  _i16 = 0, _ADDRS = ADDRS;
17781
17925
 
17782
- case 29:
17926
+ case 34:
17783
17927
  if (!(_i16 < _ADDRS.length)) {
17784
- _context23.next = 37;
17928
+ _context23.next = 42;
17785
17929
  break;
17786
17930
  }
17787
- return _context23.delegateYield(_loop3(), "t1", 31);
17931
+ return _context23.delegateYield(_loop3(), "t1", 36);
17788
17932
 
17789
- case 31:
17933
+ case 36:
17790
17934
  _ret3 = _context23.t1;
17791
17935
  if (!_ret3) {
17792
- _context23.next = 34;
17936
+ _context23.next = 39;
17793
17937
  break;
17794
17938
  }
17795
17939
  return _context23.abrupt("return", _ret3.v);
17796
17940
 
17797
- case 34:
17941
+ case 39:
17798
17942
  _i16++;
17799
- _context23.next = 29;
17943
+ _context23.next = 34;
17800
17944
  break;
17801
17945
 
17802
- case 37:
17946
+ case 42:
17803
17947
  case "end":
17804
17948
  return _context23.stop();
17805
17949
  }
@@ -17807,52 +17951,52 @@ function _typeof(o) {
17807
17951
  }));
17808
17952
  _iterator42.s();
17809
17953
 
17810
- case 42:
17954
+ case 45:
17811
17955
  if ((_step42 = _iterator42.n()).done) {
17812
- _context24.next = 49;
17956
+ _context24.next = 52;
17813
17957
  break;
17814
17958
  }
17815
- return _context24.delegateYield(_loop(), "t1", 44);
17959
+ return _context24.delegateYield(_loop(), "t1", 47);
17816
17960
 
17817
- case 44:
17961
+ case 47:
17818
17962
  _ret = _context24.t1;
17819
17963
  if (!_ret) {
17820
- _context24.next = 47;
17964
+ _context24.next = 50;
17821
17965
  break;
17822
17966
  }
17823
17967
  return _context24.abrupt("return", _ret.v);
17824
17968
 
17825
- case 47:
17826
- _context24.next = 42;
17969
+ case 50:
17970
+ _context24.next = 45;
17827
17971
  break;
17828
17972
 
17829
- case 49:
17830
- _context24.next = 54;
17973
+ case 52:
17974
+ _context24.next = 57;
17831
17975
  break;
17832
17976
 
17833
- case 51:
17834
- _context24.prev = 51;
17835
- _context24.t2 = _context24["catch"](39);
17836
- _iterator42.e(_context24.t2);
17837
-
17838
17977
  case 54:
17839
17978
  _context24.prev = 54;
17840
- _iterator42.f();
17841
- return _context24.finish(54);
17979
+ _context24.t2 = _context24["catch"](42);
17980
+ _iterator42.e(_context24.t2);
17842
17981
 
17843
17982
  case 57:
17844
- return _context24.abrupt("return", out);
17983
+ _context24.prev = 57;
17984
+ _iterator42.f();
17985
+ return _context24.finish(57);
17845
17986
 
17846
17987
  case 60:
17847
- _context24.prev = 60;
17848
- _context24.t3 = _context24["catch"](0);
17849
- return _context24.abrupt("return", errorMessageHandler(_context24.t3, "EOA"));
17988
+ return _context24.abrupt("return", out);
17850
17989
 
17851
17990
  case 63:
17991
+ _context24.prev = 63;
17992
+ _context24.t3 = _context24["catch"](1);
17993
+ return _context24.abrupt("return", errorMessageHandler(_context24.t3, "EOA"));
17994
+
17995
+ case 66:
17852
17996
  case "end":
17853
17997
  return _context24.stop();
17854
17998
  }
17855
- }), _callee21, null, [ [ 0, 60 ], [ 11, 30, 33, 36 ], [ 39, 51, 54, 57 ] ]);
17999
+ }), _callee21, null, [ [ 1, 63 ], [ 13, 32, 35, 38 ], [ 42, 54, 57, 60 ] ]);
17856
18000
  })));
17857
18001
  return _EOA.apply(this, arguments);
17858
18002
  }
@@ -17885,7 +18029,7 @@ function _typeof(o) {
17885
18029
  }
17886
18030
  function _SAFE() {
17887
18031
  _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee23() {
17888
- var _argsToArray21, _argsToArray22, address, utility, chain, _argsToArray22$, limit, _argsToArray22$2, offset, apiKey, chainId, resolved, ens, url, res, json, _args26 = arguments;
18032
+ var _argsToArray21, _argsToArray22, address, utility, chain, _argsToArray22$, limit, _argsToArray22$2, offset, apiKey, chainId, resolved, ens, url, _getUrlAndHeaders9, finalUrl, HEADERS, res, json, _args26 = arguments;
17889
18033
  return _regeneratorRuntime().wrap((function _callee23$(_context26) {
17890
18034
  while (1) switch (_context26.prev = _context26.next) {
17891
18035
  case 0:
@@ -17936,49 +18080,54 @@ function _typeof(o) {
17936
18080
 
17937
18081
  case 17:
17938
18082
  url = "https://api.safe.global/tx-service/".concat(chainId, "/api/v2/safes/").concat(resolved, "/multisig-transactions?limit=").concat(limit, "&offset=").concat(offset);
17939
- _context26.next = 20;
17940
- return fetch(url, {
18083
+ _getUrlAndHeaders9 = getUrlAndHeaders({
18084
+ url: url,
18085
+ serviceName: "Etherscan",
17941
18086
  headers: {
17942
18087
  Authorization: "Bearer ".concat(apiKey)
17943
18088
  }
18089
+ }), finalUrl = _getUrlAndHeaders9.URL, HEADERS = _getUrlAndHeaders9.HEADERS;
18090
+ _context26.next = 21;
18091
+ return fetch(finalUrl, {
18092
+ headers: HEADERS
17944
18093
  });
17945
18094
 
17946
- case 20:
18095
+ case 21:
17947
18096
  res = _context26.sent;
17948
18097
  if (res.ok) {
17949
- _context26.next = 23;
18098
+ _context26.next = 24;
17950
18099
  break;
17951
18100
  }
17952
18101
  throw new NetworkError(SERVICES_API_KEY.Safe, res.status);
17953
18102
 
17954
- case 23:
17955
- _context26.next = 25;
18103
+ case 24:
18104
+ _context26.next = 26;
17956
18105
  return res.json();
17957
18106
 
17958
- case 25:
18107
+ case 26:
17959
18108
  json = _context26.sent;
17960
18109
  if (Array.isArray(json.results)) {
17961
- _context26.next = 28;
18110
+ _context26.next = 29;
17962
18111
  break;
17963
18112
  }
17964
18113
  throw new ValidationError("Invalid API response");
17965
18114
 
17966
- case 28:
17967
- return _context26.abrupt("return", json.results.map((function(_ref15) {
17968
- var confirmations = _ref15.confirmations, dataDecoded = _ref15.dataDecoded, rest = _objectWithoutProperties(_ref15, _excluded);
18115
+ case 29:
18116
+ return _context26.abrupt("return", json.results.map((function(_ref16) {
18117
+ var confirmations = _ref16.confirmations, dataDecoded = _ref16.dataDecoded, rest = _objectWithoutProperties(_ref16, _excluded);
17969
18118
  return rest;
17970
18119
  })));
17971
18120
 
17972
- case 31:
17973
- _context26.prev = 31;
18121
+ case 32:
18122
+ _context26.prev = 32;
17974
18123
  _context26.t0 = _context26["catch"](0);
17975
18124
  return _context26.abrupt("return", errorMessageHandler(_context26.t0, "SAFE"));
17976
18125
 
17977
- case 34:
18126
+ case 35:
17978
18127
  case "end":
17979
18128
  return _context26.stop();
17980
18129
  }
17981
- }), _callee23, null, [ [ 0, 31 ] ]);
18130
+ }), _callee23, null, [ [ 0, 32 ] ]);
17982
18131
  })));
17983
18132
  return _SAFE.apply(this, arguments);
17984
18133
  }
@@ -18113,8 +18262,8 @@ function _typeof(o) {
18113
18262
  }
18114
18263
  return _context28.abrupt("return", json.map((function(item) {
18115
18264
  var flat = {};
18116
- Object.entries(item).forEach((function(_ref16) {
18117
- var _ref17 = _slicedToArray(_ref16, 2), k = _ref17[0], v = _ref17[1];
18265
+ Object.entries(item).forEach((function(_ref17) {
18266
+ var _ref18 = _slicedToArray(_ref17, 2), k = _ref18[0], v = _ref18[1];
18118
18267
  if (v === null || _typeof(v) !== "object") flat[k] = v;
18119
18268
  }));
18120
18269
  return flat;
@@ -18180,8 +18329,8 @@ function _typeof(o) {
18180
18329
  }
18181
18330
  return _context29.abrupt("return", json.map((function(item) {
18182
18331
  var flat = {};
18183
- Object.entries(item).forEach((function(_ref18) {
18184
- var _ref19 = _slicedToArray(_ref18, 2), k = _ref19[0], v = _ref19[1];
18332
+ Object.entries(item).forEach((function(_ref19) {
18333
+ var _ref20 = _slicedToArray(_ref19, 2), k = _ref20[0], v = _ref20[1];
18185
18334
  if (v === null || _typeof(v) !== "object") flat[k] = v;
18186
18335
  }));
18187
18336
  return flat;