@fileverse-dev/formulajs 4.4.11-mod-76 → 4.4.11-mod-77

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-76 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-77 */
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) {
@@ -67,6 +99,128 @@ function _createForOfIteratorHelper(r, e) {
67
99
  };
68
100
  }
69
101
 
102
+ function _defineProperties(e, r) {
103
+ for (var t = 0; t < r.length; t++) {
104
+ var o = r[t];
105
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),
106
+ Object.defineProperty(e, _toPropertyKey(o.key), o);
107
+ }
108
+ }
109
+
110
+ function _createClass(e, r, t) {
111
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
112
+ writable: !1
113
+ }), e;
114
+ }
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
+
132
+ function _classCallCheck(a, n) {
133
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
134
+ }
135
+
136
+ function _callSuper(t, o, e) {
137
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
138
+ }
139
+
140
+ function _possibleConstructorReturn(t, e) {
141
+ if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
142
+ if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
143
+ return _assertThisInitialized(t);
144
+ }
145
+
146
+ function _assertThisInitialized(e) {
147
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
148
+ return e;
149
+ }
150
+
151
+ function _inherits(t, e) {
152
+ if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
153
+ t.prototype = Object.create(e && e.prototype, {
154
+ constructor: {
155
+ value: t,
156
+ writable: !0,
157
+ configurable: !0
158
+ }
159
+ }), Object.defineProperty(t, "prototype", {
160
+ writable: !1
161
+ }), e && _setPrototypeOf(t, e);
162
+ }
163
+
164
+ function _wrapNativeSuper(t) {
165
+ var r = "function" == typeof Map ? new Map : void 0;
166
+ return _wrapNativeSuper = function _wrapNativeSuper(t) {
167
+ if (null === t || !_isNativeFunction(t)) return t;
168
+ if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
169
+ if (void 0 !== r) {
170
+ if (r.has(t)) return r.get(t);
171
+ r.set(t, Wrapper);
172
+ }
173
+ function Wrapper() {
174
+ return _construct(t, arguments, _getPrototypeOf(this).constructor);
175
+ }
176
+ return Wrapper.prototype = Object.create(t.prototype, {
177
+ constructor: {
178
+ value: Wrapper,
179
+ enumerable: !1,
180
+ writable: !0,
181
+ configurable: !0
182
+ }
183
+ }), _setPrototypeOf(Wrapper, t);
184
+ }, _wrapNativeSuper(t);
185
+ }
186
+
187
+ function _construct(t, e, r) {
188
+ if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
189
+ var o = [ null ];
190
+ o.push.apply(o, e);
191
+ var p = new (t.bind.apply(t, o));
192
+ return r && _setPrototypeOf(p, r.prototype), p;
193
+ }
194
+
195
+ function _isNativeReflectConstruct() {
196
+ try {
197
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
198
+ } catch (t) {}
199
+ return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
200
+ return !!t;
201
+ })();
202
+ }
203
+
204
+ function _isNativeFunction(t) {
205
+ try {
206
+ return -1 !== Function.toString.call(t).indexOf("[native code]");
207
+ } catch (n) {
208
+ return "function" == typeof t;
209
+ }
210
+ }
211
+
212
+ function _setPrototypeOf(t, e) {
213
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
214
+ return t.__proto__ = e, t;
215
+ }, _setPrototypeOf(t, e);
216
+ }
217
+
218
+ function _getPrototypeOf(t) {
219
+ return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
220
+ return t.__proto__ || Object.getPrototypeOf(t);
221
+ }, _getPrototypeOf(t);
222
+ }
223
+
70
224
  function _regeneratorRuntime() {
71
225
  "use strict";
72
226
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() {
@@ -357,160 +511,6 @@ function _asyncToGenerator(n) {
357
511
  };
358
512
  }
359
513
 
360
- function ownKeys(e, r) {
361
- var t = Object.keys(e);
362
- if (Object.getOwnPropertySymbols) {
363
- var o = Object.getOwnPropertySymbols(e);
364
- r && (o = o.filter((function(r) {
365
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
366
- }))), t.push.apply(t, o);
367
- }
368
- return t;
369
- }
370
-
371
- function _objectSpread(e) {
372
- for (var r = 1; r < arguments.length; r++) {
373
- var t = null != arguments[r] ? arguments[r] : {};
374
- r % 2 ? ownKeys(Object(t), !0).forEach((function(r) {
375
- _defineProperty(e, r, t[r]);
376
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach((function(r) {
377
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
378
- }));
379
- }
380
- return e;
381
- }
382
-
383
- function _defineProperty(e, r, t) {
384
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
385
- value: t,
386
- enumerable: !0,
387
- configurable: !0,
388
- writable: !0
389
- }) : e[r] = t, e;
390
- }
391
-
392
- function _defineProperties(e, r) {
393
- for (var t = 0; t < r.length; t++) {
394
- var o = r[t];
395
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),
396
- Object.defineProperty(e, _toPropertyKey(o.key), o);
397
- }
398
- }
399
-
400
- function _createClass(e, r, t) {
401
- return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
402
- writable: !1
403
- }), e;
404
- }
405
-
406
- function _toPropertyKey(t) {
407
- var i = _toPrimitive(t, "string");
408
- return "symbol" == _typeof(i) ? i : i + "";
409
- }
410
-
411
- function _toPrimitive(t, r) {
412
- if ("object" != _typeof(t) || !t) return t;
413
- var e = t[Symbol.toPrimitive];
414
- if (void 0 !== e) {
415
- var i = e.call(t, r || "default");
416
- if ("object" != _typeof(i)) return i;
417
- throw new TypeError("@@toPrimitive must return a primitive value.");
418
- }
419
- return ("string" === r ? String : Number)(t);
420
- }
421
-
422
- function _classCallCheck(a, n) {
423
- if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
424
- }
425
-
426
- function _callSuper(t, o, e) {
427
- return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
428
- }
429
-
430
- function _possibleConstructorReturn(t, e) {
431
- if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
432
- if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
433
- return _assertThisInitialized(t);
434
- }
435
-
436
- function _assertThisInitialized(e) {
437
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
438
- return e;
439
- }
440
-
441
- function _inherits(t, e) {
442
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
443
- t.prototype = Object.create(e && e.prototype, {
444
- constructor: {
445
- value: t,
446
- writable: !0,
447
- configurable: !0
448
- }
449
- }), Object.defineProperty(t, "prototype", {
450
- writable: !1
451
- }), e && _setPrototypeOf(t, e);
452
- }
453
-
454
- function _wrapNativeSuper(t) {
455
- var r = "function" == typeof Map ? new Map : void 0;
456
- return _wrapNativeSuper = function _wrapNativeSuper(t) {
457
- if (null === t || !_isNativeFunction(t)) return t;
458
- if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
459
- if (void 0 !== r) {
460
- if (r.has(t)) return r.get(t);
461
- r.set(t, Wrapper);
462
- }
463
- function Wrapper() {
464
- return _construct(t, arguments, _getPrototypeOf(this).constructor);
465
- }
466
- return Wrapper.prototype = Object.create(t.prototype, {
467
- constructor: {
468
- value: Wrapper,
469
- enumerable: !1,
470
- writable: !0,
471
- configurable: !0
472
- }
473
- }), _setPrototypeOf(Wrapper, t);
474
- }, _wrapNativeSuper(t);
475
- }
476
-
477
- function _construct(t, e, r) {
478
- if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
479
- var o = [ null ];
480
- o.push.apply(o, e);
481
- var p = new (t.bind.apply(t, o));
482
- return r && _setPrototypeOf(p, r.prototype), p;
483
- }
484
-
485
- function _isNativeReflectConstruct() {
486
- try {
487
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
488
- } catch (t) {}
489
- return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
490
- return !!t;
491
- })();
492
- }
493
-
494
- function _isNativeFunction(t) {
495
- try {
496
- return -1 !== Function.toString.call(t).indexOf("[native code]");
497
- } catch (n) {
498
- return "function" == typeof t;
499
- }
500
- }
501
-
502
- function _setPrototypeOf(t, e) {
503
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
504
- return t.__proto__ = e, t;
505
- }, _setPrototypeOf(t, e);
506
- }
507
-
508
- function _getPrototypeOf(t) {
509
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
510
- return t.__proto__ || Object.getPrototypeOf(t);
511
- }, _getPrototypeOf(t);
512
- }
513
-
514
514
  function _slicedToArray(r, e) {
515
515
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
516
516
  }
@@ -11068,6 +11068,51 @@ function _typeof(o) {
11068
11068
  Neynar: "Neynar",
11069
11069
  Defillama: "Defillama"
11070
11070
  };
11071
+ var fromTimeStampToBlock = function() {
11072
+ var _ref = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(timestamp, chain, apiKey) {
11073
+ var chainId, url, res, json;
11074
+ return _regeneratorRuntime().wrap((function _callee$(_context) {
11075
+ while (1) switch (_context.prev = _context.next) {
11076
+ case 0:
11077
+ if (!(!timestamp || !chain || !apiKey)) {
11078
+ _context.next = 2;
11079
+ break;
11080
+ }
11081
+ return _context.abrupt("return");
11082
+
11083
+ case 2:
11084
+ chainId = CHAIN_ID_MAP[chain];
11085
+ 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);
11088
+
11089
+ case 6:
11090
+ res = _context.sent;
11091
+ _context.next = 9;
11092
+ return res.json();
11093
+
11094
+ case 9:
11095
+ json = _context.sent;
11096
+ return _context.abrupt("return", parseInt(json.result));
11097
+
11098
+ case 11:
11099
+ case "end":
11100
+ return _context.stop();
11101
+ }
11102
+ }), _callee);
11103
+ })));
11104
+ return function fromTimeStampToBlock(_x2, _x3, _x4) {
11105
+ return _ref.apply(this, arguments);
11106
+ };
11107
+ }();
11108
+ var fromTimestampToBlock = {
11109
+ fromTimeStampToBlock: fromTimeStampToBlock
11110
+ };
11111
+ function toTimestamp(dateStr) {
11112
+ var _dateStr$split$map = dateStr.split("/").map(Number), _dateStr$split$map2 = _slicedToArray(_dateStr$split$map, 3), day = _dateStr$split$map2[0], month = _dateStr$split$map2[1], year = _dateStr$split$map2[2];
11113
+ var date = new Date(year, month - 1, day);
11114
+ return Math.floor(date.getTime() / 1e3);
11115
+ }
11071
11116
  var ValidationError = function(_Error) {
11072
11117
  function ValidationError(message) {
11073
11118
  _classCallCheck(this, ValidationError);
@@ -11114,147 +11159,18 @@ function _typeof(o) {
11114
11159
  }
11115
11160
  _inherits(EnsError, _Error5);
11116
11161
  return _createClass(EnsError);
11117
- }(_wrapNativeSuper(Error));
11118
- var InvalidApiKeyError = function(_Error6) {
11119
- function InvalidApiKeyError(apiKeyName) {
11120
- var _this3;
11121
- _classCallCheck(this, InvalidApiKeyError);
11122
- _this3 = _callSuper(this, InvalidApiKeyError, [ "Api key is invalid for ".concat(apiKeyName) ]);
11123
- _this3.api = apiKeyName;
11124
- return _this3;
11125
- }
11126
- _inherits(InvalidApiKeyError, _Error6);
11127
- return _createClass(InvalidApiKeyError);
11128
- }(_wrapNativeSuper(Error));
11129
- var stagingFileverseProxyUrl = "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy";
11130
- var productionFileverseProxyUrl = "".concat(process.env.NEXT_PUBLIC_PROXY_BASE_URL, "/proxy");
11131
- var PROXY_MAP = {
11132
- Etherscan: {
11133
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11134
- removeParams: [ "apikey" ]
11135
- },
11136
- Basescan: {
11137
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11138
- removeParams: [ "apikey" ]
11139
- },
11140
- Gnosisscan: {
11141
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11142
- removeParams: [ "apikey" ]
11143
- },
11144
- Coingecko: {
11145
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11146
- removeParams: [ "apikey" ]
11147
- },
11148
- Firefly: {
11149
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11150
- removeParams: [ "apikey" ]
11151
- },
11152
- Neynar: {
11153
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11154
- removeParams: [ "api_key" ]
11155
- },
11156
- Safe: {
11157
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11158
- removeParams: [ "api_key" ]
11159
- },
11160
- Defillama: {
11161
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11162
- removeParams: [ "api_key" ]
11163
- },
11164
- GnosisPay: {
11165
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11166
- removeParams: [ "api_key" ]
11167
- }
11168
- };
11169
- function removeUrlParams(url, paramsToRemove) {
11170
- if (!paramsToRemove || paramsToRemove.length === 0) {
11171
- return url;
11172
- }
11173
- var urlObj = new URL(url);
11174
- paramsToRemove.forEach((function(param) {
11175
- if (urlObj.searchParams.has(param)) {
11176
- urlObj.searchParams["delete"](param);
11177
- }
11178
- }));
11179
- return urlObj.toString();
11180
- }
11181
- function getUrlAndHeaders(_ref) {
11182
- var url = _ref.url, serviceName = _ref.serviceName, _ref$headers = _ref.headers, headers = _ref$headers === void 0 ? {} : _ref$headers;
11183
- var apiKeyLS = window.localStorage.getItem(SERVICES_API_KEY[serviceName]);
11184
- var isProxyModeEnabledValue = apiKeyLS === "DEFAULT_PROXY_MODE";
11185
- var proxyConfig = PROXY_MAP[serviceName];
11186
- if (!proxyConfig && SERVICES_API_KEY[serviceName] && (!apiKeyLS || apiKeyLS === "")) {
11187
- throw new MissingApiKeyError(SERVICES_API_KEY[serviceName]);
11188
- }
11189
- if ((isProxyModeEnabledValue || !apiKeyLS || apiKeyLS === "") && proxyConfig) {
11190
- var cleanedUrl = removeUrlParams(url, proxyConfig.removeParams);
11191
- return {
11192
- URL: proxyConfig.url,
11193
- HEADERS: {
11194
- "target-url": cleanedUrl,
11195
- method: "GET",
11196
- "Content-Type": "application/json"
11197
- }
11198
- };
11199
- }
11200
- return {
11201
- URL: url,
11202
- HEADERS: _objectSpread({}, headers)
11203
- };
11204
- }
11205
- var fromTimeStampToBlock = function() {
11206
- var _ref2 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(timestamp, chain, apiKey) {
11207
- var chainId, url, _getUrlAndHeaders, finalUrl, HEADERS, res, json;
11208
- return _regeneratorRuntime().wrap((function _callee$(_context) {
11209
- while (1) switch (_context.prev = _context.next) {
11210
- case 0:
11211
- if (!(!timestamp || !chain)) {
11212
- _context.next = 2;
11213
- break;
11214
- }
11215
- return _context.abrupt("return");
11216
-
11217
- case 2:
11218
- chainId = CHAIN_ID_MAP[chain];
11219
- url = "https://api.etherscan.io/v2/api?module=block&action=getblocknobytime&timestamp=".concat(timestamp, "&closest=before&apikey=").concat(apiKey, "&chainId=").concat(chainId);
11220
- _getUrlAndHeaders = getUrlAndHeaders({
11221
- url: url,
11222
- serviceName: "Etherscan",
11223
- headers: {}
11224
- }), finalUrl = _getUrlAndHeaders.URL, HEADERS = _getUrlAndHeaders.HEADERS;
11225
- _context.next = 7;
11226
- return fetch(finalUrl, {
11227
- method: "GET",
11228
- headers: HEADERS
11229
- });
11230
-
11231
- case 7:
11232
- res = _context.sent;
11233
- _context.next = 10;
11234
- return res.json();
11235
-
11236
- case 10:
11237
- json = _context.sent;
11238
- return _context.abrupt("return", parseInt(json.result));
11239
-
11240
- case 12:
11241
- case "end":
11242
- return _context.stop();
11243
- }
11244
- }), _callee);
11245
- })));
11246
- return function fromTimeStampToBlock(_x2, _x3, _x4) {
11247
- return _ref2.apply(this, arguments);
11248
- };
11249
- }();
11250
- var fromTimestampToBlock = {
11251
- fromTimeStampToBlock: fromTimeStampToBlock
11252
- };
11253
- function toTimestamp(dateStr) {
11254
- var _dateStr$split$map = dateStr.split("/").map(Number), _dateStr$split$map2 = _slicedToArray(_dateStr$split$map, 3), day = _dateStr$split$map2[0], month = _dateStr$split$map2[1], year = _dateStr$split$map2[2];
11255
- var date = new Date(year, month - 1, day);
11256
- return Math.floor(date.getTime() / 1e3);
11257
- }
11162
+ }(_wrapNativeSuper(Error));
11163
+ var InvalidApiKeyError = function(_Error6) {
11164
+ function InvalidApiKeyError(apiKeyName) {
11165
+ var _this3;
11166
+ _classCallCheck(this, InvalidApiKeyError);
11167
+ _this3 = _callSuper(this, InvalidApiKeyError, [ "Api key is invalid for ".concat(apiKeyName) ]);
11168
+ _this3.api = apiKeyName;
11169
+ return _this3;
11170
+ }
11171
+ _inherits(InvalidApiKeyError, _Error6);
11172
+ return _createClass(InvalidApiKeyError);
11173
+ }(_wrapNativeSuper(Error));
11258
11174
  var isAddress = function isAddress(input) {
11259
11175
  return /^0x[a-fA-F0-9]{40}$/.test(input);
11260
11176
  };
@@ -11265,16 +11181,16 @@ function _typeof(o) {
11265
11181
  return _fromEnsNameToAddress.apply(this, arguments);
11266
11182
  }
11267
11183
  function _fromEnsNameToAddress() {
11268
- _fromEnsNameToAddress = _asyncToGenerator(_regeneratorRuntime().mark((function _callee1(name) {
11184
+ _fromEnsNameToAddress = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(name) {
11269
11185
  var ALCHEMY_KEY, provider, resolved;
11270
- return _regeneratorRuntime().wrap((function _callee1$(_context1) {
11271
- while (1) switch (_context1.prev = _context1.next) {
11186
+ return _regeneratorRuntime().wrap((function _callee10$(_context10) {
11187
+ while (1) switch (_context10.prev = _context10.next) {
11272
11188
  case 0:
11273
11189
  if (!(typeof ethers === "undefined")) {
11274
- _context1.next = 3;
11190
+ _context10.next = 3;
11275
11191
  break;
11276
11192
  }
11277
- _context1.next = 3;
11193
+ _context10.next = 3;
11278
11194
  return new Promise((function(resolve, reject) {
11279
11195
  var script = document.createElement("script");
11280
11196
  script.src = "https://cdn.jsdelivr.net/npm/ethers@6.10.0/dist/ethers.umd.min.js";
@@ -11286,47 +11202,84 @@ function _typeof(o) {
11286
11202
  case 3:
11287
11203
  ALCHEMY_KEY = window.localStorage.getItem(UTILITY.ALCHEMY_API_KEY);
11288
11204
  if (ALCHEMY_KEY) {
11289
- _context1.next = 7;
11205
+ _context10.next = 7;
11290
11206
  break;
11291
11207
  }
11292
11208
  console.error("alchemy api key missing");
11293
- return _context1.abrupt("return", null);
11209
+ return _context10.abrupt("return", null);
11294
11210
 
11295
11211
  case 7:
11296
11212
  provider = new ethers.AlchemyProvider("mainnet", ALCHEMY_KEY);
11297
- _context1.prev = 8;
11298
- _context1.next = 11;
11213
+ _context10.prev = 8;
11214
+ _context10.next = 11;
11299
11215
  return provider.resolveName(name);
11300
11216
 
11301
11217
  case 11:
11302
- resolved = _context1.sent;
11303
- return _context1.abrupt("return", resolved || null);
11218
+ resolved = _context10.sent;
11219
+ return _context10.abrupt("return", resolved || null);
11304
11220
 
11305
11221
  case 15:
11306
- _context1.prev = 15;
11307
- _context1.t0 = _context1["catch"](8);
11308
- console.error("ENS resolution failed:", _context1.t0.message);
11309
- return _context1.abrupt("return", null);
11222
+ _context10.prev = 15;
11223
+ _context10.t0 = _context10["catch"](8);
11224
+ console.error("ENS resolution failed:", _context10.t0.message);
11225
+ return _context10.abrupt("return", null);
11310
11226
 
11311
11227
  case 19:
11312
11228
  case "end":
11313
- return _context1.stop();
11229
+ return _context10.stop();
11314
11230
  }
11315
- }), _callee1, null, [ [ 8, 15 ] ]);
11231
+ }), _callee10, null, [ [ 8, 15 ] ]);
11316
11232
  })));
11317
11233
  return _fromEnsNameToAddress.apply(this, arguments);
11318
11234
  }
11235
+ var validateAndGetAddress = function() {
11236
+ var _ref2 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(address) {
11237
+ var resolvedAddress;
11238
+ return _regeneratorRuntime().wrap((function _callee2$(_context2) {
11239
+ while (1) switch (_context2.prev = _context2.next) {
11240
+ case 0:
11241
+ if (!isAddress$1.isAddress(address)) {
11242
+ _context2.next = 2;
11243
+ break;
11244
+ }
11245
+ return _context2.abrupt("return", address);
11246
+
11247
+ case 2:
11248
+ _context2.next = 4;
11249
+ return fromEnsNameToAddress(address);
11250
+
11251
+ case 4:
11252
+ resolvedAddress = _context2.sent;
11253
+ if (!resolvedAddress) {
11254
+ _context2.next = 7;
11255
+ break;
11256
+ }
11257
+ return _context2.abrupt("return", resolvedAddress);
11258
+
11259
+ case 7:
11260
+ throw new ValidationError("Invalid address");
11261
+
11262
+ case 8:
11263
+ case "end":
11264
+ return _context2.stop();
11265
+ }
11266
+ }), _callee2);
11267
+ })));
11268
+ return function validateAndGetAddress(_x6) {
11269
+ return _ref2.apply(this, arguments);
11270
+ };
11271
+ }();
11319
11272
  var fromEnsNameToAddress$1 = {
11320
- fromEnsNameToAddress: fromEnsNameToAddress
11273
+ validateAndGetAddress: validateAndGetAddress
11321
11274
  };
11322
- function handleScanRequest(_x6) {
11275
+ function handleScanRequest(_x7) {
11323
11276
  return _handleScanRequest.apply(this, arguments);
11324
11277
  }
11325
11278
  function _handleScanRequest() {
11326
- _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(_ref3) {
11327
- 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;
11328
- return _regeneratorRuntime().wrap((function _callee10$(_context10) {
11329
- while (1) switch (_context10.prev = _context10.next) {
11279
+ _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11(_ref3) {
11280
+ var type, address, startDate, endDate, _ref3$page, page, _ref3$offset, offset, apiKey, functionName, chainId, network, API_INFO_MAP, apiInfo, baseUrl, ACTION_MAP, action, module, url, _yield$Promise$all, _yield$Promise$all2, startBlock, endBlock, res, json;
11281
+ return _regeneratorRuntime().wrap((function _callee11$(_context11) {
11282
+ while (1) switch (_context11.prev = _context11.next) {
11330
11283
  case 0:
11331
11284
  type = _ref3.type, address = _ref3.address, startDate = _ref3.startDate, endDate = _ref3.endDate,
11332
11285
  _ref3$page = _ref3.page, page = _ref3$page === void 0 ? 1 : _ref3$page, _ref3$offset = _ref3.offset,
@@ -11346,32 +11299,26 @@ function _typeof(o) {
11346
11299
  apiKeyName: SERVICES_API_KEY.Gnosisscan
11347
11300
  }
11348
11301
  };
11349
- if (!(!isAddress$1.isAddress(address) && type !== "gas")) {
11350
- _context10.next = 9;
11302
+ if (!(type !== "gas")) {
11303
+ _context11.next = 6;
11351
11304
  break;
11352
11305
  }
11353
- ensName = address;
11354
- _context10.next = 6;
11355
- return fromEnsNameToAddress$1.fromEnsNameToAddress(address);
11306
+ _context11.next = 5;
11307
+ return fromEnsNameToAddress$1.validateAndGetAddress(address);
11356
11308
 
11357
- case 6:
11358
- address = _context10.sent;
11359
- if (address) {
11360
- _context10.next = 9;
11361
- break;
11362
- }
11363
- throw new EnsError(ensName);
11309
+ case 5:
11310
+ address = _context11.sent;
11364
11311
 
11365
- case 9:
11312
+ case 6:
11366
11313
  apiInfo = API_INFO_MAP[functionName];
11367
11314
  baseUrl = apiInfo === null || apiInfo === void 0 ? void 0 : apiInfo.url;
11368
11315
  if (baseUrl) {
11369
- _context10.next = 13;
11316
+ _context11.next = 10;
11370
11317
  break;
11371
11318
  }
11372
11319
  throw new ValidationError("Api not found for: ".concat(functionName));
11373
11320
 
11374
- case 13:
11321
+ case 10:
11375
11322
  ACTION_MAP = {
11376
11323
  "all-txns": "txlist",
11377
11324
  "token-txns": "tokentx",
@@ -11380,138 +11327,124 @@ function _typeof(o) {
11380
11327
  };
11381
11328
  action = ACTION_MAP[type];
11382
11329
  if (action) {
11383
- _context10.next = 17;
11330
+ _context11.next = 14;
11384
11331
  break;
11385
11332
  }
11386
11333
  throw new ValidationError("Invalid type: ".concat(type));
11387
11334
 
11388
- case 17:
11335
+ case 14:
11389
11336
  module = action === "gasoracle" ? "gastracker" : "account";
11390
11337
  url = "".concat(baseUrl, "?chainid=").concat(chainId, "&module=").concat(module, "&action=").concat(action, "&apikey=").concat(apiKey);
11391
11338
  if (![ "all-txns", "token-txns", "nft-txns" ].includes(type)) {
11392
- _context10.next = 30;
11339
+ _context11.next = 27;
11393
11340
  break;
11394
11341
  }
11395
11342
  url += "&address=".concat(address, "&startblock=0&endblock=99999999&sort=asc");
11396
11343
  if (!(!isNaN(startDate) && !isNaN(endDate))) {
11397
- _context10.next = 29;
11344
+ _context11.next = 26;
11398
11345
  break;
11399
11346
  }
11400
- _context10.next = 24;
11347
+ _context11.next = 21;
11401
11348
  return Promise.all([ fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startDate), network, apiKey), fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endDate), network, apiKey) ]);
11402
11349
 
11403
- case 24:
11404
- _yield$Promise$all = _context10.sent;
11350
+ case 21:
11351
+ _yield$Promise$all = _context11.sent;
11405
11352
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
11406
11353
  startBlock = _yield$Promise$all2[0];
11407
11354
  endBlock = _yield$Promise$all2[1];
11408
11355
  url += "&startblock=".concat(startBlock || "0", "&endblock=").concat(endBlock || "99999999");
11409
11356
 
11410
- case 29:
11357
+ case 26:
11411
11358
  url += "&page=".concat(page, "&offset=").concat(offset);
11412
11359
 
11413
- case 30:
11414
- _getUrlAndHeaders3 = getUrlAndHeaders({
11415
- url: url,
11416
- serviceName: apiInfo.apiKeyName,
11417
- headers: {}
11418
- }), finalUrl = _getUrlAndHeaders3.URL, HEADERS = _getUrlAndHeaders3.HEADERS;
11419
- _context10.next = 33;
11420
- return fetch(finalUrl, {
11421
- method: "GET",
11422
- headers: HEADERS
11423
- });
11360
+ case 27:
11361
+ _context11.next = 29;
11362
+ return fetch(url);
11424
11363
 
11425
- case 33:
11426
- res = _context10.sent;
11364
+ case 29:
11365
+ res = _context11.sent;
11427
11366
  if (res.ok) {
11428
- _context10.next = 36;
11367
+ _context11.next = 32;
11429
11368
  break;
11430
11369
  }
11431
11370
  throw new NetworkError(apiInfo.apiKeyName, res.status);
11432
11371
 
11433
- case 36:
11434
- _context10.next = 38;
11372
+ case 32:
11373
+ _context11.next = 34;
11435
11374
  return res.json();
11436
11375
 
11437
- case 38:
11438
- json = _context10.sent;
11376
+ case 34:
11377
+ json = _context11.sent;
11439
11378
  if (!(typeof json.result === "string")) {
11440
- _context10.next = 44;
11379
+ _context11.next = 40;
11441
11380
  break;
11442
11381
  }
11443
11382
  if (!json.result.includes("Invalid API Key")) {
11444
- _context10.next = 42;
11383
+ _context11.next = 38;
11445
11384
  break;
11446
11385
  }
11447
11386
  throw new InvalidApiKeyError(apiInfo.apiKeyName);
11448
11387
 
11449
- case 42:
11388
+ case 38:
11450
11389
  if (!json.result.includes("Max rate limit reached")) {
11451
- _context10.next = 44;
11390
+ _context11.next = 40;
11452
11391
  break;
11453
11392
  }
11454
11393
  throw new RateLimitError(apiInfo.apiKeyName);
11455
11394
 
11456
- case 44:
11457
- return _context10.abrupt("return", type === "gas" && !Array.isArray(json.result) ? [ json.result ] : json.result);
11395
+ case 40:
11396
+ return _context11.abrupt("return", type === "gas" && !Array.isArray(json.result) ? [ json.result ] : json.result);
11458
11397
 
11459
- case 45:
11398
+ case 41:
11460
11399
  case "end":
11461
- return _context10.stop();
11400
+ return _context11.stop();
11462
11401
  }
11463
- }), _callee10);
11402
+ }), _callee11);
11464
11403
  })));
11465
11404
  return _handleScanRequest.apply(this, arguments);
11466
11405
  }
11467
11406
  var fromUsernameToFid = function() {
11468
- var _ref4 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(username, apiKey) {
11469
- var url, _getUrlAndHeaders2, finalUrl, HEADERS, res, json, users, user;
11470
- return _regeneratorRuntime().wrap((function _callee2$(_context2) {
11471
- while (1) switch (_context2.prev = _context2.next) {
11407
+ var _ref4 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee3(username, apiKey) {
11408
+ var url, res, json, users, user;
11409
+ return _regeneratorRuntime().wrap((function _callee3$(_context3) {
11410
+ while (1) switch (_context3.prev = _context3.next) {
11472
11411
  case 0:
11473
11412
  if (username) {
11474
- _context2.next = 2;
11413
+ _context3.next = 2;
11475
11414
  break;
11476
11415
  }
11477
- return _context2.abrupt("return", null);
11416
+ return _context3.abrupt("return", null);
11478
11417
 
11479
11418
  case 2:
11480
11419
  url = "https://api.neynar.com/v2/farcaster/user/search/?q=".concat(username, "&limit=5");
11481
- _getUrlAndHeaders2 = getUrlAndHeaders({
11482
- url: url,
11483
- serviceName: "Neynar",
11420
+ _context3.next = 5;
11421
+ return fetch(url, {
11484
11422
  headers: {
11485
11423
  "x-api-key": apiKey,
11486
11424
  "x-neynar-experimental": "false"
11487
11425
  }
11488
- }), finalUrl = _getUrlAndHeaders2.URL, HEADERS = _getUrlAndHeaders2.HEADERS;
11489
- _context2.next = 6;
11490
- return fetch(finalUrl, {
11491
- method: "GET",
11492
- headers: HEADERS
11493
11426
  });
11494
11427
 
11495
- case 6:
11496
- res = _context2.sent;
11497
- _context2.next = 9;
11428
+ case 5:
11429
+ res = _context3.sent;
11430
+ _context3.next = 8;
11498
11431
  return res.json();
11499
11432
 
11500
- case 9:
11501
- json = _context2.sent;
11433
+ case 8:
11434
+ json = _context3.sent;
11502
11435
  users = json.result ? json.result.users : [];
11503
11436
  user = users.find((function(user) {
11504
11437
  return user.username === username;
11505
11438
  }));
11506
- return _context2.abrupt("return", user && user.fid || null);
11439
+ return _context3.abrupt("return", user && user.fid || null);
11507
11440
 
11508
- case 13:
11441
+ case 12:
11509
11442
  case "end":
11510
- return _context2.stop();
11443
+ return _context3.stop();
11511
11444
  }
11512
- }), _callee2);
11445
+ }), _callee3);
11513
11446
  })));
11514
- return function fromUsernameToFid(_x7, _x8) {
11447
+ return function fromUsernameToFid(_x8, _x9) {
11515
11448
  return _ref4.apply(this, arguments);
11516
11449
  };
11517
11450
  }();
@@ -12072,65 +12005,65 @@ function _typeof(o) {
12072
12005
  }, {
12073
12006
  key: "mergeObjectAsync",
12074
12007
  value: function() {
12075
- var _mergeObjectAsync = _asyncToGenerator(_regeneratorRuntime().mark((function _callee3(status, pairs) {
12008
+ var _mergeObjectAsync = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4(status, pairs) {
12076
12009
  var syncPairs, _iterator8, _step8, pair, key, _value5;
12077
- return _regeneratorRuntime().wrap((function _callee3$(_context3) {
12078
- while (1) switch (_context3.prev = _context3.next) {
12010
+ return _regeneratorRuntime().wrap((function _callee4$(_context4) {
12011
+ while (1) switch (_context4.prev = _context4.next) {
12079
12012
  case 0:
12080
12013
  syncPairs = [];
12081
12014
  _iterator8 = _createForOfIteratorHelper(pairs);
12082
- _context3.prev = 2;
12015
+ _context4.prev = 2;
12083
12016
  _iterator8.s();
12084
12017
 
12085
12018
  case 4:
12086
12019
  if ((_step8 = _iterator8.n()).done) {
12087
- _context3.next = 15;
12020
+ _context4.next = 15;
12088
12021
  break;
12089
12022
  }
12090
12023
  pair = _step8.value;
12091
- _context3.next = 8;
12024
+ _context4.next = 8;
12092
12025
  return pair.key;
12093
12026
 
12094
12027
  case 8:
12095
- key = _context3.sent;
12096
- _context3.next = 11;
12028
+ key = _context4.sent;
12029
+ _context4.next = 11;
12097
12030
  return pair.value;
12098
12031
 
12099
12032
  case 11:
12100
- _value5 = _context3.sent;
12033
+ _value5 = _context4.sent;
12101
12034
  syncPairs.push({
12102
12035
  key: key,
12103
12036
  value: _value5
12104
12037
  });
12105
12038
 
12106
12039
  case 13:
12107
- _context3.next = 4;
12040
+ _context4.next = 4;
12108
12041
  break;
12109
12042
 
12110
12043
  case 15:
12111
- _context3.next = 20;
12044
+ _context4.next = 20;
12112
12045
  break;
12113
12046
 
12114
12047
  case 17:
12115
- _context3.prev = 17;
12116
- _context3.t0 = _context3["catch"](2);
12117
- _iterator8.e(_context3.t0);
12048
+ _context4.prev = 17;
12049
+ _context4.t0 = _context4["catch"](2);
12050
+ _iterator8.e(_context4.t0);
12118
12051
 
12119
12052
  case 20:
12120
- _context3.prev = 20;
12053
+ _context4.prev = 20;
12121
12054
  _iterator8.f();
12122
- return _context3.finish(20);
12055
+ return _context4.finish(20);
12123
12056
 
12124
12057
  case 23:
12125
- return _context3.abrupt("return", ParseStatus.mergeObjectSync(status, syncPairs));
12058
+ return _context4.abrupt("return", ParseStatus.mergeObjectSync(status, syncPairs));
12126
12059
 
12127
12060
  case 24:
12128
12061
  case "end":
12129
- return _context3.stop();
12062
+ return _context4.stop();
12130
12063
  }
12131
- }), _callee3, null, [ [ 2, 17, 20, 23 ] ]);
12064
+ }), _callee4, null, [ [ 2, 17, 20, 23 ] ]);
12132
12065
  })));
12133
- function mergeObjectAsync(_x9, _x0) {
12066
+ function mergeObjectAsync(_x0, _x1) {
12134
12067
  return _mergeObjectAsync.apply(this, arguments);
12135
12068
  }
12136
12069
  return mergeObjectAsync;
@@ -12456,32 +12389,32 @@ function _typeof(o) {
12456
12389
  }, {
12457
12390
  key: "parseAsync",
12458
12391
  value: function() {
12459
- var _parseAsync2 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4(data, params) {
12392
+ var _parseAsync2 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5(data, params) {
12460
12393
  var result;
12461
- return _regeneratorRuntime().wrap((function _callee4$(_context4) {
12462
- while (1) switch (_context4.prev = _context4.next) {
12394
+ return _regeneratorRuntime().wrap((function _callee5$(_context5) {
12395
+ while (1) switch (_context5.prev = _context5.next) {
12463
12396
  case 0:
12464
- _context4.next = 2;
12397
+ _context5.next = 2;
12465
12398
  return this.safeParseAsync(data, params);
12466
12399
 
12467
12400
  case 2:
12468
- result = _context4.sent;
12401
+ result = _context5.sent;
12469
12402
  if (!result.success) {
12470
- _context4.next = 5;
12403
+ _context5.next = 5;
12471
12404
  break;
12472
12405
  }
12473
- return _context4.abrupt("return", result.data);
12406
+ return _context5.abrupt("return", result.data);
12474
12407
 
12475
12408
  case 5:
12476
12409
  throw result.error;
12477
12410
 
12478
12411
  case 6:
12479
12412
  case "end":
12480
- return _context4.stop();
12413
+ return _context5.stop();
12481
12414
  }
12482
- }), _callee4, this);
12415
+ }), _callee5, this);
12483
12416
  })));
12484
- function parseAsync(_x1, _x10) {
12417
+ function parseAsync(_x10, _x11) {
12485
12418
  return _parseAsync2.apply(this, arguments);
12486
12419
  }
12487
12420
  return parseAsync;
@@ -12489,10 +12422,10 @@ function _typeof(o) {
12489
12422
  }, {
12490
12423
  key: "safeParseAsync",
12491
12424
  value: function() {
12492
- var _safeParseAsync = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5(data, params) {
12425
+ var _safeParseAsync = _asyncToGenerator(_regeneratorRuntime().mark((function _callee6(data, params) {
12493
12426
  var ctx, maybeAsyncResult, result;
12494
- return _regeneratorRuntime().wrap((function _callee5$(_context5) {
12495
- while (1) switch (_context5.prev = _context5.next) {
12427
+ return _regeneratorRuntime().wrap((function _callee6$(_context6) {
12428
+ while (1) switch (_context6.prev = _context6.next) {
12496
12429
  case 0:
12497
12430
  ctx = {
12498
12431
  common: {
@@ -12511,20 +12444,20 @@ function _typeof(o) {
12511
12444
  path: ctx.path,
12512
12445
  parent: ctx
12513
12446
  });
12514
- _context5.next = 4;
12447
+ _context6.next = 4;
12515
12448
  return isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult);
12516
12449
 
12517
12450
  case 4:
12518
- result = _context5.sent;
12519
- return _context5.abrupt("return", handleResult(ctx, result));
12451
+ result = _context6.sent;
12452
+ return _context6.abrupt("return", handleResult(ctx, result));
12520
12453
 
12521
12454
  case 6:
12522
12455
  case "end":
12523
- return _context5.stop();
12456
+ return _context6.stop();
12524
12457
  }
12525
- }), _callee5, this);
12458
+ }), _callee6, this);
12526
12459
  })));
12527
- function safeParseAsync(_x11, _x12) {
12460
+ function safeParseAsync(_x12, _x13) {
12528
12461
  return _safeParseAsync.apply(this, arguments);
12529
12462
  }
12530
12463
  return safeParseAsync;
@@ -14683,32 +14616,32 @@ function _typeof(o) {
14683
14616
  }
14684
14617
  }
14685
14618
  if (ctx.common.async) {
14686
- return Promise.resolve().then(_asyncToGenerator(_regeneratorRuntime().mark((function _callee6() {
14619
+ return Promise.resolve().then(_asyncToGenerator(_regeneratorRuntime().mark((function _callee7() {
14687
14620
  var syncPairs, _iterator24, _step24, pair, _key4, _value8;
14688
- return _regeneratorRuntime().wrap((function _callee6$(_context6) {
14689
- while (1) switch (_context6.prev = _context6.next) {
14621
+ return _regeneratorRuntime().wrap((function _callee7$(_context7) {
14622
+ while (1) switch (_context7.prev = _context7.next) {
14690
14623
  case 0:
14691
14624
  syncPairs = [];
14692
14625
  _iterator24 = _createForOfIteratorHelper(pairs);
14693
- _context6.prev = 2;
14626
+ _context7.prev = 2;
14694
14627
  _iterator24.s();
14695
14628
 
14696
14629
  case 4:
14697
14630
  if ((_step24 = _iterator24.n()).done) {
14698
- _context6.next = 15;
14631
+ _context7.next = 15;
14699
14632
  break;
14700
14633
  }
14701
14634
  pair = _step24.value;
14702
- _context6.next = 8;
14635
+ _context7.next = 8;
14703
14636
  return pair.key;
14704
14637
 
14705
14638
  case 8:
14706
- _key4 = _context6.sent;
14707
- _context6.next = 11;
14639
+ _key4 = _context7.sent;
14640
+ _context7.next = 11;
14708
14641
  return pair.value;
14709
14642
 
14710
14643
  case 11:
14711
- _value8 = _context6.sent;
14644
+ _value8 = _context7.sent;
14712
14645
  syncPairs.push({
14713
14646
  key: _key4,
14714
14647
  value: _value8,
@@ -14716,31 +14649,31 @@ function _typeof(o) {
14716
14649
  });
14717
14650
 
14718
14651
  case 13:
14719
- _context6.next = 4;
14652
+ _context7.next = 4;
14720
14653
  break;
14721
14654
 
14722
14655
  case 15:
14723
- _context6.next = 20;
14656
+ _context7.next = 20;
14724
14657
  break;
14725
14658
 
14726
14659
  case 17:
14727
- _context6.prev = 17;
14728
- _context6.t0 = _context6["catch"](2);
14729
- _iterator24.e(_context6.t0);
14660
+ _context7.prev = 17;
14661
+ _context7.t0 = _context7["catch"](2);
14662
+ _iterator24.e(_context7.t0);
14730
14663
 
14731
14664
  case 20:
14732
- _context6.prev = 20;
14665
+ _context7.prev = 20;
14733
14666
  _iterator24.f();
14734
- return _context6.finish(20);
14667
+ return _context7.finish(20);
14735
14668
 
14736
14669
  case 23:
14737
- return _context6.abrupt("return", syncPairs);
14670
+ return _context7.abrupt("return", syncPairs);
14738
14671
 
14739
14672
  case 24:
14740
14673
  case "end":
14741
- return _context6.stop();
14674
+ return _context7.stop();
14742
14675
  }
14743
- }), _callee6, null, [ [ 2, 17, 20, 23 ] ]);
14676
+ }), _callee7, null, [ [ 2, 17, 20, 23 ] ]);
14744
14677
  })))).then((function(syncPairs) {
14745
14678
  return ParseStatus.mergeObjectSync(status, syncPairs);
14746
14679
  }));
@@ -15016,10 +14949,10 @@ function _typeof(o) {
15016
14949
  }
15017
14950
  if (ctx.common.async) {
15018
14951
  return Promise.all(options.map(function() {
15019
- var _ref8 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7(option) {
14952
+ var _ref8 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee8(option) {
15020
14953
  var childCtx;
15021
- return _regeneratorRuntime().wrap((function _callee7$(_context7) {
15022
- while (1) switch (_context7.prev = _context7.next) {
14954
+ return _regeneratorRuntime().wrap((function _callee8$(_context8) {
14955
+ while (1) switch (_context8.prev = _context8.next) {
15023
14956
  case 0:
15024
14957
  childCtx = _objectSpread(_objectSpread({}, ctx), {}, {
15025
14958
  common: _objectSpread(_objectSpread({}, ctx.common), {}, {
@@ -15027,7 +14960,7 @@ function _typeof(o) {
15027
14960
  }),
15028
14961
  parent: null
15029
14962
  });
15030
- _context7.next = 3;
14963
+ _context8.next = 3;
15031
14964
  return option._parseAsync({
15032
14965
  data: ctx.data,
15033
14966
  path: ctx.path,
@@ -15035,20 +14968,20 @@ function _typeof(o) {
15035
14968
  });
15036
14969
 
15037
14970
  case 3:
15038
- _context7.t0 = _context7.sent;
15039
- _context7.t1 = childCtx;
15040
- return _context7.abrupt("return", {
15041
- result: _context7.t0,
15042
- ctx: _context7.t1
14971
+ _context8.t0 = _context8.sent;
14972
+ _context8.t1 = childCtx;
14973
+ return _context8.abrupt("return", {
14974
+ result: _context8.t0,
14975
+ ctx: _context8.t1
15043
14976
  });
15044
14977
 
15045
14978
  case 6:
15046
14979
  case "end":
15047
- return _context7.stop();
14980
+ return _context8.stop();
15048
14981
  }
15049
- }), _callee7);
14982
+ }), _callee8);
15050
14983
  })));
15051
- return function(_x13) {
14984
+ return function(_x14) {
15052
14985
  return _ref8.apply(this, arguments);
15053
14986
  };
15054
14987
  }())).then(handleResults);
@@ -15494,36 +15427,36 @@ function _typeof(o) {
15494
15427
  }));
15495
15428
  if (ctx.common.async) {
15496
15429
  var finalMap = new Map;
15497
- return Promise.resolve().then(_asyncToGenerator(_regeneratorRuntime().mark((function _callee8() {
15430
+ return Promise.resolve().then(_asyncToGenerator(_regeneratorRuntime().mark((function _callee9() {
15498
15431
  var _iterator35, _step35, pair, key, _value1;
15499
- return _regeneratorRuntime().wrap((function _callee8$(_context8) {
15500
- while (1) switch (_context8.prev = _context8.next) {
15432
+ return _regeneratorRuntime().wrap((function _callee9$(_context9) {
15433
+ while (1) switch (_context9.prev = _context9.next) {
15501
15434
  case 0:
15502
15435
  _iterator35 = _createForOfIteratorHelper(pairs);
15503
- _context8.prev = 1;
15436
+ _context9.prev = 1;
15504
15437
  _iterator35.s();
15505
15438
 
15506
15439
  case 3:
15507
15440
  if ((_step35 = _iterator35.n()).done) {
15508
- _context8.next = 17;
15441
+ _context9.next = 17;
15509
15442
  break;
15510
15443
  }
15511
15444
  pair = _step35.value;
15512
- _context8.next = 7;
15445
+ _context9.next = 7;
15513
15446
  return pair.key;
15514
15447
 
15515
15448
  case 7:
15516
- key = _context8.sent;
15517
- _context8.next = 10;
15449
+ key = _context9.sent;
15450
+ _context9.next = 10;
15518
15451
  return pair.value;
15519
15452
 
15520
15453
  case 10:
15521
- _value1 = _context8.sent;
15454
+ _value1 = _context9.sent;
15522
15455
  if (!(key.status === "aborted" || _value1.status === "aborted")) {
15523
- _context8.next = 13;
15456
+ _context9.next = 13;
15524
15457
  break;
15525
15458
  }
15526
- return _context8.abrupt("return", INVALID);
15459
+ return _context9.abrupt("return", INVALID);
15527
15460
 
15528
15461
  case 13:
15529
15462
  if (key.status === "dirty" || _value1.status === "dirty") {
@@ -15532,34 +15465,34 @@ function _typeof(o) {
15532
15465
  finalMap.set(key.value, _value1.value);
15533
15466
 
15534
15467
  case 15:
15535
- _context8.next = 3;
15468
+ _context9.next = 3;
15536
15469
  break;
15537
15470
 
15538
15471
  case 17:
15539
- _context8.next = 22;
15472
+ _context9.next = 22;
15540
15473
  break;
15541
15474
 
15542
15475
  case 19:
15543
- _context8.prev = 19;
15544
- _context8.t0 = _context8["catch"](1);
15545
- _iterator35.e(_context8.t0);
15476
+ _context9.prev = 19;
15477
+ _context9.t0 = _context9["catch"](1);
15478
+ _iterator35.e(_context9.t0);
15546
15479
 
15547
15480
  case 22:
15548
- _context8.prev = 22;
15481
+ _context9.prev = 22;
15549
15482
  _iterator35.f();
15550
- return _context8.finish(22);
15483
+ return _context9.finish(22);
15551
15484
 
15552
15485
  case 25:
15553
- return _context8.abrupt("return", {
15486
+ return _context9.abrupt("return", {
15554
15487
  status: status.value,
15555
15488
  value: finalMap
15556
15489
  });
15557
15490
 
15558
15491
  case 26:
15559
15492
  case "end":
15560
- return _context8.stop();
15493
+ return _context9.stop();
15561
15494
  }
15562
- }), _callee8, null, [ [ 1, 19, 22, 25 ] ]);
15495
+ }), _callee9, null, [ [ 1, 19, 22, 25 ] ]);
15563
15496
  }))));
15564
15497
  } else {
15565
15498
  var _finalMap = new Map;
@@ -16020,19 +15953,19 @@ function _typeof(o) {
16020
15953
  var processed = effect.transform(ctx.data, checkCtx);
16021
15954
  if (ctx.common.async) {
16022
15955
  return Promise.resolve(processed).then(function() {
16023
- var _ref12 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9(processed) {
15956
+ var _ref12 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0(processed) {
16024
15957
  var result;
16025
- return _regeneratorRuntime().wrap((function _callee9$(_context9) {
16026
- while (1) switch (_context9.prev = _context9.next) {
15958
+ return _regeneratorRuntime().wrap((function _callee0$(_context0) {
15959
+ while (1) switch (_context0.prev = _context0.next) {
16027
15960
  case 0:
16028
15961
  if (!(status.value === "aborted")) {
16029
- _context9.next = 2;
15962
+ _context0.next = 2;
16030
15963
  break;
16031
15964
  }
16032
- return _context9.abrupt("return", INVALID);
15965
+ return _context0.abrupt("return", INVALID);
16033
15966
 
16034
15967
  case 2:
16035
- _context9.next = 4;
15968
+ _context0.next = 4;
16036
15969
  return _this14._def.schema._parseAsync({
16037
15970
  data: processed,
16038
15971
  path: ctx.path,
@@ -16040,37 +15973,37 @@ function _typeof(o) {
16040
15973
  });
16041
15974
 
16042
15975
  case 4:
16043
- result = _context9.sent;
15976
+ result = _context0.sent;
16044
15977
  if (!(result.status === "aborted")) {
16045
- _context9.next = 7;
15978
+ _context0.next = 7;
16046
15979
  break;
16047
15980
  }
16048
- return _context9.abrupt("return", INVALID);
15981
+ return _context0.abrupt("return", INVALID);
16049
15982
 
16050
15983
  case 7:
16051
15984
  if (!(result.status === "dirty")) {
16052
- _context9.next = 9;
15985
+ _context0.next = 9;
16053
15986
  break;
16054
15987
  }
16055
- return _context9.abrupt("return", DIRTY(result.value));
15988
+ return _context0.abrupt("return", DIRTY(result.value));
16056
15989
 
16057
15990
  case 9:
16058
15991
  if (!(status.value === "dirty")) {
16059
- _context9.next = 11;
15992
+ _context0.next = 11;
16060
15993
  break;
16061
15994
  }
16062
- return _context9.abrupt("return", DIRTY(result.value));
15995
+ return _context0.abrupt("return", DIRTY(result.value));
16063
15996
 
16064
15997
  case 11:
16065
- return _context9.abrupt("return", result);
15998
+ return _context0.abrupt("return", result);
16066
15999
 
16067
16000
  case 12:
16068
16001
  case "end":
16069
- return _context9.stop();
16002
+ return _context0.stop();
16070
16003
  }
16071
- }), _callee9);
16004
+ }), _callee0);
16072
16005
  })));
16073
- return function(_x14) {
16006
+ return function(_x15) {
16074
16007
  return _ref12.apply(this, arguments);
16075
16008
  };
16076
16009
  }());
@@ -16402,12 +16335,12 @@ function _typeof(o) {
16402
16335
  var _this$_processInputPa13 = this._processInputParams(input), status = _this$_processInputPa13.status, ctx = _this$_processInputPa13.ctx;
16403
16336
  if (ctx.common.async) {
16404
16337
  var handleAsync = function() {
16405
- var _ref13 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
16338
+ var _ref13 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee1() {
16406
16339
  var inResult;
16407
- return _regeneratorRuntime().wrap((function _callee0$(_context0) {
16408
- while (1) switch (_context0.prev = _context0.next) {
16340
+ return _regeneratorRuntime().wrap((function _callee1$(_context1) {
16341
+ while (1) switch (_context1.prev = _context1.next) {
16409
16342
  case 0:
16410
- _context0.next = 2;
16343
+ _context1.next = 2;
16411
16344
  return _this16._def["in"]._parseAsync({
16412
16345
  data: ctx.data,
16413
16346
  path: ctx.path,
@@ -16415,23 +16348,23 @@ function _typeof(o) {
16415
16348
  });
16416
16349
 
16417
16350
  case 2:
16418
- inResult = _context0.sent;
16351
+ inResult = _context1.sent;
16419
16352
  if (!(inResult.status === "aborted")) {
16420
- _context0.next = 5;
16353
+ _context1.next = 5;
16421
16354
  break;
16422
16355
  }
16423
- return _context0.abrupt("return", INVALID);
16356
+ return _context1.abrupt("return", INVALID);
16424
16357
 
16425
16358
  case 5:
16426
16359
  if (!(inResult.status === "dirty")) {
16427
- _context0.next = 10;
16360
+ _context1.next = 10;
16428
16361
  break;
16429
16362
  }
16430
16363
  status.dirty();
16431
- return _context0.abrupt("return", DIRTY(inResult.value));
16364
+ return _context1.abrupt("return", DIRTY(inResult.value));
16432
16365
 
16433
16366
  case 10:
16434
- return _context0.abrupt("return", _this16._def.out._parseAsync({
16367
+ return _context1.abrupt("return", _this16._def.out._parseAsync({
16435
16368
  data: inResult.value,
16436
16369
  path: ctx.path,
16437
16370
  parent: ctx
@@ -16439,9 +16372,9 @@ function _typeof(o) {
16439
16372
 
16440
16373
  case 11:
16441
16374
  case "end":
16442
- return _context0.stop();
16375
+ return _context1.stop();
16443
16376
  }
16444
- }), _callee0);
16377
+ }), _callee1);
16445
16378
  })));
16446
16379
  return function handleAsync() {
16447
16380
  return _ref13.apply(this, arguments);
@@ -16784,13 +16717,13 @@ function _typeof(o) {
16784
16717
  return _FIREFLY.apply(this, arguments);
16785
16718
  }
16786
16719
  function _FIREFLY() {
16787
- _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11() {
16788
- var _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, apiKey, url, _getUrlAndHeaders4, finalUrl, HEADERS, response, _yield$response$json, _data, _args11 = arguments;
16789
- return _regeneratorRuntime().wrap((function _callee11$(_context11) {
16790
- while (1) switch (_context11.prev = _context11.next) {
16720
+ _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12() {
16721
+ var _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, apiKey, url, response, _yield$response$json, _data, _args12 = arguments;
16722
+ return _regeneratorRuntime().wrap((function _callee12$(_context12) {
16723
+ while (1) switch (_context12.prev = _context12.next) {
16791
16724
  case 0:
16792
- _context11.prev = 0;
16793
- _argsToArray3 = argsToArray(_args11), _argsToArray4 = _slicedToArray(_argsToArray3, 5),
16725
+ _context12.prev = 0;
16726
+ _argsToArray3 = argsToArray(_args12), _argsToArray4 = _slicedToArray(_argsToArray3, 5),
16794
16727
  platform = _argsToArray4[0], contentType = _argsToArray4[1], identifier = _argsToArray4[2],
16795
16728
  _argsToArray4$ = _argsToArray4[3], start = _argsToArray4$ === void 0 ? 0 : _argsToArray4$,
16796
16729
  _argsToArray4$2 = _argsToArray4[4], end = _argsToArray4$2 === void 0 ? 10 : _argsToArray4$2;
@@ -16802,6 +16735,13 @@ function _typeof(o) {
16802
16735
  end: end
16803
16736
  });
16804
16737
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Firefly);
16738
+ if (apiKey) {
16739
+ _context12.next = 6;
16740
+ break;
16741
+ }
16742
+ throw new MissingApiKeyError(SERVICES_API_KEY.Firefly);
16743
+
16744
+ case 6:
16805
16745
  url = new URL("https://openapi.firefly.land/v1/fileverse/fetch");
16806
16746
  url.searchParams.set("query", identifier.split(",").map((function(s) {
16807
16747
  return s.trim();
@@ -16809,42 +16749,36 @@ function _typeof(o) {
16809
16749
  url.searchParams.set("type", fireFlyPlaformType[platform][contentType]);
16810
16750
  url.searchParams.set("start", String(start));
16811
16751
  url.searchParams.set("end", String(end));
16812
- _getUrlAndHeaders4 = getUrlAndHeaders({
16813
- url: url.toString(),
16814
- serviceName: "Firefly",
16752
+ _context12.next = 13;
16753
+ return fetch(url.toString(), {
16815
16754
  headers: {
16816
16755
  "x-api-key": apiKey
16817
16756
  }
16818
- }), finalUrl = _getUrlAndHeaders4.URL, HEADERS = _getUrlAndHeaders4.HEADERS;
16819
- _context11.next = 12;
16820
- return fetch(finalUrl, {
16821
- method: "GET",
16822
- headers: HEADERS
16823
16757
  });
16824
16758
 
16825
- case 12:
16826
- response = _context11.sent;
16759
+ case 13:
16760
+ response = _context12.sent;
16827
16761
  if (response.ok) {
16828
- _context11.next = 15;
16762
+ _context12.next = 16;
16829
16763
  break;
16830
16764
  }
16831
16765
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
16832
16766
 
16833
- case 15:
16834
- _context11.next = 17;
16767
+ case 16:
16768
+ _context12.next = 18;
16835
16769
  return response.json();
16836
16770
 
16837
- case 17:
16838
- _yield$response$json = _context11.sent;
16771
+ case 18:
16772
+ _yield$response$json = _context12.sent;
16839
16773
  _data = _yield$response$json.data;
16840
16774
  if (Array.isArray(_data)) {
16841
- _context11.next = 21;
16775
+ _context12.next = 22;
16842
16776
  break;
16843
16777
  }
16844
- return _context11.abrupt("return", []);
16778
+ return _context12.abrupt("return", []);
16845
16779
 
16846
- case 21:
16847
- return _context11.abrupt("return", _data.map((function(item) {
16780
+ case 22:
16781
+ return _context12.abrupt("return", _data.map((function(item) {
16848
16782
  var flat = {};
16849
16783
  for (var _i10 = 0, _Object$entries = Object.entries(item); _i10 < _Object$entries.length; _i10++) {
16850
16784
  var _Object$entries$_i = _slicedToArray(_Object$entries[_i10], 2), key = _Object$entries$_i[0], _value11 = _Object$entries$_i[1];
@@ -16856,16 +16790,16 @@ function _typeof(o) {
16856
16790
  return flat;
16857
16791
  })));
16858
16792
 
16859
- case 24:
16860
- _context11.prev = 24;
16861
- _context11.t0 = _context11["catch"](0);
16862
- return _context11.abrupt("return", errorMessageHandler(_context11.t0, "FIREFLY"));
16793
+ case 25:
16794
+ _context12.prev = 25;
16795
+ _context12.t0 = _context12["catch"](0);
16796
+ return _context12.abrupt("return", errorMessageHandler(_context12.t0, "FIREFLY"));
16863
16797
 
16864
- case 27:
16798
+ case 28:
16865
16799
  case "end":
16866
- return _context11.stop();
16800
+ return _context12.stop();
16867
16801
  }
16868
- }), _callee11, null, [ [ 0, 24 ] ]);
16802
+ }), _callee12, null, [ [ 0, 25 ] ]);
16869
16803
  })));
16870
16804
  return _FIREFLY.apply(this, arguments);
16871
16805
  }
@@ -16873,13 +16807,13 @@ function _typeof(o) {
16873
16807
  return _LENS.apply(this, arguments);
16874
16808
  }
16875
16809
  function _LENS() {
16876
- _LENS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12() {
16877
- var _argsToArray5, _argsToArray6, contentType, identifier, _argsToArray6$, start, _argsToArray6$2, end, apiKey, url, typeMap, _getUrlAndHeaders5, finalUrl, HEADERS, response, _yield$response$json2, _data2, _args12 = arguments;
16878
- return _regeneratorRuntime().wrap((function _callee12$(_context12) {
16879
- while (1) switch (_context12.prev = _context12.next) {
16810
+ _LENS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
16811
+ var _argsToArray5, _argsToArray6, contentType, identifier, _argsToArray6$, start, _argsToArray6$2, end, apiKey, url, typeMap, response, _yield$response$json2, _data2, _args13 = arguments;
16812
+ return _regeneratorRuntime().wrap((function _callee13$(_context13) {
16813
+ while (1) switch (_context13.prev = _context13.next) {
16880
16814
  case 0:
16881
- _context12.prev = 0;
16882
- _argsToArray5 = argsToArray(_args12), _argsToArray6 = _slicedToArray(_argsToArray5, 4),
16815
+ _context13.prev = 0;
16816
+ _argsToArray5 = argsToArray(_args13), _argsToArray6 = _slicedToArray(_argsToArray5, 4),
16883
16817
  contentType = _argsToArray6[0], identifier = _argsToArray6[1], _argsToArray6$ = _argsToArray6[2],
16884
16818
  start = _argsToArray6$ === void 0 ? 0 : _argsToArray6$, _argsToArray6$2 = _argsToArray6[3],
16885
16819
  end = _argsToArray6$2 === void 0 ? 10 : _argsToArray6$2;
@@ -16890,6 +16824,13 @@ function _typeof(o) {
16890
16824
  end: end
16891
16825
  });
16892
16826
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Firefly);
16827
+ if (apiKey) {
16828
+ _context13.next = 6;
16829
+ break;
16830
+ }
16831
+ throw new MissingApiKeyError(SERVICES_API_KEY.Firefly);
16832
+
16833
+ case 6:
16893
16834
  url = new URL("https://openapi.firefly.land/v1/fileverse/fetch");
16894
16835
  url.searchParams.set("query", identifier.split(",").map((function(s) {
16895
16836
  return s.trim();
@@ -16901,42 +16842,36 @@ function _typeof(o) {
16901
16842
  url.searchParams.set("type", typeMap[contentType]);
16902
16843
  url.searchParams.set("start", String(start));
16903
16844
  url.searchParams.set("end", String(end));
16904
- _getUrlAndHeaders5 = getUrlAndHeaders({
16905
- url: url.toString(),
16906
- serviceName: "Firefly",
16845
+ _context13.next = 14;
16846
+ return fetch(url.toString(), {
16907
16847
  headers: {
16908
16848
  "x-api-key": apiKey
16909
16849
  }
16910
- }), finalUrl = _getUrlAndHeaders5.URL, HEADERS = _getUrlAndHeaders5.HEADERS;
16911
- _context12.next = 13;
16912
- return fetch(finalUrl, {
16913
- method: "GET",
16914
- headers: HEADERS
16915
16850
  });
16916
16851
 
16917
- case 13:
16918
- response = _context12.sent;
16852
+ case 14:
16853
+ response = _context13.sent;
16919
16854
  if (response.ok) {
16920
- _context12.next = 16;
16855
+ _context13.next = 17;
16921
16856
  break;
16922
16857
  }
16923
16858
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
16924
16859
 
16925
- case 16:
16926
- _context12.next = 18;
16860
+ case 17:
16861
+ _context13.next = 19;
16927
16862
  return response.json();
16928
16863
 
16929
- case 18:
16930
- _yield$response$json2 = _context12.sent;
16864
+ case 19:
16865
+ _yield$response$json2 = _context13.sent;
16931
16866
  _data2 = _yield$response$json2.data;
16932
16867
  if (Array.isArray(_data2)) {
16933
- _context12.next = 22;
16868
+ _context13.next = 23;
16934
16869
  break;
16935
16870
  }
16936
- return _context12.abrupt("return", []);
16871
+ return _context13.abrupt("return", []);
16937
16872
 
16938
- case 22:
16939
- return _context12.abrupt("return", _data2.map((function(item) {
16873
+ case 23:
16874
+ return _context13.abrupt("return", _data2.map((function(item) {
16940
16875
  var flat = {};
16941
16876
  for (var _i11 = 0, _Object$entries2 = Object.entries(item); _i11 < _Object$entries2.length; _i11++) {
16942
16877
  var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i11], 2), key = _Object$entries2$_i[0], _value12 = _Object$entries2$_i[1];
@@ -16948,16 +16883,16 @@ function _typeof(o) {
16948
16883
  return flat;
16949
16884
  })));
16950
16885
 
16951
- case 25:
16952
- _context12.prev = 25;
16953
- _context12.t0 = _context12["catch"](0);
16954
- return _context12.abrupt("return", errorMessageHandler(_context12.t0, "LENS"));
16886
+ case 26:
16887
+ _context13.prev = 26;
16888
+ _context13.t0 = _context13["catch"](0);
16889
+ return _context13.abrupt("return", errorMessageHandler(_context13.t0, "LENS"));
16955
16890
 
16956
- case 28:
16891
+ case 29:
16957
16892
  case "end":
16958
- return _context12.stop();
16893
+ return _context13.stop();
16959
16894
  }
16960
- }), _callee12, null, [ [ 0, 25 ] ]);
16895
+ }), _callee13, null, [ [ 0, 26 ] ]);
16961
16896
  })));
16962
16897
  return _LENS.apply(this, arguments);
16963
16898
  }
@@ -16965,13 +16900,13 @@ function _typeof(o) {
16965
16900
  return _FARCASTER.apply(this, arguments);
16966
16901
  }
16967
16902
  function _FARCASTER() {
16968
- _FARCASTER = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
16969
- var _argsToArray7, _argsToArray8, contentType, identifier, _argsToArray8$, start, _argsToArray8$2, end, apiKey, url, typeMap, _getUrlAndHeaders6, finalUrl, HEADERS, response, _yield$response$json3, _data3, _args13 = arguments;
16970
- return _regeneratorRuntime().wrap((function _callee13$(_context13) {
16971
- while (1) switch (_context13.prev = _context13.next) {
16903
+ _FARCASTER = _asyncToGenerator(_regeneratorRuntime().mark((function _callee14() {
16904
+ var _argsToArray7, _argsToArray8, contentType, identifier, _argsToArray8$, start, _argsToArray8$2, end, apiKey, url, typeMap, response, _yield$response$json3, _data3, _args14 = arguments;
16905
+ return _regeneratorRuntime().wrap((function _callee14$(_context14) {
16906
+ while (1) switch (_context14.prev = _context14.next) {
16972
16907
  case 0:
16973
- _context13.prev = 0;
16974
- _argsToArray7 = argsToArray(_args13), _argsToArray8 = _slicedToArray(_argsToArray7, 4),
16908
+ _context14.prev = 0;
16909
+ _argsToArray7 = argsToArray(_args14), _argsToArray8 = _slicedToArray(_argsToArray7, 4),
16975
16910
  contentType = _argsToArray8[0], identifier = _argsToArray8[1], _argsToArray8$ = _argsToArray8[2],
16976
16911
  start = _argsToArray8$ === void 0 ? 0 : _argsToArray8$, _argsToArray8$2 = _argsToArray8[3],
16977
16912
  end = _argsToArray8$2 === void 0 ? 10 : _argsToArray8$2;
@@ -16982,6 +16917,13 @@ function _typeof(o) {
16982
16917
  end: end
16983
16918
  });
16984
16919
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Firefly);
16920
+ if (apiKey) {
16921
+ _context14.next = 6;
16922
+ break;
16923
+ }
16924
+ throw new MissingApiKeyError(SERVICES_API_KEY.Firefly);
16925
+
16926
+ case 6:
16985
16927
  url = new URL("https://openapi.firefly.land/v1/fileverse/fetch");
16986
16928
  url.searchParams.set("query", identifier.split(",").map((function(s) {
16987
16929
  return s.trim();
@@ -16994,42 +16936,36 @@ function _typeof(o) {
16994
16936
  url.searchParams.set("type", typeMap[contentType]);
16995
16937
  url.searchParams.set("start", String(start));
16996
16938
  url.searchParams.set("end", String(end));
16997
- _getUrlAndHeaders6 = getUrlAndHeaders({
16998
- url: url.toString(),
16999
- serviceName: "Firefly",
16939
+ _context14.next = 14;
16940
+ return fetch(url.toString(), {
17000
16941
  headers: {
17001
16942
  "x-api-key": apiKey
17002
16943
  }
17003
- }), finalUrl = _getUrlAndHeaders6.URL, HEADERS = _getUrlAndHeaders6.HEADERS;
17004
- _context13.next = 13;
17005
- return fetch(finalUrl, {
17006
- method: "GET",
17007
- headers: HEADERS
17008
16944
  });
17009
16945
 
17010
- case 13:
17011
- response = _context13.sent;
16946
+ case 14:
16947
+ response = _context14.sent;
17012
16948
  if (response.ok) {
17013
- _context13.next = 16;
16949
+ _context14.next = 17;
17014
16950
  break;
17015
16951
  }
17016
16952
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
17017
16953
 
17018
- case 16:
17019
- _context13.next = 18;
16954
+ case 17:
16955
+ _context14.next = 19;
17020
16956
  return response.json();
17021
16957
 
17022
- case 18:
17023
- _yield$response$json3 = _context13.sent;
16958
+ case 19:
16959
+ _yield$response$json3 = _context14.sent;
17024
16960
  _data3 = _yield$response$json3.data;
17025
16961
  if (Array.isArray(_data3)) {
17026
- _context13.next = 22;
16962
+ _context14.next = 23;
17027
16963
  break;
17028
16964
  }
17029
- return _context13.abrupt("return", []);
16965
+ return _context14.abrupt("return", []);
17030
16966
 
17031
- case 22:
17032
- return _context13.abrupt("return", _data3.map((function(item) {
16967
+ case 23:
16968
+ return _context14.abrupt("return", _data3.map((function(item) {
17033
16969
  var flat = {};
17034
16970
  for (var _i12 = 0, _Object$entries3 = Object.entries(item); _i12 < _Object$entries3.length; _i12++) {
17035
16971
  var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i12], 2), k = _Object$entries3$_i[0], v = _Object$entries3$_i[1];
@@ -17041,16 +16977,16 @@ function _typeof(o) {
17041
16977
  return flat;
17042
16978
  })));
17043
16979
 
17044
- case 25:
17045
- _context13.prev = 25;
17046
- _context13.t0 = _context13["catch"](0);
17047
- return _context13.abrupt("return", errorMessageHandler(_context13.t0, "FARCASTER"));
16980
+ case 26:
16981
+ _context14.prev = 26;
16982
+ _context14.t0 = _context14["catch"](0);
16983
+ return _context14.abrupt("return", errorMessageHandler(_context14.t0, "FARCASTER"));
17048
16984
 
17049
- case 28:
16985
+ case 29:
17050
16986
  case "end":
17051
- return _context13.stop();
16987
+ return _context14.stop();
17052
16988
  }
17053
- }), _callee13, null, [ [ 0, 25 ] ]);
16989
+ }), _callee14, null, [ [ 0, 26 ] ]);
17054
16990
  })));
17055
16991
  return _FARCASTER.apply(this, arguments);
17056
16992
  }
@@ -17058,13 +16994,13 @@ function _typeof(o) {
17058
16994
  return _BLOCKSCOUT.apply(this, arguments);
17059
16995
  }
17060
16996
  function _BLOCKSCOUT() {
17061
- _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee14() {
17062
- var _json$result, _json$result2, _argsToArray9, _argsToArray0, address, type, _argsToArray0$, chain, startTimestamp, endTimestamp, page, offset, startTs, endTs, resolvedAddress, ensName, hostname, requestUrl, response, json, _args14 = arguments;
17063
- return _regeneratorRuntime().wrap((function _callee14$(_context14) {
17064
- while (1) switch (_context14.prev = _context14.next) {
16997
+ _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15() {
16998
+ var _json$result, _json$result2, _argsToArray9, _argsToArray0, address, type, _argsToArray0$, chain, startTimestamp, endTimestamp, page, offset, startTs, endTs, resolvedAddress, hostname, requestUrl, response, json, _args15 = arguments;
16999
+ return _regeneratorRuntime().wrap((function _callee15$(_context15) {
17000
+ while (1) switch (_context15.prev = _context15.next) {
17065
17001
  case 0:
17066
- _context14.prev = 0;
17067
- _argsToArray9 = argsToArray(_args14), _argsToArray0 = _slicedToArray(_argsToArray9, 7),
17002
+ _context15.prev = 0;
17003
+ _argsToArray9 = argsToArray(_args15), _argsToArray0 = _slicedToArray(_argsToArray9, 7),
17068
17004
  address = _argsToArray0[0], type = _argsToArray0[1], _argsToArray0$ = _argsToArray0[2],
17069
17005
  chain = _argsToArray0$ === void 0 ? "ethereum" : _argsToArray0$, startTimestamp = _argsToArray0[3],
17070
17006
  endTimestamp = _argsToArray0[4], page = _argsToArray0[5], offset = _argsToArray0[6];
@@ -17079,85 +17015,72 @@ function _typeof(o) {
17079
17015
  });
17080
17016
  startTs = startTimestamp !== null && startTimestamp !== void 0 ? startTimestamp : Math.floor((Date.now() - 30 * 24 * 3600 * 1e3) / 1e3);
17081
17017
  endTs = endTimestamp;
17082
- resolvedAddress = address;
17083
- if (isAddress$1.isAddress(resolvedAddress)) {
17084
- _context14.next = 13;
17085
- break;
17086
- }
17087
- ensName = resolvedAddress;
17088
- _context14.next = 10;
17089
- return fromEnsNameToAddress$1.fromEnsNameToAddress(ensName);
17090
-
17091
- case 10:
17092
- resolvedAddress = _context14.sent;
17093
- if (resolvedAddress) {
17094
- _context14.next = 13;
17095
- break;
17096
- }
17097
- throw new EnsError(ensName);
17018
+ _context15.next = 7;
17019
+ return fromEnsNameToAddress$1.validateAndGetAddress(address);
17098
17020
 
17099
- case 13:
17021
+ case 7:
17022
+ resolvedAddress = _context15.sent;
17100
17023
  hostname = BLOCKSCOUT_CHAINS_MAP[chain];
17101
- _context14.t0 = type;
17102
- _context14.next = _context14.t0 === "stat" ? 17 : _context14.t0 === "txns" ? 19 : _context14.t0 === "tokens" ? 21 : 23;
17024
+ _context15.t0 = type;
17025
+ _context15.next = _context15.t0 === "stat" ? 12 : _context15.t0 === "txns" ? 14 : _context15.t0 === "tokens" ? 16 : 18;
17103
17026
  break;
17104
17027
 
17105
- case 17:
17028
+ case 12:
17106
17029
  requestUrl = "".concat(hostname, "/api/v2/addresses/").concat(resolvedAddress, "/counters");
17107
- return _context14.abrupt("break", 23);
17030
+ return _context15.abrupt("break", 18);
17108
17031
 
17109
- case 19:
17032
+ case 14:
17110
17033
  requestUrl = "".concat(hostname, "/api?module=account&action=txlist") + "&address=".concat(resolvedAddress) + "&start_timestamp=".concat(startTs) + "&end_timestamp=".concat(endTs !== null && endTs !== void 0 ? endTs : "") + "&page=".concat(page) + "&offset=".concat(offset) + "&sort=asc";
17111
- return _context14.abrupt("break", 23);
17034
+ return _context15.abrupt("break", 18);
17112
17035
 
17113
- case 21:
17036
+ case 16:
17114
17037
  requestUrl = "".concat(hostname, "/api?module=account&action=tokenlist") + "&address=".concat(resolvedAddress);
17115
- return _context14.abrupt("break", 23);
17038
+ return _context15.abrupt("break", 18);
17116
17039
 
17117
- case 23:
17118
- _context14.next = 25;
17040
+ case 18:
17041
+ _context15.next = 20;
17119
17042
  return fetch(requestUrl);
17120
17043
 
17121
- case 25:
17122
- response = _context14.sent;
17044
+ case 20:
17045
+ response = _context15.sent;
17123
17046
  if (response.ok) {
17124
- _context14.next = 28;
17047
+ _context15.next = 23;
17125
17048
  break;
17126
17049
  }
17127
17050
  throw new NetworkError("BLOCKSCOUT", response.status);
17128
17051
 
17129
- case 28:
17130
- _context14.next = 30;
17052
+ case 23:
17053
+ _context15.next = 25;
17131
17054
  return response.json();
17132
17055
 
17133
- case 30:
17134
- json = _context14.sent;
17056
+ case 25:
17057
+ json = _context15.sent;
17135
17058
  if (!(json !== null && json !== void 0 && (_json$result = json.result) !== null && _json$result !== void 0 && _json$result.includes("Invalid parameter(s)"))) {
17136
- _context14.next = 33;
17059
+ _context15.next = 28;
17137
17060
  break;
17138
17061
  }
17139
17062
  throw new ValidationError("Invalid parameters");
17140
17063
 
17141
- case 33:
17064
+ case 28:
17142
17065
  if (!(json !== null && json !== void 0 && (_json$result2 = json.result) !== null && _json$result2 !== void 0 && _json$result2.includes("Not found"))) {
17143
- _context14.next = 35;
17066
+ _context15.next = 30;
17144
17067
  break;
17145
17068
  }
17146
17069
  throw new ValidationError("Address information not found");
17147
17070
 
17148
- case 35:
17149
- return _context14.abrupt("return", type === "stat" ? [ json ] : json.result);
17071
+ case 30:
17072
+ return _context15.abrupt("return", type === "stat" ? [ json ] : json.result);
17150
17073
 
17151
- case 38:
17152
- _context14.prev = 38;
17153
- _context14.t1 = _context14["catch"](0);
17154
- return _context14.abrupt("return", errorMessageHandler(_context14.t1, "BLOCKSCOUT"));
17074
+ case 33:
17075
+ _context15.prev = 33;
17076
+ _context15.t1 = _context15["catch"](0);
17077
+ return _context15.abrupt("return", errorMessageHandler(_context15.t1, "BLOCKSCOUT"));
17155
17078
 
17156
- case 41:
17079
+ case 36:
17157
17080
  case "end":
17158
- return _context14.stop();
17081
+ return _context15.stop();
17159
17082
  }
17160
- }), _callee14, null, [ [ 0, 38 ] ]);
17083
+ }), _callee15, null, [ [ 0, 33 ] ]);
17161
17084
  })));
17162
17085
  return _BLOCKSCOUT.apply(this, arguments);
17163
17086
  }
@@ -17165,13 +17088,13 @@ function _typeof(o) {
17165
17088
  return _BASE.apply(this, arguments);
17166
17089
  }
17167
17090
  function _BASE() {
17168
- _BASE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15() {
17169
- var _argsToArray1, _argsToArray10, type, address, startDate, endDate, page, limit, API_KEY, _args15 = arguments;
17170
- return _regeneratorRuntime().wrap((function _callee15$(_context15) {
17171
- while (1) switch (_context15.prev = _context15.next) {
17091
+ _BASE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee16() {
17092
+ var _argsToArray1, _argsToArray10, type, address, startDate, endDate, page, limit, API_KEY, _args16 = arguments;
17093
+ return _regeneratorRuntime().wrap((function _callee16$(_context16) {
17094
+ while (1) switch (_context16.prev = _context16.next) {
17172
17095
  case 0:
17173
- _context15.prev = 0;
17174
- _argsToArray1 = argsToArray(_args15), _argsToArray10 = _slicedToArray(_argsToArray1, 6),
17096
+ _context16.prev = 0;
17097
+ _argsToArray1 = argsToArray(_args16), _argsToArray10 = _slicedToArray(_argsToArray1, 6),
17175
17098
  type = _argsToArray10[0], address = _argsToArray10[1], startDate = _argsToArray10[2],
17176
17099
  endDate = _argsToArray10[3], page = _argsToArray10[4], limit = _argsToArray10[5];
17177
17100
  validateParams(baseParamsSchema, {
@@ -17183,7 +17106,14 @@ function _typeof(o) {
17183
17106
  limit: limit
17184
17107
  });
17185
17108
  API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Basescan);
17186
- _context15.next = 6;
17109
+ if (API_KEY) {
17110
+ _context16.next = 6;
17111
+ break;
17112
+ }
17113
+ throw new MissingApiKeyError(SERVICES_API_KEY.Basescan);
17114
+
17115
+ case 6:
17116
+ _context16.next = 8;
17187
17117
  return handleScanRequest({
17188
17118
  type: type,
17189
17119
  address: address,
@@ -17197,19 +17127,19 @@ function _typeof(o) {
17197
17127
  network: "base"
17198
17128
  });
17199
17129
 
17200
- case 6:
17201
- return _context15.abrupt("return", _context15.sent);
17130
+ case 8:
17131
+ return _context16.abrupt("return", _context16.sent);
17202
17132
 
17203
- case 9:
17204
- _context15.prev = 9;
17205
- _context15.t0 = _context15["catch"](0);
17206
- return _context15.abrupt("return", errorMessageHandler(_context15.t0, "BASE"));
17133
+ case 11:
17134
+ _context16.prev = 11;
17135
+ _context16.t0 = _context16["catch"](0);
17136
+ return _context16.abrupt("return", errorMessageHandler(_context16.t0, "BASE"));
17207
17137
 
17208
- case 12:
17138
+ case 14:
17209
17139
  case "end":
17210
- return _context15.stop();
17140
+ return _context16.stop();
17211
17141
  }
17212
- }), _callee15, null, [ [ 0, 9 ] ]);
17142
+ }), _callee16, null, [ [ 0, 11 ] ]);
17213
17143
  })));
17214
17144
  return _BASE.apply(this, arguments);
17215
17145
  }
@@ -17217,13 +17147,13 @@ function _typeof(o) {
17217
17147
  return _GNOSIS.apply(this, arguments);
17218
17148
  }
17219
17149
  function _GNOSIS() {
17220
- _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee16() {
17221
- var _argsToArray11, _argsToArray12, type, address, startDate, endDate, _argsToArray12$, page, _argsToArray12$2, limit, apiKey, _args16 = arguments;
17222
- return _regeneratorRuntime().wrap((function _callee16$(_context16) {
17223
- while (1) switch (_context16.prev = _context16.next) {
17150
+ _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
17151
+ var _argsToArray11, _argsToArray12, type, address, startDate, endDate, _argsToArray12$, page, _argsToArray12$2, limit, apiKey, _args17 = arguments;
17152
+ return _regeneratorRuntime().wrap((function _callee17$(_context17) {
17153
+ while (1) switch (_context17.prev = _context17.next) {
17224
17154
  case 0:
17225
- _context16.prev = 0;
17226
- _argsToArray11 = argsToArray(_args16), _argsToArray12 = _slicedToArray(_argsToArray11, 6),
17155
+ _context17.prev = 0;
17156
+ _argsToArray11 = argsToArray(_args17), _argsToArray12 = _slicedToArray(_argsToArray11, 6),
17227
17157
  type = _argsToArray12[0], address = _argsToArray12[1], startDate = _argsToArray12[2],
17228
17158
  endDate = _argsToArray12[3], _argsToArray12$ = _argsToArray12[4], page = _argsToArray12$ === void 0 ? 1 : _argsToArray12$,
17229
17159
  _argsToArray12$2 = _argsToArray12[5], limit = _argsToArray12$2 === void 0 ? 10 : _argsToArray12$2;
@@ -17236,7 +17166,14 @@ function _typeof(o) {
17236
17166
  limit: limit
17237
17167
  });
17238
17168
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Gnosisscan);
17239
- _context16.next = 6;
17169
+ if (apiKey) {
17170
+ _context17.next = 6;
17171
+ break;
17172
+ }
17173
+ throw new MissingApiKeyError(SERVICES_API_KEY.Gnosisscan);
17174
+
17175
+ case 6:
17176
+ _context17.next = 8;
17240
17177
  return handleScanRequest({
17241
17178
  type: type,
17242
17179
  address: address,
@@ -17250,19 +17187,19 @@ function _typeof(o) {
17250
17187
  network: "gnosis"
17251
17188
  });
17252
17189
 
17253
- case 6:
17254
- return _context16.abrupt("return", _context16.sent);
17190
+ case 8:
17191
+ return _context17.abrupt("return", _context17.sent);
17255
17192
 
17256
- case 9:
17257
- _context16.prev = 9;
17258
- _context16.t0 = _context16["catch"](0);
17259
- return _context16.abrupt("return", errorMessageHandler(_context16.t0, "GNOSIS"));
17193
+ case 11:
17194
+ _context17.prev = 11;
17195
+ _context17.t0 = _context17["catch"](0);
17196
+ return _context17.abrupt("return", errorMessageHandler(_context17.t0, "GNOSIS"));
17260
17197
 
17261
- case 12:
17198
+ case 14:
17262
17199
  case "end":
17263
- return _context16.stop();
17200
+ return _context17.stop();
17264
17201
  }
17265
- }), _callee16, null, [ [ 0, 9 ] ]);
17202
+ }), _callee17, null, [ [ 0, 11 ] ]);
17266
17203
  })));
17267
17204
  return _GNOSIS.apply(this, arguments);
17268
17205
  }
@@ -17270,71 +17207,72 @@ function _typeof(o) {
17270
17207
  return _NEYNAR.apply(this, arguments);
17271
17208
  }
17272
17209
  function _NEYNAR() {
17273
- _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
17274
- var neynarParamsSchema, _argsToArray13, _argsToArray14, username, apiKey, fid, url, _getUrlAndHeaders7, finalUrl, HEADERS, response, json, users, _args17 = arguments;
17275
- return _regeneratorRuntime().wrap((function _callee17$(_context17) {
17276
- while (1) switch (_context17.prev = _context17.next) {
17210
+ _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee18() {
17211
+ var neynarParamsSchema, _argsToArray13, _argsToArray14, username, apiKey, fid, url, response, json, users, _args18 = arguments;
17212
+ return _regeneratorRuntime().wrap((function _callee18$(_context18) {
17213
+ while (1) switch (_context18.prev = _context18.next) {
17277
17214
  case 0:
17278
- _context17.prev = 0;
17215
+ _context18.prev = 0;
17279
17216
  neynarParamsSchema = objectType({
17280
17217
  username: stringType().nonempty()
17281
17218
  });
17282
- _argsToArray13 = argsToArray(_args17), _argsToArray14 = _slicedToArray(_argsToArray13, 1),
17219
+ _argsToArray13 = argsToArray(_args18), _argsToArray14 = _slicedToArray(_argsToArray13, 1),
17283
17220
  username = _argsToArray14[0];
17284
17221
  validateParams(neynarParamsSchema, {
17285
17222
  username: username
17286
17223
  });
17287
17224
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Neynar);
17288
- _context17.next = 7;
17289
- return fromUsernameToFid$1.fromUsernameToFid(username, apiKey);
17225
+ if (apiKey) {
17226
+ _context18.next = 7;
17227
+ break;
17228
+ }
17229
+ throw new MissingApiKeyError(SERVICES_API_KEY.Neynar);
17290
17230
 
17291
17231
  case 7:
17292
- fid = _context17.sent;
17232
+ _context18.next = 9;
17233
+ return fromUsernameToFid$1.fromUsernameToFid(username, apiKey);
17234
+
17235
+ case 9:
17236
+ fid = _context18.sent;
17293
17237
  if (fid) {
17294
- _context17.next = 10;
17238
+ _context18.next = 12;
17295
17239
  break;
17296
17240
  }
17297
17241
  throw new ValidationError("Invalid username: ".concat(username));
17298
17242
 
17299
- case 10:
17243
+ case 12:
17300
17244
  url = "https://api.neynar.com/v2/farcaster/followers?fid=".concat(fid);
17301
- _getUrlAndHeaders7 = getUrlAndHeaders({
17302
- url: url.toString(),
17303
- serviceName: "Neynar",
17245
+ _context18.next = 15;
17246
+ return fetch(url, {
17304
17247
  headers: {
17305
17248
  "x-api-key": apiKey,
17306
17249
  "x-neynar-experimental": "false"
17307
17250
  }
17308
- }), finalUrl = _getUrlAndHeaders7.URL, HEADERS = _getUrlAndHeaders7.HEADERS;
17309
- _context17.next = 14;
17310
- return fetch(finalUrl, {
17311
- method: "GET",
17312
- headers: HEADERS
17313
17251
  });
17314
17252
 
17315
- case 14:
17316
- response = _context17.sent;
17253
+ case 15:
17254
+ response = _context18.sent;
17317
17255
  if (response.ok) {
17318
- _context17.next = 17;
17256
+ _context18.next = 18;
17319
17257
  break;
17320
17258
  }
17321
17259
  throw new NetworkError(SERVICES_API_KEY.Neynar, response.status);
17322
17260
 
17323
- case 17:
17324
- _context17.next = 19;
17261
+ case 18:
17262
+ _context18.next = 20;
17325
17263
  return response.json();
17326
17264
 
17327
- case 19:
17328
- json = _context17.sent;
17265
+ case 20:
17266
+ json = _context18.sent;
17329
17267
  users = (json === null || json === void 0 ? void 0 : json.users) || [];
17330
17268
  if (users.length) {
17331
- _context17.next = 23;
17269
+ _context18.next = 24;
17332
17270
  break;
17333
17271
  }
17334
- return _context17.abrupt("return", []);
17272
+ return _context18.abrupt("return", []);
17335
17273
 
17336
- case 23:
17337
- return _context17.abrupt("return", users.map((function(_ref14) {
17274
+ case 24:
17275
+ return _context18.abrupt("return", users.map((function(_ref14) {
17338
17276
  var _user$profile, _user$profile2;
17339
17277
  var user = _ref14.user;
17340
17278
  return {
@@ -17346,16 +17284,16 @@ function _typeof(o) {
17346
17284
  };
17347
17285
  })));
17348
17286
 
17349
- case 26:
17350
- _context17.prev = 26;
17351
- _context17.t0 = _context17["catch"](0);
17352
- return _context17.abrupt("return", errorMessageHandler(_context17.t0, "NEYNAR"));
17287
+ case 27:
17288
+ _context18.prev = 27;
17289
+ _context18.t0 = _context18["catch"](0);
17290
+ return _context18.abrupt("return", errorMessageHandler(_context18.t0, "NEYNAR"));
17353
17291
 
17354
- case 29:
17292
+ case 30:
17355
17293
  case "end":
17356
- return _context17.stop();
17294
+ return _context18.stop();
17357
17295
  }
17358
- }), _callee17, null, [ [ 0, 26 ] ]);
17296
+ }), _callee18, null, [ [ 0, 27 ] ]);
17359
17297
  })));
17360
17298
  return _NEYNAR.apply(this, arguments);
17361
17299
  }
@@ -17363,13 +17301,13 @@ function _typeof(o) {
17363
17301
  return _ETHERSCAN.apply(this, arguments);
17364
17302
  }
17365
17303
  function _ETHERSCAN() {
17366
- _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee18() {
17367
- var _argsToArray15, _argsToArray16, type, chain, address, startDate, endDate, _argsToArray16$, page, _argsToArray16$2, limit, chainId, apiKey, _args18 = arguments;
17368
- return _regeneratorRuntime().wrap((function _callee18$(_context18) {
17369
- while (1) switch (_context18.prev = _context18.next) {
17304
+ _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee19() {
17305
+ var _argsToArray15, _argsToArray16, type, chain, address, startDate, endDate, _argsToArray16$, page, _argsToArray16$2, limit, chainId, apiKey, _args19 = arguments;
17306
+ return _regeneratorRuntime().wrap((function _callee19$(_context19) {
17307
+ while (1) switch (_context19.prev = _context19.next) {
17370
17308
  case 0:
17371
- _context18.prev = 0;
17372
- _argsToArray15 = argsToArray(_args18), _argsToArray16 = _slicedToArray(_argsToArray15, 7),
17309
+ _context19.prev = 0;
17310
+ _argsToArray15 = argsToArray(_args19), _argsToArray16 = _slicedToArray(_argsToArray15, 7),
17373
17311
  type = _argsToArray16[0], chain = _argsToArray16[1], address = _argsToArray16[2],
17374
17312
  startDate = _argsToArray16[3], endDate = _argsToArray16[4], _argsToArray16$ = _argsToArray16[5],
17375
17313
  page = _argsToArray16$ === void 0 ? 1 : _argsToArray16$, _argsToArray16$2 = _argsToArray16[6],
@@ -17385,14 +17323,21 @@ function _typeof(o) {
17385
17323
  });
17386
17324
  chainId = CHAIN_ID_MAP[chain];
17387
17325
  if (chainId) {
17388
- _context18.next = 6;
17326
+ _context19.next = 6;
17389
17327
  break;
17390
17328
  }
17391
17329
  throw new ValidationError("Invalid chain: ".concat(chain));
17392
17330
 
17393
17331
  case 6:
17394
17332
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Etherscan);
17395
- _context18.next = 9;
17333
+ if (apiKey) {
17334
+ _context19.next = 9;
17335
+ break;
17336
+ }
17337
+ throw new MissingApiKeyError(SERVICES_API_KEY.Etherscan);
17338
+
17339
+ case 9:
17340
+ _context19.next = 11;
17396
17341
  return handleScanRequest({
17397
17342
  type: type,
17398
17343
  address: address,
@@ -17406,19 +17351,19 @@ function _typeof(o) {
17406
17351
  network: chain
17407
17352
  });
17408
17353
 
17409
- case 9:
17410
- return _context18.abrupt("return", _context18.sent);
17354
+ case 11:
17355
+ return _context19.abrupt("return", _context19.sent);
17411
17356
 
17412
- case 12:
17413
- _context18.prev = 12;
17414
- _context18.t0 = _context18["catch"](0);
17415
- return _context18.abrupt("return", errorMessageHandler(_context18.t0, "ETHERSCAN"));
17357
+ case 14:
17358
+ _context19.prev = 14;
17359
+ _context19.t0 = _context19["catch"](0);
17360
+ return _context19.abrupt("return", errorMessageHandler(_context19.t0, "ETHERSCAN"));
17416
17361
 
17417
- case 15:
17362
+ case 17:
17418
17363
  case "end":
17419
- return _context18.stop();
17364
+ return _context19.stop();
17420
17365
  }
17421
- }), _callee18, null, [ [ 0, 12 ] ]);
17366
+ }), _callee19, null, [ [ 0, 14 ] ]);
17422
17367
  })));
17423
17368
  return _ETHERSCAN.apply(this, arguments);
17424
17369
  }
@@ -17426,13 +17371,13 @@ function _typeof(o) {
17426
17371
  return _COINGECKO.apply(this, arguments);
17427
17372
  }
17428
17373
  function _COINGECKO() {
17429
- _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee19() {
17430
- var _category$toLowerCase, _argsToArray17, _argsToArray18, category, param1, param2, apiKey, headers, url, vs, map, _category, trend, _category2, _trend, _getUrlAndHeaders8, finalUrl, HEADERS, 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;
17431
- return _regeneratorRuntime().wrap((function _callee19$(_context19) {
17432
- while (1) switch (_context19.prev = _context19.next) {
17374
+ _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20() {
17375
+ 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, _args20 = arguments;
17376
+ return _regeneratorRuntime().wrap((function _callee20$(_context20) {
17377
+ while (1) switch (_context20.prev = _context20.next) {
17433
17378
  case 0:
17434
- _context19.prev = 0;
17435
- _argsToArray17 = argsToArray(_args19), _argsToArray18 = _slicedToArray(_argsToArray17, 3),
17379
+ _context20.prev = 0;
17380
+ _argsToArray17 = argsToArray(_args20), _argsToArray18 = _slicedToArray(_argsToArray17, 3),
17436
17381
  category = _argsToArray18[0], param1 = _argsToArray18[1], param2 = _argsToArray18[2];
17437
17382
  validateParams(coingeckoParamsSchema, {
17438
17383
  category: category,
@@ -17440,21 +17385,28 @@ function _typeof(o) {
17440
17385
  param2: param2
17441
17386
  });
17442
17387
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Coingecko);
17388
+ if (apiKey) {
17389
+ _context20.next = 6;
17390
+ break;
17391
+ }
17392
+ throw new MissingApiKeyError(SERVICES_API_KEY.Coingecko);
17393
+
17394
+ case 6:
17443
17395
  headers = {
17444
17396
  accept: "application/json",
17445
17397
  "x-cg-demo-api-key": apiKey
17446
17398
  };
17447
17399
  url = "";
17448
- _context19.t0 = category === null || category === void 0 || (_category$toLowerCase = category.toLowerCase) === null || _category$toLowerCase === void 0 ? void 0 : _category$toLowerCase.call(category);
17449
- _context19.next = _context19.t0 === "price" ? 9 : _context19.t0 === "market" ? 12 : _context19.t0 === "stablecoins" ? 17 : _context19.t0 === "derivatives" ? 21 : 23;
17400
+ _context20.t0 = category === null || category === void 0 || (_category$toLowerCase = category.toLowerCase) === null || _category$toLowerCase === void 0 ? void 0 : _category$toLowerCase.call(category);
17401
+ _context20.next = _context20.t0 === "price" ? 11 : _context20.t0 === "market" ? 14 : _context20.t0 === "stablecoins" ? 19 : _context20.t0 === "derivatives" ? 23 : 25;
17450
17402
  break;
17451
17403
 
17452
- case 9:
17404
+ case 11:
17453
17405
  vs = param2 || "usd";
17454
17406
  url = "https://api.coingecko.com/api/v3/simple/price?vs_currencies=".concat(vs, "&symbols=").concat(param1);
17455
- return _context19.abrupt("break", 23);
17407
+ return _context20.abrupt("break", 25);
17456
17408
 
17457
- case 12:
17409
+ case 14:
17458
17410
  map = {
17459
17411
  all: "",
17460
17412
  base: "base-ecosystem",
@@ -17469,53 +17421,48 @@ function _typeof(o) {
17469
17421
  _category = map[param1] || "";
17470
17422
  trend = param2 ? "&price_change_percentage=".concat(param2) : "";
17471
17423
  url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=1&per_page=100".concat(_category ? "&category=".concat(_category) : "").concat(trend);
17472
- return _context19.abrupt("break", 23);
17424
+ return _context20.abrupt("break", 25);
17473
17425
 
17474
- case 17:
17426
+ case 19:
17475
17427
  _category2 = param1 === "all" ? "stablecoins" : param1;
17476
17428
  _trend = param2 ? "&price_change_percentage=".concat(param2) : "";
17477
17429
  url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&category=".concat(_category2, "&order=market_cap_desc&page=1&per_page=100").concat(_trend);
17478
- return _context19.abrupt("break", 23);
17430
+ return _context20.abrupt("break", 25);
17479
17431
 
17480
- case 21:
17432
+ case 23:
17481
17433
  url = !param1 || param1 === "all" ? "https://api.coingecko.com/api/v3/derivatives" : "https://api.coingecko.com/api/v3/derivatives/exchanges/".concat(param1, "?include_tickers=all");
17482
- return _context19.abrupt("break", 23);
17434
+ return _context20.abrupt("break", 25);
17483
17435
 
17484
- case 23:
17485
- _getUrlAndHeaders8 = getUrlAndHeaders({
17486
- url: url,
17487
- serviceName: "Coingecko",
17436
+ case 25:
17437
+ _context20.next = 27;
17438
+ return fetch(url, {
17488
17439
  headers: headers
17489
- }), finalUrl = _getUrlAndHeaders8.URL, HEADERS = _getUrlAndHeaders8.HEADERS;
17490
- _context19.next = 26;
17491
- return fetch(finalUrl, {
17492
- headers: HEADERS
17493
17440
  });
17494
17441
 
17495
- case 26:
17496
- res = _context19.sent;
17497
- _context19.next = 29;
17442
+ case 27:
17443
+ res = _context20.sent;
17444
+ _context20.next = 30;
17498
17445
  return res.json();
17499
17446
 
17500
- case 29:
17501
- json = _context19.sent;
17447
+ case 30:
17448
+ json = _context20.sent;
17502
17449
  if (res.ok) {
17503
- _context19.next = 35;
17450
+ _context20.next = 36;
17504
17451
  break;
17505
17452
  }
17506
17453
  msg = (json === null || json === void 0 || (_json$status = json.status) === null || _json$status === void 0 ? void 0 : _json$status.error_message) || "";
17507
17454
  if (!msg.includes("API Key Missing")) {
17508
- _context19.next = 34;
17455
+ _context20.next = 35;
17509
17456
  break;
17510
17457
  }
17511
17458
  throw new InvalidApiKeyError(SERVICES_API_KEY.Coingecko);
17512
17459
 
17513
- case 34:
17460
+ case 35:
17514
17461
  throw new NetworkError(SERVICES_API_KEY.Coingecko, res.status);
17515
17462
 
17516
- case 35:
17463
+ case 36:
17517
17464
  if (!(category === "price")) {
17518
- _context19.next = 39;
17465
+ _context20.next = 40;
17519
17466
  break;
17520
17467
  }
17521
17468
  out = {};
@@ -17528,11 +17475,11 @@ function _typeof(o) {
17528
17475
  out["".concat(token.charAt(0).toUpperCase() + token.slice(1), "_").concat(cur.toUpperCase())] = val;
17529
17476
  }
17530
17477
  }
17531
- return _context19.abrupt("return", [ out ]);
17478
+ return _context20.abrupt("return", [ out ]);
17532
17479
 
17533
- case 39:
17480
+ case 40:
17534
17481
  _data4 = Array.isArray(json) ? json : [ json ];
17535
- return _context19.abrupt("return", _data4.map((function(item) {
17482
+ return _context20.abrupt("return", _data4.map((function(item) {
17536
17483
  var flat = {};
17537
17484
  for (var _i15 = 0, _Object$entries6 = Object.entries(item); _i15 < _Object$entries6.length; _i15++) {
17538
17485
  var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i15], 2), key = _Object$entries6$_i[0], _value13 = _Object$entries6$_i[1];
@@ -17543,16 +17490,16 @@ function _typeof(o) {
17543
17490
  return flat;
17544
17491
  })));
17545
17492
 
17546
- case 43:
17547
- _context19.prev = 43;
17548
- _context19.t1 = _context19["catch"](0);
17549
- return _context19.abrupt("return", errorMessageHandler(_context19.t1, "COINGECKO"));
17493
+ case 44:
17494
+ _context20.prev = 44;
17495
+ _context20.t1 = _context20["catch"](0);
17496
+ return _context20.abrupt("return", errorMessageHandler(_context20.t1, "COINGECKO"));
17550
17497
 
17551
- case 46:
17498
+ case 47:
17552
17499
  case "end":
17553
- return _context19.stop();
17500
+ return _context20.stop();
17554
17501
  }
17555
- }), _callee19, null, [ [ 0, 43 ] ]);
17502
+ }), _callee20, null, [ [ 0, 44 ] ]);
17556
17503
  })));
17557
17504
  return _COINGECKO.apply(this, arguments);
17558
17505
  }
@@ -17560,74 +17507,66 @@ function _typeof(o) {
17560
17507
  return _EOA.apply(this, arguments);
17561
17508
  }
17562
17509
  function _EOA() {
17563
- _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee21() {
17564
- var fetchJSON, _argsToArray19, _argsToArray20, addresses, category, chains, startTime, endTime, _argsToArray20$, page, _argsToArray20$2, offset, apiKey, INPUTS, CHAINS, ADDRESS_MAP, _iterator41, _step41, inp, ens, resolved, ADDRS, out, _iterator42, _step42, _loop, _ret, _args24 = arguments;
17565
- return _regeneratorRuntime().wrap((function _callee21$(_context24) {
17566
- while (1) switch (_context24.prev = _context24.next) {
17510
+ _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee22() {
17511
+ var fetchJSON, _argsToArray19, _argsToArray20, addresses, category, chains, startTime, endTime, _argsToArray20$, page, _argsToArray20$2, offset, apiKey, INPUTS, CHAINS, ADDRESS_MAP, _iterator41, _step41, inp, _address, ADDRS, out, _iterator42, _step42, _loop, _ret, _args25 = arguments;
17512
+ return _regeneratorRuntime().wrap((function _callee22$(_context25) {
17513
+ while (1) switch (_context25.prev = _context25.next) {
17567
17514
  case 0:
17568
- _context24.prev = 0;
17515
+ _context25.prev = 0;
17569
17516
  fetchJSON = function() {
17570
- var _ref15 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20(url) {
17571
- var _getUrlAndHeaders9, finalUrl, HEADERS, res, json;
17572
- return _regeneratorRuntime().wrap((function _callee20$(_context20) {
17573
- while (1) switch (_context20.prev = _context20.next) {
17517
+ var _ref15 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee21(url) {
17518
+ var res, json;
17519
+ return _regeneratorRuntime().wrap((function _callee21$(_context21) {
17520
+ while (1) switch (_context21.prev = _context21.next) {
17574
17521
  case 0:
17575
- _getUrlAndHeaders9 = getUrlAndHeaders({
17576
- url: url,
17577
- serviceName: "Etherscan",
17578
- headers: {}
17579
- }), finalUrl = _getUrlAndHeaders9.URL, HEADERS = _getUrlAndHeaders9.HEADERS;
17580
- _context20.next = 3;
17581
- return fetch(finalUrl, {
17582
- method: "GET",
17583
- headers: HEADERS
17584
- });
17522
+ _context21.next = 2;
17523
+ return fetch(url);
17585
17524
 
17586
- case 3:
17587
- res = _context20.sent;
17525
+ case 2:
17526
+ res = _context21.sent;
17588
17527
  if (res.ok) {
17589
- _context20.next = 6;
17528
+ _context21.next = 5;
17590
17529
  break;
17591
17530
  }
17592
17531
  throw new NetworkError(SERVICES_API_KEY.Etherscan, res.status);
17593
17532
 
17594
- case 6:
17595
- _context20.next = 8;
17533
+ case 5:
17534
+ _context21.next = 7;
17596
17535
  return res.json();
17597
17536
 
17598
- case 8:
17599
- json = _context20.sent;
17537
+ case 7:
17538
+ json = _context21.sent;
17600
17539
  if (!(typeof json.result === "string")) {
17601
- _context20.next = 14;
17540
+ _context21.next = 13;
17602
17541
  break;
17603
17542
  }
17604
17543
  if (!json.result.includes("Invalid API Key")) {
17605
- _context20.next = 12;
17544
+ _context21.next = 11;
17606
17545
  break;
17607
17546
  }
17608
17547
  throw new InvalidApiKeyError(SERVICES_API_KEY.Etherscan);
17609
17548
 
17610
- case 12:
17549
+ case 11:
17611
17550
  if (!json.result.includes("Max rate limit reached")) {
17612
- _context20.next = 14;
17551
+ _context21.next = 13;
17613
17552
  break;
17614
17553
  }
17615
17554
  throw new RateLimitError(SERVICES_API_KEY.Etherscan);
17616
17555
 
17617
- case 14:
17618
- return _context20.abrupt("return", json.result);
17556
+ case 13:
17557
+ return _context21.abrupt("return", json.result);
17619
17558
 
17620
- case 15:
17559
+ case 14:
17621
17560
  case "end":
17622
- return _context20.stop();
17561
+ return _context21.stop();
17623
17562
  }
17624
- }), _callee20);
17563
+ }), _callee21);
17625
17564
  })));
17626
- return function fetchJSON(_x17) {
17565
+ return function fetchJSON(_x18) {
17627
17566
  return _ref15.apply(this, arguments);
17628
17567
  };
17629
17568
  }();
17630
- _argsToArray19 = argsToArray(_args24), _argsToArray20 = _slicedToArray(_argsToArray19, 7),
17569
+ _argsToArray19 = argsToArray(_args25), _argsToArray20 = _slicedToArray(_argsToArray19, 7),
17631
17570
  addresses = _argsToArray20[0], category = _argsToArray20[1], chains = _argsToArray20[2],
17632
17571
  startTime = _argsToArray20[3], endTime = _argsToArray20[4], _argsToArray20$ = _argsToArray20[5],
17633
17572
  page = _argsToArray20$ === void 0 ? 1 : _argsToArray20$, _argsToArray20$2 = _argsToArray20[6],
@@ -17642,6 +17581,13 @@ function _typeof(o) {
17642
17581
  offset: offset
17643
17582
  });
17644
17583
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Etherscan);
17584
+ if (apiKey) {
17585
+ _context25.next = 7;
17586
+ break;
17587
+ }
17588
+ throw new MissingApiKeyError(SERVICES_API_KEY.Etherscan);
17589
+
17590
+ case 7:
17645
17591
  INPUTS = addresses.split(",").map((function(s) {
17646
17592
  return s.trim();
17647
17593
  })).filter(Boolean);
@@ -17650,97 +17596,89 @@ function _typeof(o) {
17650
17596
  })).filter(Boolean);
17651
17597
  ADDRESS_MAP = {};
17652
17598
  _iterator41 = _createForOfIteratorHelper(INPUTS);
17653
- _context24.prev = 9;
17599
+ _context25.prev = 11;
17654
17600
  _iterator41.s();
17655
17601
 
17656
- case 11:
17602
+ case 13:
17657
17603
  if ((_step41 = _iterator41.n()).done) {
17658
- _context24.next = 26;
17604
+ _context25.next = 25;
17659
17605
  break;
17660
17606
  }
17661
17607
  inp = _step41.value;
17662
17608
  if (!isAddress$1.isAddress(inp)) {
17663
- _context24.next = 17;
17609
+ _context25.next = 19;
17664
17610
  break;
17665
17611
  }
17666
17612
  ADDRESS_MAP[inp.toLowerCase()] = null;
17667
- _context24.next = 24;
17613
+ _context25.next = 23;
17668
17614
  break;
17669
17615
 
17670
- case 17:
17671
- ens = inp;
17672
- _context24.next = 20;
17673
- return fromEnsNameToAddress$1.fromEnsNameToAddress(ens);
17616
+ case 19:
17617
+ _context25.next = 21;
17618
+ return fromEnsNameToAddress$1.validateAndGetAddress(inp);
17674
17619
 
17675
- case 20:
17676
- resolved = _context24.sent;
17677
- if (resolved) {
17678
- _context24.next = 23;
17679
- break;
17680
- }
17681
- throw new EnsError(ens);
17620
+ case 21:
17621
+ _address = _context25.sent;
17622
+ ADDRESS_MAP[_address.toLowerCase()] = _address;
17682
17623
 
17683
17624
  case 23:
17684
- ADDRESS_MAP[resolved.toLowerCase()] = ens;
17685
-
17686
- case 24:
17687
- _context24.next = 11;
17625
+ _context25.next = 13;
17688
17626
  break;
17689
17627
 
17690
- case 26:
17691
- _context24.next = 31;
17628
+ case 25:
17629
+ _context25.next = 30;
17692
17630
  break;
17693
17631
 
17694
- case 28:
17695
- _context24.prev = 28;
17696
- _context24.t0 = _context24["catch"](9);
17697
- _iterator41.e(_context24.t0);
17632
+ case 27:
17633
+ _context25.prev = 27;
17634
+ _context25.t0 = _context25["catch"](11);
17635
+ _iterator41.e(_context25.t0);
17698
17636
 
17699
- case 31:
17700
- _context24.prev = 31;
17637
+ case 30:
17638
+ _context25.prev = 30;
17701
17639
  _iterator41.f();
17702
- return _context24.finish(31);
17640
+ return _context25.finish(30);
17703
17641
 
17704
- case 34:
17642
+ case 33:
17705
17643
  ADDRS = Object.keys(ADDRESS_MAP);
17706
17644
  out = [];
17707
17645
  _iterator42 = _createForOfIteratorHelper(CHAINS);
17708
- _context24.prev = 37;
17646
+ _context25.prev = 36;
17709
17647
  _loop = _regeneratorRuntime().mark((function _loop() {
17710
17648
  var chain, chainId, _loop2, _ret2, i, sb, eb, _loop3, _ret3, _i16, _ADDRS;
17711
- return _regeneratorRuntime().wrap((function _loop$(_context23) {
17712
- while (1) switch (_context23.prev = _context23.next) {
17649
+ return _regeneratorRuntime().wrap((function _loop$(_context24) {
17650
+ while (1) switch (_context24.prev = _context24.next) {
17713
17651
  case 0:
17714
17652
  chain = _step42.value;
17715
17653
  chainId = CHAIN_ID_MAP[chain];
17716
17654
  if (chainId) {
17717
- _context23.next = 4;
17655
+ _context24.next = 4;
17718
17656
  break;
17719
17657
  }
17720
17658
  throw new ValidationError("Invalid chain: ".concat(chain));
17721
17659
 
17722
17660
  case 4:
17723
17661
  if (!(category === "balance")) {
17724
- _context23.next = 17;
17662
+ _context24.next = 17;
17725
17663
  break;
17726
17664
  }
17727
17665
  _loop2 = _regeneratorRuntime().mark((function _loop2(i) {
17728
17666
  var slice, url, data;
17729
- return _regeneratorRuntime().wrap((function _loop2$(_context21) {
17730
- while (1) switch (_context21.prev = _context21.next) {
17667
+ return _regeneratorRuntime().wrap((function _loop2$(_context22) {
17668
+ while (1) switch (_context22.prev = _context22.next) {
17731
17669
  case 0:
17732
17670
  slice = ADDRS.slice(i, i + 20).join(",");
17733
17671
  url = "https://api.etherscan.io/v2/api?chainid=".concat(chainId) + "&module=account&action=addresstokenbalance&address=".concat(slice) + "&page=".concat(page, "&offset=").concat(offset, "&apikey=").concat(apiKey);
17734
- _context21.next = 4;
17672
+ _context22.next = 4;
17735
17673
  return fetchJSON(url);
17736
17674
 
17737
17675
  case 4:
17738
- data = _context21.sent;
17676
+ data = _context22.sent;
17739
17677
  if (Array.isArray(data)) {
17740
- _context21.next = 7;
17678
+ _context22.next = 7;
17741
17679
  break;
17742
17680
  }
17743
- return _context21.abrupt("return", {
17681
+ return _context22.abrupt("return", {
17744
17682
  v: {
17745
17683
  v: data
17746
17684
  }
@@ -17757,7 +17695,7 @@ function _typeof(o) {
17757
17695
 
17758
17696
  case 8:
17759
17697
  case "end":
17760
- return _context21.stop();
17698
+ return _context22.stop();
17761
17699
  }
17762
17700
  }), _loop2);
17763
17701
  }));
@@ -17765,48 +17703,48 @@ function _typeof(o) {
17765
17703
 
17766
17704
  case 7:
17767
17705
  if (!(i < ADDRS.length)) {
17768
- _context23.next = 15;
17706
+ _context24.next = 15;
17769
17707
  break;
17770
17708
  }
17771
- return _context23.delegateYield(_loop2(i), "t0", 9);
17709
+ return _context24.delegateYield(_loop2(i), "t0", 9);
17772
17710
 
17773
17711
  case 9:
17774
- _ret2 = _context23.t0;
17712
+ _ret2 = _context24.t0;
17775
17713
  if (!_ret2) {
17776
- _context23.next = 12;
17714
+ _context24.next = 12;
17777
17715
  break;
17778
17716
  }
17779
- return _context23.abrupt("return", _ret2.v);
17717
+ return _context24.abrupt("return", _ret2.v);
17780
17718
 
17781
17719
  case 12:
17782
17720
  i += 20;
17783
- _context23.next = 7;
17721
+ _context24.next = 7;
17784
17722
  break;
17785
17723
 
17786
17724
  case 15:
17787
- _context23.next = 37;
17725
+ _context24.next = 37;
17788
17726
  break;
17789
17727
 
17790
17728
  case 17:
17791
- _context23.next = 19;
17729
+ _context24.next = 19;
17792
17730
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startTime), chain, apiKey);
17793
17731
 
17794
17732
  case 19:
17795
- sb = _context23.sent;
17796
- _context23.next = 22;
17733
+ sb = _context24.sent;
17734
+ _context24.next = 22;
17797
17735
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endTime), chain, apiKey);
17798
17736
 
17799
17737
  case 22:
17800
- eb = _context23.sent;
17738
+ eb = _context24.sent;
17801
17739
  if (sb) {
17802
- _context23.next = 25;
17740
+ _context24.next = 25;
17803
17741
  break;
17804
17742
  }
17805
17743
  throw new ValidationError("Invalid startTime: ".concat(startTime));
17806
17744
 
17807
17745
  case 25:
17808
17746
  if (eb) {
17809
- _context23.next = 27;
17747
+ _context24.next = 27;
17810
17748
  break;
17811
17749
  }
17812
17750
  throw new ValidationError("Invalid endTime: ".concat(endTime));
@@ -17814,21 +17752,21 @@ function _typeof(o) {
17814
17752
  case 27:
17815
17753
  _loop3 = _regeneratorRuntime().mark((function _loop3() {
17816
17754
  var addr, url, data;
17817
- return _regeneratorRuntime().wrap((function _loop3$(_context22) {
17818
- while (1) switch (_context22.prev = _context22.next) {
17755
+ return _regeneratorRuntime().wrap((function _loop3$(_context23) {
17756
+ while (1) switch (_context23.prev = _context23.next) {
17819
17757
  case 0:
17820
17758
  addr = _ADDRS[_i16];
17821
17759
  url = "https://api.etherscan.io/v2/api?chainid=".concat(chainId) + "&module=account&action=tokentx&address=".concat(addr) + "&startblock=".concat(sb, "&endblock=").concat(eb) + "&page=".concat(page, "&offset=").concat(offset, "&sort=asc&apikey=").concat(apiKey);
17822
- _context22.next = 4;
17760
+ _context23.next = 4;
17823
17761
  return fetchJSON(url);
17824
17762
 
17825
17763
  case 4:
17826
- data = _context22.sent;
17764
+ data = _context23.sent;
17827
17765
  if (Array.isArray(data)) {
17828
- _context22.next = 7;
17766
+ _context23.next = 7;
17829
17767
  break;
17830
17768
  }
17831
- return _context22.abrupt("return", {
17769
+ return _context23.abrupt("return", {
17832
17770
  v: {
17833
17771
  v: data
17834
17772
  }
@@ -17845,7 +17783,7 @@ function _typeof(o) {
17845
17783
 
17846
17784
  case 8:
17847
17785
  case "end":
17848
- return _context22.stop();
17786
+ return _context23.stop();
17849
17787
  }
17850
17788
  }), _loop3);
17851
17789
  }));
@@ -17853,90 +17791,90 @@ function _typeof(o) {
17853
17791
 
17854
17792
  case 29:
17855
17793
  if (!(_i16 < _ADDRS.length)) {
17856
- _context23.next = 37;
17794
+ _context24.next = 37;
17857
17795
  break;
17858
17796
  }
17859
- return _context23.delegateYield(_loop3(), "t1", 31);
17797
+ return _context24.delegateYield(_loop3(), "t1", 31);
17860
17798
 
17861
17799
  case 31:
17862
- _ret3 = _context23.t1;
17800
+ _ret3 = _context24.t1;
17863
17801
  if (!_ret3) {
17864
- _context23.next = 34;
17802
+ _context24.next = 34;
17865
17803
  break;
17866
17804
  }
17867
- return _context23.abrupt("return", _ret3.v);
17805
+ return _context24.abrupt("return", _ret3.v);
17868
17806
 
17869
17807
  case 34:
17870
17808
  _i16++;
17871
- _context23.next = 29;
17809
+ _context24.next = 29;
17872
17810
  break;
17873
17811
 
17874
17812
  case 37:
17875
17813
  case "end":
17876
- return _context23.stop();
17814
+ return _context24.stop();
17877
17815
  }
17878
17816
  }), _loop);
17879
17817
  }));
17880
17818
  _iterator42.s();
17881
17819
 
17882
- case 40:
17820
+ case 39:
17883
17821
  if ((_step42 = _iterator42.n()).done) {
17884
- _context24.next = 47;
17822
+ _context25.next = 46;
17885
17823
  break;
17886
17824
  }
17887
- return _context24.delegateYield(_loop(), "t1", 42);
17825
+ return _context25.delegateYield(_loop(), "t1", 41);
17888
17826
 
17889
- case 42:
17890
- _ret = _context24.t1;
17827
+ case 41:
17828
+ _ret = _context25.t1;
17891
17829
  if (!_ret) {
17892
- _context24.next = 45;
17830
+ _context25.next = 44;
17893
17831
  break;
17894
17832
  }
17895
- return _context24.abrupt("return", _ret.v);
17833
+ return _context25.abrupt("return", _ret.v);
17896
17834
 
17897
- case 45:
17898
- _context24.next = 40;
17835
+ case 44:
17836
+ _context25.next = 39;
17899
17837
  break;
17900
17838
 
17901
- case 47:
17902
- _context24.next = 52;
17839
+ case 46:
17840
+ _context25.next = 51;
17903
17841
  break;
17904
17842
 
17905
- case 49:
17906
- _context24.prev = 49;
17907
- _context24.t2 = _context24["catch"](37);
17908
- _iterator42.e(_context24.t2);
17843
+ case 48:
17844
+ _context25.prev = 48;
17845
+ _context25.t2 = _context25["catch"](36);
17846
+ _iterator42.e(_context25.t2);
17909
17847
 
17910
- case 52:
17911
- _context24.prev = 52;
17848
+ case 51:
17849
+ _context25.prev = 51;
17912
17850
  _iterator42.f();
17913
- return _context24.finish(52);
17851
+ return _context25.finish(51);
17914
17852
 
17915
- case 55:
17916
- return _context24.abrupt("return", out);
17853
+ case 54:
17854
+ return _context25.abrupt("return", out);
17917
17855
 
17918
- case 58:
17919
- _context24.prev = 58;
17920
- _context24.t3 = _context24["catch"](0);
17921
- return _context24.abrupt("return", errorMessageHandler(_context24.t3, "EOA"));
17856
+ case 57:
17857
+ _context25.prev = 57;
17858
+ _context25.t3 = _context25["catch"](0);
17859
+ return _context25.abrupt("return", errorMessageHandler(_context25.t3, "EOA"));
17922
17860
 
17923
- case 61:
17861
+ case 60:
17924
17862
  case "end":
17925
- return _context24.stop();
17863
+ return _context25.stop();
17926
17864
  }
17927
- }), _callee21, null, [ [ 0, 58 ], [ 9, 28, 31, 34 ], [ 37, 49, 52, 55 ] ]);
17865
+ }), _callee22, null, [ [ 0, 57 ], [ 11, 27, 30, 33 ], [ 36, 48, 51, 54 ] ]);
17928
17866
  })));
17929
17867
  return _EOA.apply(this, arguments);
17930
17868
  }
17931
- function FLVURL(_x15, _x16) {
17869
+ function FLVURL(_x16, _x17) {
17932
17870
  return _FLVURL.apply(this, arguments);
17933
17871
  }
17934
17872
  function _FLVURL() {
17935
- _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee22(token, vs_currencies) {
17936
- return _regeneratorRuntime().wrap((function _callee22$(_context25) {
17937
- while (1) switch (_context25.prev = _context25.next) {
17873
+ _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee23(token, vs_currencies) {
17874
+ return _regeneratorRuntime().wrap((function _callee23$(_context26) {
17875
+ while (1) switch (_context26.prev = _context26.next) {
17938
17876
  case 0:
17939
- return _context25.abrupt("return", new Promise((function(resolve) {
17877
+ return _context26.abrupt("return", new Promise((function(resolve) {
17940
17878
  setTimeout((function() {
17941
17879
  resolve([ {
17942
17880
  Yoo: "gotcha"
@@ -17946,9 +17884,9 @@ function _typeof(o) {
17946
17884
 
17947
17885
  case 1:
17948
17886
  case "end":
17949
- return _context25.stop();
17887
+ return _context26.stop();
17950
17888
  }
17951
- }), _callee22);
17889
+ }), _callee23);
17952
17890
  })));
17953
17891
  return _FLVURL.apply(this, arguments);
17954
17892
  }
@@ -17956,13 +17894,13 @@ function _typeof(o) {
17956
17894
  return _SAFE.apply(this, arguments);
17957
17895
  }
17958
17896
  function _SAFE() {
17959
- _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee23() {
17960
- var _argsToArray21, _argsToArray22, address, utility, chain, _argsToArray22$, limit, _argsToArray22$2, offset, apiKey, chainId, resolved, ens, url, _getUrlAndHeaders0, finalUrl, HEADERS, res, json, _args26 = arguments;
17961
- return _regeneratorRuntime().wrap((function _callee23$(_context26) {
17962
- while (1) switch (_context26.prev = _context26.next) {
17897
+ _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee24() {
17898
+ var _argsToArray21, _argsToArray22, address, utility, chain, _argsToArray22$, limit, _argsToArray22$2, offset, apiKey, chainId, resolved, url, res, json, _args27 = arguments;
17899
+ return _regeneratorRuntime().wrap((function _callee24$(_context27) {
17900
+ while (1) switch (_context27.prev = _context27.next) {
17963
17901
  case 0:
17964
- _context26.prev = 0;
17965
- _argsToArray21 = argsToArray(_args26), _argsToArray22 = _slicedToArray(_argsToArray21, 5),
17902
+ _context27.prev = 0;
17903
+ _argsToArray21 = argsToArray(_args27), _argsToArray22 = _slicedToArray(_argsToArray21, 5),
17966
17904
  address = _argsToArray22[0], utility = _argsToArray22[1], chain = _argsToArray22[2],
17967
17905
  _argsToArray22$ = _argsToArray22[3], limit = _argsToArray22$ === void 0 ? 10 : _argsToArray22$,
17968
17906
  _argsToArray22$2 = _argsToArray22[4], offset = _argsToArray22$2 === void 0 ? 0 : _argsToArray22$2;
@@ -17974,81 +17912,70 @@ function _typeof(o) {
17974
17912
  offset: offset
17975
17913
  });
17976
17914
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Safe);
17977
- chainId = SAFE_CHAIN_MAP[chain];
17978
- if (chainId) {
17979
- _context26.next = 7;
17915
+ if (apiKey) {
17916
+ _context27.next = 6;
17980
17917
  break;
17981
17918
  }
17982
- throw new ValidationError("Invalid chain: ".concat(chain));
17919
+ throw new MissingApiKeyError(SERVICES_API_KEY.Safe);
17983
17920
 
17984
- case 7:
17985
- resolved = address;
17986
- if (isAddress$1.isAddress(resolved)) {
17987
- _context26.next = 15;
17921
+ case 6:
17922
+ chainId = SAFE_CHAIN_MAP[chain];
17923
+ if (chainId) {
17924
+ _context27.next = 9;
17988
17925
  break;
17989
17926
  }
17990
- ens = resolved;
17991
- _context26.next = 12;
17992
- return fromEnsNameToAddress$1.fromEnsNameToAddress(ens);
17927
+ throw new ValidationError("Invalid chain: ".concat(chain));
17993
17928
 
17994
- case 12:
17995
- resolved = _context26.sent;
17996
- if (resolved) {
17997
- _context26.next = 15;
17998
- break;
17999
- }
18000
- throw new EnsError(ens);
17929
+ case 9:
17930
+ _context27.next = 11;
17931
+ return fromEnsNameToAddress$1.validateAndGetAddress(address);
18001
17932
 
18002
- case 15:
17933
+ case 11:
17934
+ resolved = _context27.sent;
18003
17935
  url = "https://api.safe.global/tx-service/".concat(chainId, "/api/v2/safes/").concat(resolved, "/multisig-transactions?limit=").concat(limit, "&offset=").concat(offset);
18004
- _getUrlAndHeaders0 = getUrlAndHeaders({
18005
- url: url,
18006
- serviceName: "Etherscan",
17936
+ _context27.next = 15;
17937
+ return fetch(url, {
18007
17938
  headers: {
18008
17939
  Authorization: "Bearer ".concat(apiKey)
18009
17940
  }
18010
- }), finalUrl = _getUrlAndHeaders0.URL, HEADERS = _getUrlAndHeaders0.HEADERS;
18011
- _context26.next = 19;
18012
- return fetch(finalUrl, {
18013
- headers: HEADERS
18014
17941
  });
18015
17942
 
18016
- case 19:
18017
- res = _context26.sent;
17943
+ case 15:
17944
+ res = _context27.sent;
18018
17945
  if (res.ok) {
18019
- _context26.next = 22;
17946
+ _context27.next = 18;
18020
17947
  break;
18021
17948
  }
18022
17949
  throw new NetworkError(SERVICES_API_KEY.Safe, res.status);
18023
17950
 
18024
- case 22:
18025
- _context26.next = 24;
17951
+ case 18:
17952
+ _context27.next = 20;
18026
17953
  return res.json();
18027
17954
 
18028
- case 24:
18029
- json = _context26.sent;
17955
+ case 20:
17956
+ json = _context27.sent;
18030
17957
  if (Array.isArray(json.results)) {
18031
- _context26.next = 27;
17958
+ _context27.next = 23;
18032
17959
  break;
18033
17960
  }
18034
17961
  throw new ValidationError("Invalid API response");
18035
17962
 
18036
- case 27:
18037
- return _context26.abrupt("return", json.results.map((function(_ref16) {
17963
+ case 23:
17964
+ return _context27.abrupt("return", json.results.map((function(_ref16) {
18038
17965
  var confirmations = _ref16.confirmations, dataDecoded = _ref16.dataDecoded, rest = _objectWithoutProperties(_ref16, _excluded);
18039
17966
  return rest;
18040
17967
  })));
18041
17968
 
18042
- case 30:
18043
- _context26.prev = 30;
18044
- _context26.t0 = _context26["catch"](0);
18045
- return _context26.abrupt("return", errorMessageHandler(_context26.t0, "SAFE"));
17969
+ case 26:
17970
+ _context27.prev = 26;
17971
+ _context27.t0 = _context27["catch"](0);
17972
+ return _context27.abrupt("return", errorMessageHandler(_context27.t0, "SAFE"));
18046
17973
 
18047
- case 33:
17974
+ case 29:
18048
17975
  case "end":
18049
- return _context26.stop();
17976
+ return _context27.stop();
18050
17977
  }
18051
- }), _callee23, null, [ [ 0, 30 ] ]);
17978
+ }), _callee24, null, [ [ 0, 26 ] ]);
18052
17979
  })));
18053
17980
  return _SAFE.apply(this, arguments);
18054
17981
  }
@@ -18056,61 +17983,68 @@ function _typeof(o) {
18056
17983
  return _DEFILLAMA.apply(this, arguments);
18057
17984
  }
18058
17985
  function _DEFILLAMA() {
18059
- _DEFILLAMA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee24() {
18060
- var _argsToArray23, _argsToArray24, category, apiKey, url, res, json, _args27 = arguments;
18061
- return _regeneratorRuntime().wrap((function _callee24$(_context27) {
18062
- while (1) switch (_context27.prev = _context27.next) {
17986
+ _DEFILLAMA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee25() {
17987
+ var _argsToArray23, _argsToArray24, category, apiKey, url, res, json, _args28 = arguments;
17988
+ return _regeneratorRuntime().wrap((function _callee25$(_context28) {
17989
+ while (1) switch (_context28.prev = _context28.next) {
18063
17990
  case 0:
18064
- _context27.prev = 0;
18065
- _argsToArray23 = argsToArray(_args27), _argsToArray24 = _slicedToArray(_argsToArray23, 1),
17991
+ _context28.prev = 0;
17992
+ _argsToArray23 = argsToArray(_args28), _argsToArray24 = _slicedToArray(_argsToArray23, 1),
18066
17993
  category = _argsToArray24[0];
18067
17994
  validateParams(defillamaParamsSchema, {
18068
17995
  category: category
18069
17996
  });
18070
17997
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Defillama);
17998
+ if (apiKey) {
17999
+ _context28.next = 6;
18000
+ break;
18001
+ }
18002
+ throw new MissingApiKeyError(SERVICES_API_KEY.Defillama);
18003
+
18004
+ case 6:
18071
18005
  url = CATEGORY_URLS[category];
18072
18006
  if (url) {
18073
- _context27.next = 7;
18007
+ _context28.next = 9;
18074
18008
  break;
18075
18009
  }
18076
18010
  throw new ValidationError("Invalid category: ".concat(category));
18077
18011
 
18078
- case 7:
18079
- _context27.next = 9;
18012
+ case 9:
18013
+ _context28.next = 11;
18080
18014
  return fetch(url);
18081
18015
 
18082
- case 9:
18083
- res = _context27.sent;
18016
+ case 11:
18017
+ res = _context28.sent;
18084
18018
  if (res.ok) {
18085
- _context27.next = 12;
18019
+ _context28.next = 14;
18086
18020
  break;
18087
18021
  }
18088
18022
  throw new NetworkError(SERVICES_API_KEY.Defillama, res.status);
18089
18023
 
18090
- case 12:
18091
- _context27.next = 14;
18024
+ case 14:
18025
+ _context28.next = 16;
18092
18026
  return res.json();
18093
18027
 
18094
- case 14:
18095
- json = _context27.sent;
18096
- _context27.t0 = category;
18097
- _context27.next = _context27.t0 === "protocols" ? 18 : _context27.t0 === "yields" ? 20 : _context27.t0 === "dex" ? 22 : _context27.t0 === "fees" ? 22 : 24;
18028
+ case 16:
18029
+ json = _context28.sent;
18030
+ _context28.t0 = category;
18031
+ _context28.next = _context28.t0 === "protocols" ? 20 : _context28.t0 === "yields" ? 22 : _context28.t0 === "dex" ? 24 : _context28.t0 === "fees" ? 24 : 26;
18098
18032
  break;
18099
18033
 
18100
- case 18:
18034
+ case 20:
18101
18035
  json = Array.isArray(json) ? json.slice(0, 500) : [];
18102
- return _context27.abrupt("break", 24);
18036
+ return _context28.abrupt("break", 26);
18103
18037
 
18104
- case 20:
18038
+ case 22:
18105
18039
  json = Array.isArray(json.data) ? json.data.slice(0, 500) : [];
18106
- return _context27.abrupt("break", 24);
18040
+ return _context28.abrupt("break", 26);
18107
18041
 
18108
- case 22:
18042
+ case 24:
18109
18043
  json = Array.isArray(json.protocols) ? json.protocols.slice(0, 500) : [];
18110
- return _context27.abrupt("break", 24);
18044
+ return _context28.abrupt("break", 26);
18111
18045
 
18112
- case 24:
18113
- return _context27.abrupt("return", (Array.isArray(json) ? json : [ json ]).map((function(item) {
18046
+ case 26:
18047
+ return _context28.abrupt("return", (Array.isArray(json) ? json : [ json ]).map((function(item) {
18114
18048
  var out = {};
18115
18049
  for (var _i17 = 0, _Object$entries7 = Object.entries(item); _i17 < _Object$entries7.length; _i17++) {
18116
18050
  var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i17], 2), k = _Object$entries7$_i[0], v = _Object$entries7$_i[1];
@@ -18119,16 +18053,16 @@ function _typeof(o) {
18119
18053
  return out;
18120
18054
  })));
18121
18055
 
18122
- case 27:
18123
- _context27.prev = 27;
18124
- _context27.t1 = _context27["catch"](0);
18125
- return _context27.abrupt("return", errorMessageHandler(_context27.t1, "DEFILLAMA"));
18056
+ case 29:
18057
+ _context28.prev = 29;
18058
+ _context28.t1 = _context28["catch"](0);
18059
+ return _context28.abrupt("return", errorMessageHandler(_context28.t1, "DEFILLAMA"));
18126
18060
 
18127
- case 30:
18061
+ case 32:
18128
18062
  case "end":
18129
- return _context27.stop();
18063
+ return _context28.stop();
18130
18064
  }
18131
- }), _callee24, null, [ [ 0, 27 ] ]);
18065
+ }), _callee25, null, [ [ 0, 29 ] ]);
18132
18066
  })));
18133
18067
  return _DEFILLAMA.apply(this, arguments);
18134
18068
  }
@@ -18136,13 +18070,13 @@ function _typeof(o) {
18136
18070
  return _UNISWAP.apply(this, arguments);
18137
18071
  }
18138
18072
  function _UNISWAP() {
18139
- _UNISWAP = _asyncToGenerator(_regeneratorRuntime().mark((function _callee25() {
18140
- var _argsToArray25, _argsToArray26, graphType, category, param1, param2, baseUrl, url, res, json, _args28 = arguments;
18141
- return _regeneratorRuntime().wrap((function _callee25$(_context28) {
18142
- while (1) switch (_context28.prev = _context28.next) {
18073
+ _UNISWAP = _asyncToGenerator(_regeneratorRuntime().mark((function _callee26() {
18074
+ var _argsToArray25, _argsToArray26, graphType, category, param1, param2, baseUrl, url, res, json, _args29 = arguments;
18075
+ return _regeneratorRuntime().wrap((function _callee26$(_context29) {
18076
+ while (1) switch (_context29.prev = _context29.next) {
18143
18077
  case 0:
18144
- _context28.prev = 0;
18145
- _argsToArray25 = argsToArray(_args28), _argsToArray26 = _slicedToArray(_argsToArray25, 4),
18078
+ _context29.prev = 0;
18079
+ _argsToArray25 = argsToArray(_args29), _argsToArray26 = _slicedToArray(_argsToArray25, 4),
18146
18080
  graphType = _argsToArray26[0], category = _argsToArray26[1], param1 = _argsToArray26[2],
18147
18081
  param2 = _argsToArray26[3];
18148
18082
  validateParams(uniswapParamsSchema, {
@@ -18153,28 +18087,28 @@ function _typeof(o) {
18153
18087
  });
18154
18088
  baseUrl = "https://onchain-proxy.fileverse.io/third-party";
18155
18089
  url = "".concat(baseUrl) + "?service=uniswap" + "&graphType=".concat(graphType) + "&category=".concat(category) + "&input1=".concat(encodeURIComponent(param1)) + (param2 ? "&input2=".concat(encodeURIComponent(param2)) : "");
18156
- _context28.next = 7;
18090
+ _context29.next = 7;
18157
18091
  return fetch(url);
18158
18092
 
18159
18093
  case 7:
18160
- res = _context28.sent;
18094
+ res = _context29.sent;
18161
18095
  if (res.ok) {
18162
- _context28.next = 10;
18096
+ _context29.next = 10;
18163
18097
  break;
18164
18098
  }
18165
18099
  throw new NetworkError("UNISWAP", res.status);
18166
18100
 
18167
18101
  case 10:
18168
- _context28.next = 12;
18102
+ _context29.next = 12;
18169
18103
  return res.json();
18170
18104
 
18171
18105
  case 12:
18172
- json = _context28.sent;
18106
+ json = _context29.sent;
18173
18107
  if (!Array.isArray(json)) {
18174
- _context28.next = 15;
18108
+ _context29.next = 15;
18175
18109
  break;
18176
18110
  }
18177
- return _context28.abrupt("return", json.map((function(item) {
18111
+ return _context29.abrupt("return", json.map((function(item) {
18178
18112
  var flat = {};
18179
18113
  Object.entries(item).forEach((function(_ref17) {
18180
18114
  var _ref18 = _slicedToArray(_ref17, 2), k = _ref18[0], v = _ref18[1];
@@ -18184,18 +18118,18 @@ function _typeof(o) {
18184
18118
  })));
18185
18119
 
18186
18120
  case 15:
18187
- return _context28.abrupt("return", json);
18121
+ return _context29.abrupt("return", json);
18188
18122
 
18189
18123
  case 18:
18190
- _context28.prev = 18;
18191
- _context28.t0 = _context28["catch"](0);
18192
- return _context28.abrupt("return", errorMessageHandler(_context28.t0, "UNISWAP"));
18124
+ _context29.prev = 18;
18125
+ _context29.t0 = _context29["catch"](0);
18126
+ return _context29.abrupt("return", errorMessageHandler(_context29.t0, "UNISWAP"));
18193
18127
 
18194
18128
  case 21:
18195
18129
  case "end":
18196
- return _context28.stop();
18130
+ return _context29.stop();
18197
18131
  }
18198
- }), _callee25, null, [ [ 0, 18 ] ]);
18132
+ }), _callee26, null, [ [ 0, 18 ] ]);
18199
18133
  })));
18200
18134
  return _UNISWAP.apply(this, arguments);
18201
18135
  }
@@ -18203,13 +18137,13 @@ function _typeof(o) {
18203
18137
  return _AAVE.apply(this, arguments);
18204
18138
  }
18205
18139
  function _AAVE() {
18206
- _AAVE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee26() {
18207
- var _argsToArray27, _argsToArray28, graphType, category, param1, param2, baseUrl, url, res, json, _args29 = arguments;
18208
- return _regeneratorRuntime().wrap((function _callee26$(_context29) {
18209
- while (1) switch (_context29.prev = _context29.next) {
18140
+ _AAVE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee27() {
18141
+ var _argsToArray27, _argsToArray28, graphType, category, param1, param2, baseUrl, url, res, json, _args30 = arguments;
18142
+ return _regeneratorRuntime().wrap((function _callee27$(_context30) {
18143
+ while (1) switch (_context30.prev = _context30.next) {
18210
18144
  case 0:
18211
- _context29.prev = 0;
18212
- _argsToArray27 = argsToArray(_args29), _argsToArray28 = _slicedToArray(_argsToArray27, 4),
18145
+ _context30.prev = 0;
18146
+ _argsToArray27 = argsToArray(_args30), _argsToArray28 = _slicedToArray(_argsToArray27, 4),
18213
18147
  graphType = _argsToArray28[0], category = _argsToArray28[1], param1 = _argsToArray28[2],
18214
18148
  param2 = _argsToArray28[3];
18215
18149
  validateParams(aaveParamsSchema, {
@@ -18220,28 +18154,28 @@ function _typeof(o) {
18220
18154
  });
18221
18155
  baseUrl = "https://onchain-proxy.fileverse.io/third-party";
18222
18156
  url = "".concat(baseUrl) + "?service=aave" + "&graphType=".concat(encodeURIComponent(graphType)) + "&category=".concat(encodeURIComponent(category)) + "&input1=".concat(encodeURIComponent(param1)) + (param2 ? "&input2=".concat(encodeURIComponent(param2)) : "");
18223
- _context29.next = 7;
18157
+ _context30.next = 7;
18224
18158
  return fetch(url);
18225
18159
 
18226
18160
  case 7:
18227
- res = _context29.sent;
18161
+ res = _context30.sent;
18228
18162
  if (res.ok) {
18229
- _context29.next = 10;
18163
+ _context30.next = 10;
18230
18164
  break;
18231
18165
  }
18232
18166
  throw new NetworkError("AAVE", res.status);
18233
18167
 
18234
18168
  case 10:
18235
- _context29.next = 12;
18169
+ _context30.next = 12;
18236
18170
  return res.json();
18237
18171
 
18238
18172
  case 12:
18239
- json = _context29.sent;
18173
+ json = _context30.sent;
18240
18174
  if (!Array.isArray(json)) {
18241
- _context29.next = 15;
18175
+ _context30.next = 15;
18242
18176
  break;
18243
18177
  }
18244
- return _context29.abrupt("return", json.map((function(item) {
18178
+ return _context30.abrupt("return", json.map((function(item) {
18245
18179
  var flat = {};
18246
18180
  Object.entries(item).forEach((function(_ref19) {
18247
18181
  var _ref20 = _slicedToArray(_ref19, 2), k = _ref20[0], v = _ref20[1];
@@ -18251,18 +18185,18 @@ function _typeof(o) {
18251
18185
  })));
18252
18186
 
18253
18187
  case 15:
18254
- return _context29.abrupt("return", json);
18188
+ return _context30.abrupt("return", json);
18255
18189
 
18256
18190
  case 18:
18257
- _context29.prev = 18;
18258
- _context29.t0 = _context29["catch"](0);
18259
- return _context29.abrupt("return", errorMessageHandler(_context29.t0, "AAVE"));
18191
+ _context30.prev = 18;
18192
+ _context30.t0 = _context30["catch"](0);
18193
+ return _context30.abrupt("return", errorMessageHandler(_context30.t0, "AAVE"));
18260
18194
 
18261
18195
  case 21:
18262
18196
  case "end":
18263
- return _context29.stop();
18197
+ return _context30.stop();
18264
18198
  }
18265
- }), _callee26, null, [ [ 0, 18 ] ]);
18199
+ }), _callee27, null, [ [ 0, 18 ] ]);
18266
18200
  })));
18267
18201
  return _AAVE.apply(this, arguments);
18268
18202
  }