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

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-78 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -11126,43 +11126,42 @@ function _typeof(o) {
11126
11126
  _inherits(InvalidApiKeyError, _Error6);
11127
11127
  return _createClass(InvalidApiKeyError);
11128
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");
11129
+ var fileverseProxyUrl = "".concat(process.env.NEXT_PUBLIC_PROXY_BASE_URL, "/proxy");
11131
11130
  var PROXY_MAP = {
11132
11131
  Etherscan: {
11133
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11132
+ url: fileverseProxyUrl,
11134
11133
  removeParams: [ "apikey" ]
11135
11134
  },
11136
11135
  Basescan: {
11137
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11136
+ url: fileverseProxyUrl,
11138
11137
  removeParams: [ "apikey" ]
11139
11138
  },
11140
11139
  Gnosisscan: {
11141
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11140
+ url: fileverseProxyUrl,
11142
11141
  removeParams: [ "apikey" ]
11143
11142
  },
11144
11143
  Coingecko: {
11145
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11144
+ url: fileverseProxyUrl,
11146
11145
  removeParams: [ "apikey" ]
11147
11146
  },
11148
11147
  Firefly: {
11149
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11148
+ url: fileverseProxyUrl,
11150
11149
  removeParams: [ "apikey" ]
11151
11150
  },
11152
11151
  Neynar: {
11153
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11152
+ url: fileverseProxyUrl,
11154
11153
  removeParams: [ "api_key" ]
11155
11154
  },
11156
11155
  Safe: {
11157
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11156
+ url: fileverseProxyUrl,
11158
11157
  removeParams: [ "api_key" ]
11159
11158
  },
11160
11159
  Defillama: {
11161
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11160
+ url: fileverseProxyUrl,
11162
11161
  removeParams: [ "api_key" ]
11163
11162
  },
11164
11163
  GnosisPay: {
11165
- url: productionFileverseProxyUrl || stagingFileverseProxyUrl,
11164
+ url: fileverseProxyUrl,
11166
11165
  removeParams: [ "api_key" ]
11167
11166
  }
11168
11167
  };
@@ -11265,16 +11264,16 @@ function _typeof(o) {
11265
11264
  return _fromEnsNameToAddress.apply(this, arguments);
11266
11265
  }
11267
11266
  function _fromEnsNameToAddress() {
11268
- _fromEnsNameToAddress = _asyncToGenerator(_regeneratorRuntime().mark((function _callee1(name) {
11267
+ _fromEnsNameToAddress = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(name) {
11269
11268
  var ALCHEMY_KEY, provider, resolved;
11270
- return _regeneratorRuntime().wrap((function _callee1$(_context1) {
11271
- while (1) switch (_context1.prev = _context1.next) {
11269
+ return _regeneratorRuntime().wrap((function _callee10$(_context10) {
11270
+ while (1) switch (_context10.prev = _context10.next) {
11272
11271
  case 0:
11273
11272
  if (!(typeof ethers === "undefined")) {
11274
- _context1.next = 3;
11273
+ _context10.next = 3;
11275
11274
  break;
11276
11275
  }
11277
- _context1.next = 3;
11276
+ _context10.next = 3;
11278
11277
  return new Promise((function(resolve, reject) {
11279
11278
  var script = document.createElement("script");
11280
11279
  script.src = "https://cdn.jsdelivr.net/npm/ethers@6.10.0/dist/ethers.umd.min.js";
@@ -11286,52 +11285,89 @@ function _typeof(o) {
11286
11285
  case 3:
11287
11286
  ALCHEMY_KEY = window.localStorage.getItem(UTILITY.ALCHEMY_API_KEY);
11288
11287
  if (ALCHEMY_KEY) {
11289
- _context1.next = 7;
11288
+ _context10.next = 7;
11290
11289
  break;
11291
11290
  }
11292
11291
  console.error("alchemy api key missing");
11293
- return _context1.abrupt("return", null);
11292
+ return _context10.abrupt("return", null);
11294
11293
 
11295
11294
  case 7:
11296
11295
  provider = new ethers.AlchemyProvider("mainnet", ALCHEMY_KEY);
11297
- _context1.prev = 8;
11298
- _context1.next = 11;
11296
+ _context10.prev = 8;
11297
+ _context10.next = 11;
11299
11298
  return provider.resolveName(name);
11300
11299
 
11301
11300
  case 11:
11302
- resolved = _context1.sent;
11303
- return _context1.abrupt("return", resolved || null);
11301
+ resolved = _context10.sent;
11302
+ return _context10.abrupt("return", resolved || null);
11304
11303
 
11305
11304
  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);
11305
+ _context10.prev = 15;
11306
+ _context10.t0 = _context10["catch"](8);
11307
+ console.error("ENS resolution failed:", _context10.t0.message);
11308
+ return _context10.abrupt("return", null);
11310
11309
 
11311
11310
  case 19:
11312
11311
  case "end":
11313
- return _context1.stop();
11312
+ return _context10.stop();
11314
11313
  }
11315
- }), _callee1, null, [ [ 8, 15 ] ]);
11314
+ }), _callee10, null, [ [ 8, 15 ] ]);
11316
11315
  })));
11317
11316
  return _fromEnsNameToAddress.apply(this, arguments);
11318
11317
  }
11318
+ var validateAndGetAddress = function() {
11319
+ var _ref3 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(address) {
11320
+ var resolvedAddress;
11321
+ return _regeneratorRuntime().wrap((function _callee2$(_context2) {
11322
+ while (1) switch (_context2.prev = _context2.next) {
11323
+ case 0:
11324
+ if (!isAddress$1.isAddress(address)) {
11325
+ _context2.next = 2;
11326
+ break;
11327
+ }
11328
+ return _context2.abrupt("return", address);
11329
+
11330
+ case 2:
11331
+ _context2.next = 4;
11332
+ return fromEnsNameToAddress(address);
11333
+
11334
+ case 4:
11335
+ resolvedAddress = _context2.sent;
11336
+ if (!resolvedAddress) {
11337
+ _context2.next = 7;
11338
+ break;
11339
+ }
11340
+ return _context2.abrupt("return", resolvedAddress);
11341
+
11342
+ case 7:
11343
+ throw new ValidationError("Invalid address");
11344
+
11345
+ case 8:
11346
+ case "end":
11347
+ return _context2.stop();
11348
+ }
11349
+ }), _callee2);
11350
+ })));
11351
+ return function validateAndGetAddress(_x6) {
11352
+ return _ref3.apply(this, arguments);
11353
+ };
11354
+ }();
11319
11355
  var fromEnsNameToAddress$1 = {
11320
- fromEnsNameToAddress: fromEnsNameToAddress
11356
+ validateAndGetAddress: validateAndGetAddress
11321
11357
  };
11322
- function handleScanRequest(_x6) {
11358
+ function handleScanRequest(_x7) {
11323
11359
  return _handleScanRequest.apply(this, arguments);
11324
11360
  }
11325
11361
  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) {
11362
+ _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11(_ref4) {
11363
+ var type, address, startDate, endDate, _ref4$page, page, _ref4$offset, offset, apiKey, functionName, chainId, network, API_INFO_MAP, apiInfo, baseUrl, ACTION_MAP, action, module, url, _yield$Promise$all, _yield$Promise$all2, startBlock, endBlock, _getUrlAndHeaders3, finalUrl, HEADERS, res, json;
11364
+ return _regeneratorRuntime().wrap((function _callee11$(_context11) {
11365
+ while (1) switch (_context11.prev = _context11.next) {
11330
11366
  case 0:
11331
- type = _ref3.type, address = _ref3.address, startDate = _ref3.startDate, endDate = _ref3.endDate,
11332
- _ref3$page = _ref3.page, page = _ref3$page === void 0 ? 1 : _ref3$page, _ref3$offset = _ref3.offset,
11333
- offset = _ref3$offset === void 0 ? 10 : _ref3$offset, apiKey = _ref3.apiKey, functionName = _ref3.functionName,
11334
- chainId = _ref3.chainId, network = _ref3.network;
11367
+ type = _ref4.type, address = _ref4.address, startDate = _ref4.startDate, endDate = _ref4.endDate,
11368
+ _ref4$page = _ref4.page, page = _ref4$page === void 0 ? 1 : _ref4$page, _ref4$offset = _ref4.offset,
11369
+ offset = _ref4$offset === void 0 ? 10 : _ref4$offset, apiKey = _ref4.apiKey, functionName = _ref4.functionName,
11370
+ chainId = _ref4.chainId, network = _ref4.network;
11335
11371
  API_INFO_MAP = {
11336
11372
  BASE: {
11337
11373
  url: "https://api.basescan.org/api",
@@ -11346,32 +11382,26 @@ function _typeof(o) {
11346
11382
  apiKeyName: SERVICES_API_KEY.Gnosisscan
11347
11383
  }
11348
11384
  };
11349
- if (!(!isAddress$1.isAddress(address) && type !== "gas")) {
11350
- _context10.next = 9;
11385
+ if (!(type !== "gas")) {
11386
+ _context11.next = 6;
11351
11387
  break;
11352
11388
  }
11353
- ensName = address;
11354
- _context10.next = 6;
11355
- return fromEnsNameToAddress$1.fromEnsNameToAddress(address);
11389
+ _context11.next = 5;
11390
+ return fromEnsNameToAddress$1.validateAndGetAddress(address);
11356
11391
 
11357
- case 6:
11358
- address = _context10.sent;
11359
- if (address) {
11360
- _context10.next = 9;
11361
- break;
11362
- }
11363
- throw new EnsError(ensName);
11392
+ case 5:
11393
+ address = _context11.sent;
11364
11394
 
11365
- case 9:
11395
+ case 6:
11366
11396
  apiInfo = API_INFO_MAP[functionName];
11367
11397
  baseUrl = apiInfo === null || apiInfo === void 0 ? void 0 : apiInfo.url;
11368
11398
  if (baseUrl) {
11369
- _context10.next = 13;
11399
+ _context11.next = 10;
11370
11400
  break;
11371
11401
  }
11372
11402
  throw new ValidationError("Api not found for: ".concat(functionName));
11373
11403
 
11374
- case 13:
11404
+ case 10:
11375
11405
  ACTION_MAP = {
11376
11406
  "all-txns": "txlist",
11377
11407
  "token-txns": "tokentx",
@@ -11380,101 +11410,101 @@ function _typeof(o) {
11380
11410
  };
11381
11411
  action = ACTION_MAP[type];
11382
11412
  if (action) {
11383
- _context10.next = 17;
11413
+ _context11.next = 14;
11384
11414
  break;
11385
11415
  }
11386
11416
  throw new ValidationError("Invalid type: ".concat(type));
11387
11417
 
11388
- case 17:
11418
+ case 14:
11389
11419
  module = action === "gasoracle" ? "gastracker" : "account";
11390
11420
  url = "".concat(baseUrl, "?chainid=").concat(chainId, "&module=").concat(module, "&action=").concat(action, "&apikey=").concat(apiKey);
11391
11421
  if (![ "all-txns", "token-txns", "nft-txns" ].includes(type)) {
11392
- _context10.next = 30;
11422
+ _context11.next = 27;
11393
11423
  break;
11394
11424
  }
11395
11425
  url += "&address=".concat(address, "&startblock=0&endblock=99999999&sort=asc");
11396
11426
  if (!(!isNaN(startDate) && !isNaN(endDate))) {
11397
- _context10.next = 29;
11427
+ _context11.next = 26;
11398
11428
  break;
11399
11429
  }
11400
- _context10.next = 24;
11430
+ _context11.next = 21;
11401
11431
  return Promise.all([ fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startDate), network, apiKey), fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endDate), network, apiKey) ]);
11402
11432
 
11403
- case 24:
11404
- _yield$Promise$all = _context10.sent;
11433
+ case 21:
11434
+ _yield$Promise$all = _context11.sent;
11405
11435
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
11406
11436
  startBlock = _yield$Promise$all2[0];
11407
11437
  endBlock = _yield$Promise$all2[1];
11408
11438
  url += "&startblock=".concat(startBlock || "0", "&endblock=").concat(endBlock || "99999999");
11409
11439
 
11410
- case 29:
11440
+ case 26:
11411
11441
  url += "&page=".concat(page, "&offset=").concat(offset);
11412
11442
 
11413
- case 30:
11443
+ case 27:
11414
11444
  _getUrlAndHeaders3 = getUrlAndHeaders({
11415
11445
  url: url,
11416
11446
  serviceName: apiInfo.apiKeyName,
11417
11447
  headers: {}
11418
11448
  }), finalUrl = _getUrlAndHeaders3.URL, HEADERS = _getUrlAndHeaders3.HEADERS;
11419
- _context10.next = 33;
11449
+ _context11.next = 30;
11420
11450
  return fetch(finalUrl, {
11421
11451
  method: "GET",
11422
11452
  headers: HEADERS
11423
11453
  });
11424
11454
 
11425
- case 33:
11426
- res = _context10.sent;
11455
+ case 30:
11456
+ res = _context11.sent;
11427
11457
  if (res.ok) {
11428
- _context10.next = 36;
11458
+ _context11.next = 33;
11429
11459
  break;
11430
11460
  }
11431
11461
  throw new NetworkError(apiInfo.apiKeyName, res.status);
11432
11462
 
11433
- case 36:
11434
- _context10.next = 38;
11463
+ case 33:
11464
+ _context11.next = 35;
11435
11465
  return res.json();
11436
11466
 
11437
- case 38:
11438
- json = _context10.sent;
11467
+ case 35:
11468
+ json = _context11.sent;
11439
11469
  if (!(typeof json.result === "string")) {
11440
- _context10.next = 44;
11470
+ _context11.next = 41;
11441
11471
  break;
11442
11472
  }
11443
11473
  if (!json.result.includes("Invalid API Key")) {
11444
- _context10.next = 42;
11474
+ _context11.next = 39;
11445
11475
  break;
11446
11476
  }
11447
11477
  throw new InvalidApiKeyError(apiInfo.apiKeyName);
11448
11478
 
11449
- case 42:
11479
+ case 39:
11450
11480
  if (!json.result.includes("Max rate limit reached")) {
11451
- _context10.next = 44;
11481
+ _context11.next = 41;
11452
11482
  break;
11453
11483
  }
11454
11484
  throw new RateLimitError(apiInfo.apiKeyName);
11455
11485
 
11456
- case 44:
11457
- return _context10.abrupt("return", type === "gas" && !Array.isArray(json.result) ? [ json.result ] : json.result);
11486
+ case 41:
11487
+ return _context11.abrupt("return", type === "gas" && !Array.isArray(json.result) ? [ json.result ] : json.result);
11458
11488
 
11459
- case 45:
11489
+ case 42:
11460
11490
  case "end":
11461
- return _context10.stop();
11491
+ return _context11.stop();
11462
11492
  }
11463
- }), _callee10);
11493
+ }), _callee11);
11464
11494
  })));
11465
11495
  return _handleScanRequest.apply(this, arguments);
11466
11496
  }
11467
11497
  var fromUsernameToFid = function() {
11468
- var _ref4 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(username, apiKey) {
11498
+ var _ref5 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee3(username, apiKey) {
11469
11499
  var url, _getUrlAndHeaders2, finalUrl, HEADERS, res, json, users, user;
11470
- return _regeneratorRuntime().wrap((function _callee2$(_context2) {
11471
- while (1) switch (_context2.prev = _context2.next) {
11500
+ return _regeneratorRuntime().wrap((function _callee3$(_context3) {
11501
+ while (1) switch (_context3.prev = _context3.next) {
11472
11502
  case 0:
11473
11503
  if (username) {
11474
- _context2.next = 2;
11504
+ _context3.next = 2;
11475
11505
  break;
11476
11506
  }
11477
- return _context2.abrupt("return", null);
11507
+ return _context3.abrupt("return", null);
11478
11508
 
11479
11509
  case 2:
11480
11510
  url = "https://api.neynar.com/v2/farcaster/user/search/?q=".concat(username, "&limit=5");
@@ -11486,33 +11516,33 @@ function _typeof(o) {
11486
11516
  "x-neynar-experimental": "false"
11487
11517
  }
11488
11518
  }), finalUrl = _getUrlAndHeaders2.URL, HEADERS = _getUrlAndHeaders2.HEADERS;
11489
- _context2.next = 6;
11519
+ _context3.next = 6;
11490
11520
  return fetch(finalUrl, {
11491
11521
  method: "GET",
11492
11522
  headers: HEADERS
11493
11523
  });
11494
11524
 
11495
11525
  case 6:
11496
- res = _context2.sent;
11497
- _context2.next = 9;
11526
+ res = _context3.sent;
11527
+ _context3.next = 9;
11498
11528
  return res.json();
11499
11529
 
11500
11530
  case 9:
11501
- json = _context2.sent;
11531
+ json = _context3.sent;
11502
11532
  users = json.result ? json.result.users : [];
11503
11533
  user = users.find((function(user) {
11504
11534
  return user.username === username;
11505
11535
  }));
11506
- return _context2.abrupt("return", user && user.fid || null);
11536
+ return _context3.abrupt("return", user && user.fid || null);
11507
11537
 
11508
11538
  case 13:
11509
11539
  case "end":
11510
- return _context2.stop();
11540
+ return _context3.stop();
11511
11541
  }
11512
- }), _callee2);
11542
+ }), _callee3);
11513
11543
  })));
11514
- return function fromUsernameToFid(_x7, _x8) {
11515
- return _ref4.apply(this, arguments);
11544
+ return function fromUsernameToFid(_x8, _x9) {
11545
+ return _ref5.apply(this, arguments);
11516
11546
  };
11517
11547
  }();
11518
11548
  var fromUsernameToFid$1 = {
@@ -12072,65 +12102,65 @@ function _typeof(o) {
12072
12102
  }, {
12073
12103
  key: "mergeObjectAsync",
12074
12104
  value: function() {
12075
- var _mergeObjectAsync = _asyncToGenerator(_regeneratorRuntime().mark((function _callee3(status, pairs) {
12105
+ var _mergeObjectAsync = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4(status, pairs) {
12076
12106
  var syncPairs, _iterator8, _step8, pair, key, _value5;
12077
- return _regeneratorRuntime().wrap((function _callee3$(_context3) {
12078
- while (1) switch (_context3.prev = _context3.next) {
12107
+ return _regeneratorRuntime().wrap((function _callee4$(_context4) {
12108
+ while (1) switch (_context4.prev = _context4.next) {
12079
12109
  case 0:
12080
12110
  syncPairs = [];
12081
12111
  _iterator8 = _createForOfIteratorHelper(pairs);
12082
- _context3.prev = 2;
12112
+ _context4.prev = 2;
12083
12113
  _iterator8.s();
12084
12114
 
12085
12115
  case 4:
12086
12116
  if ((_step8 = _iterator8.n()).done) {
12087
- _context3.next = 15;
12117
+ _context4.next = 15;
12088
12118
  break;
12089
12119
  }
12090
12120
  pair = _step8.value;
12091
- _context3.next = 8;
12121
+ _context4.next = 8;
12092
12122
  return pair.key;
12093
12123
 
12094
12124
  case 8:
12095
- key = _context3.sent;
12096
- _context3.next = 11;
12125
+ key = _context4.sent;
12126
+ _context4.next = 11;
12097
12127
  return pair.value;
12098
12128
 
12099
12129
  case 11:
12100
- _value5 = _context3.sent;
12130
+ _value5 = _context4.sent;
12101
12131
  syncPairs.push({
12102
12132
  key: key,
12103
12133
  value: _value5
12104
12134
  });
12105
12135
 
12106
12136
  case 13:
12107
- _context3.next = 4;
12137
+ _context4.next = 4;
12108
12138
  break;
12109
12139
 
12110
12140
  case 15:
12111
- _context3.next = 20;
12141
+ _context4.next = 20;
12112
12142
  break;
12113
12143
 
12114
12144
  case 17:
12115
- _context3.prev = 17;
12116
- _context3.t0 = _context3["catch"](2);
12117
- _iterator8.e(_context3.t0);
12145
+ _context4.prev = 17;
12146
+ _context4.t0 = _context4["catch"](2);
12147
+ _iterator8.e(_context4.t0);
12118
12148
 
12119
12149
  case 20:
12120
- _context3.prev = 20;
12150
+ _context4.prev = 20;
12121
12151
  _iterator8.f();
12122
- return _context3.finish(20);
12152
+ return _context4.finish(20);
12123
12153
 
12124
12154
  case 23:
12125
- return _context3.abrupt("return", ParseStatus.mergeObjectSync(status, syncPairs));
12155
+ return _context4.abrupt("return", ParseStatus.mergeObjectSync(status, syncPairs));
12126
12156
 
12127
12157
  case 24:
12128
12158
  case "end":
12129
- return _context3.stop();
12159
+ return _context4.stop();
12130
12160
  }
12131
- }), _callee3, null, [ [ 2, 17, 20, 23 ] ]);
12161
+ }), _callee4, null, [ [ 2, 17, 20, 23 ] ]);
12132
12162
  })));
12133
- function mergeObjectAsync(_x9, _x0) {
12163
+ function mergeObjectAsync(_x0, _x1) {
12134
12164
  return _mergeObjectAsync.apply(this, arguments);
12135
12165
  }
12136
12166
  return mergeObjectAsync;
@@ -12259,7 +12289,7 @@ function _typeof(o) {
12259
12289
  description: description
12260
12290
  };
12261
12291
  var customMap = function customMap(iss, ctx) {
12262
- var _ref6;
12292
+ var _ref7;
12263
12293
  var message = params.message;
12264
12294
  if (iss.code === "invalid_enum_value") {
12265
12295
  return {
@@ -12267,16 +12297,16 @@ function _typeof(o) {
12267
12297
  };
12268
12298
  }
12269
12299
  if (typeof ctx.data === "undefined") {
12270
- var _ref5;
12300
+ var _ref6;
12271
12301
  return {
12272
- message: (_ref5 = message !== null && message !== void 0 ? message : required_error) !== null && _ref5 !== void 0 ? _ref5 : ctx.defaultError
12302
+ message: (_ref6 = message !== null && message !== void 0 ? message : required_error) !== null && _ref6 !== void 0 ? _ref6 : ctx.defaultError
12273
12303
  };
12274
12304
  }
12275
12305
  if (iss.code !== "invalid_type") return {
12276
12306
  message: ctx.defaultError
12277
12307
  };
12278
12308
  return {
12279
- message: (_ref6 = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _ref6 !== void 0 ? _ref6 : ctx.defaultError
12309
+ message: (_ref7 = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _ref7 !== void 0 ? _ref7 : ctx.defaultError
12280
12310
  };
12281
12311
  };
12282
12312
  return {
@@ -12456,32 +12486,32 @@ function _typeof(o) {
12456
12486
  }, {
12457
12487
  key: "parseAsync",
12458
12488
  value: function() {
12459
- var _parseAsync2 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4(data, params) {
12489
+ var _parseAsync2 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5(data, params) {
12460
12490
  var result;
12461
- return _regeneratorRuntime().wrap((function _callee4$(_context4) {
12462
- while (1) switch (_context4.prev = _context4.next) {
12491
+ return _regeneratorRuntime().wrap((function _callee5$(_context5) {
12492
+ while (1) switch (_context5.prev = _context5.next) {
12463
12493
  case 0:
12464
- _context4.next = 2;
12494
+ _context5.next = 2;
12465
12495
  return this.safeParseAsync(data, params);
12466
12496
 
12467
12497
  case 2:
12468
- result = _context4.sent;
12498
+ result = _context5.sent;
12469
12499
  if (!result.success) {
12470
- _context4.next = 5;
12500
+ _context5.next = 5;
12471
12501
  break;
12472
12502
  }
12473
- return _context4.abrupt("return", result.data);
12503
+ return _context5.abrupt("return", result.data);
12474
12504
 
12475
12505
  case 5:
12476
12506
  throw result.error;
12477
12507
 
12478
12508
  case 6:
12479
12509
  case "end":
12480
- return _context4.stop();
12510
+ return _context5.stop();
12481
12511
  }
12482
- }), _callee4, this);
12512
+ }), _callee5, this);
12483
12513
  })));
12484
- function parseAsync(_x1, _x10) {
12514
+ function parseAsync(_x10, _x11) {
12485
12515
  return _parseAsync2.apply(this, arguments);
12486
12516
  }
12487
12517
  return parseAsync;
@@ -12489,10 +12519,10 @@ function _typeof(o) {
12489
12519
  }, {
12490
12520
  key: "safeParseAsync",
12491
12521
  value: function() {
12492
- var _safeParseAsync = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5(data, params) {
12522
+ var _safeParseAsync = _asyncToGenerator(_regeneratorRuntime().mark((function _callee6(data, params) {
12493
12523
  var ctx, maybeAsyncResult, result;
12494
- return _regeneratorRuntime().wrap((function _callee5$(_context5) {
12495
- while (1) switch (_context5.prev = _context5.next) {
12524
+ return _regeneratorRuntime().wrap((function _callee6$(_context6) {
12525
+ while (1) switch (_context6.prev = _context6.next) {
12496
12526
  case 0:
12497
12527
  ctx = {
12498
12528
  common: {
@@ -12511,20 +12541,20 @@ function _typeof(o) {
12511
12541
  path: ctx.path,
12512
12542
  parent: ctx
12513
12543
  });
12514
- _context5.next = 4;
12544
+ _context6.next = 4;
12515
12545
  return isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult);
12516
12546
 
12517
12547
  case 4:
12518
- result = _context5.sent;
12519
- return _context5.abrupt("return", handleResult(ctx, result));
12548
+ result = _context6.sent;
12549
+ return _context6.abrupt("return", handleResult(ctx, result));
12520
12550
 
12521
12551
  case 6:
12522
12552
  case "end":
12523
- return _context5.stop();
12553
+ return _context6.stop();
12524
12554
  }
12525
- }), _callee5, this);
12555
+ }), _callee6, this);
12526
12556
  })));
12527
- function safeParseAsync(_x11, _x12) {
12557
+ function safeParseAsync(_x12, _x13) {
12528
12558
  return _safeParseAsync.apply(this, arguments);
12529
12559
  }
12530
12560
  return safeParseAsync;
@@ -14683,32 +14713,32 @@ function _typeof(o) {
14683
14713
  }
14684
14714
  }
14685
14715
  if (ctx.common.async) {
14686
- return Promise.resolve().then(_asyncToGenerator(_regeneratorRuntime().mark((function _callee6() {
14716
+ return Promise.resolve().then(_asyncToGenerator(_regeneratorRuntime().mark((function _callee7() {
14687
14717
  var syncPairs, _iterator24, _step24, pair, _key4, _value8;
14688
- return _regeneratorRuntime().wrap((function _callee6$(_context6) {
14689
- while (1) switch (_context6.prev = _context6.next) {
14718
+ return _regeneratorRuntime().wrap((function _callee7$(_context7) {
14719
+ while (1) switch (_context7.prev = _context7.next) {
14690
14720
  case 0:
14691
14721
  syncPairs = [];
14692
14722
  _iterator24 = _createForOfIteratorHelper(pairs);
14693
- _context6.prev = 2;
14723
+ _context7.prev = 2;
14694
14724
  _iterator24.s();
14695
14725
 
14696
14726
  case 4:
14697
14727
  if ((_step24 = _iterator24.n()).done) {
14698
- _context6.next = 15;
14728
+ _context7.next = 15;
14699
14729
  break;
14700
14730
  }
14701
14731
  pair = _step24.value;
14702
- _context6.next = 8;
14732
+ _context7.next = 8;
14703
14733
  return pair.key;
14704
14734
 
14705
14735
  case 8:
14706
- _key4 = _context6.sent;
14707
- _context6.next = 11;
14736
+ _key4 = _context7.sent;
14737
+ _context7.next = 11;
14708
14738
  return pair.value;
14709
14739
 
14710
14740
  case 11:
14711
- _value8 = _context6.sent;
14741
+ _value8 = _context7.sent;
14712
14742
  syncPairs.push({
14713
14743
  key: _key4,
14714
14744
  value: _value8,
@@ -14716,31 +14746,31 @@ function _typeof(o) {
14716
14746
  });
14717
14747
 
14718
14748
  case 13:
14719
- _context6.next = 4;
14749
+ _context7.next = 4;
14720
14750
  break;
14721
14751
 
14722
14752
  case 15:
14723
- _context6.next = 20;
14753
+ _context7.next = 20;
14724
14754
  break;
14725
14755
 
14726
14756
  case 17:
14727
- _context6.prev = 17;
14728
- _context6.t0 = _context6["catch"](2);
14729
- _iterator24.e(_context6.t0);
14757
+ _context7.prev = 17;
14758
+ _context7.t0 = _context7["catch"](2);
14759
+ _iterator24.e(_context7.t0);
14730
14760
 
14731
14761
  case 20:
14732
- _context6.prev = 20;
14762
+ _context7.prev = 20;
14733
14763
  _iterator24.f();
14734
- return _context6.finish(20);
14764
+ return _context7.finish(20);
14735
14765
 
14736
14766
  case 23:
14737
- return _context6.abrupt("return", syncPairs);
14767
+ return _context7.abrupt("return", syncPairs);
14738
14768
 
14739
14769
  case 24:
14740
14770
  case "end":
14741
- return _context6.stop();
14771
+ return _context7.stop();
14742
14772
  }
14743
- }), _callee6, null, [ [ 2, 17, 20, 23 ] ]);
14773
+ }), _callee7, null, [ [ 2, 17, 20, 23 ] ]);
14744
14774
  })))).then((function(syncPairs) {
14745
14775
  return ParseStatus.mergeObjectSync(status, syncPairs);
14746
14776
  }));
@@ -15016,10 +15046,10 @@ function _typeof(o) {
15016
15046
  }
15017
15047
  if (ctx.common.async) {
15018
15048
  return Promise.all(options.map(function() {
15019
- var _ref8 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7(option) {
15049
+ var _ref9 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee8(option) {
15020
15050
  var childCtx;
15021
- return _regeneratorRuntime().wrap((function _callee7$(_context7) {
15022
- while (1) switch (_context7.prev = _context7.next) {
15051
+ return _regeneratorRuntime().wrap((function _callee8$(_context8) {
15052
+ while (1) switch (_context8.prev = _context8.next) {
15023
15053
  case 0:
15024
15054
  childCtx = _objectSpread(_objectSpread({}, ctx), {}, {
15025
15055
  common: _objectSpread(_objectSpread({}, ctx.common), {}, {
@@ -15027,7 +15057,7 @@ function _typeof(o) {
15027
15057
  }),
15028
15058
  parent: null
15029
15059
  });
15030
- _context7.next = 3;
15060
+ _context8.next = 3;
15031
15061
  return option._parseAsync({
15032
15062
  data: ctx.data,
15033
15063
  path: ctx.path,
@@ -15035,21 +15065,21 @@ function _typeof(o) {
15035
15065
  });
15036
15066
 
15037
15067
  case 3:
15038
- _context7.t0 = _context7.sent;
15039
- _context7.t1 = childCtx;
15040
- return _context7.abrupt("return", {
15041
- result: _context7.t0,
15042
- ctx: _context7.t1
15068
+ _context8.t0 = _context8.sent;
15069
+ _context8.t1 = childCtx;
15070
+ return _context8.abrupt("return", {
15071
+ result: _context8.t0,
15072
+ ctx: _context8.t1
15043
15073
  });
15044
15074
 
15045
15075
  case 6:
15046
15076
  case "end":
15047
- return _context7.stop();
15077
+ return _context8.stop();
15048
15078
  }
15049
- }), _callee7);
15079
+ }), _callee8);
15050
15080
  })));
15051
- return function(_x13) {
15052
- return _ref8.apply(this, arguments);
15081
+ return function(_x14) {
15082
+ return _ref9.apply(this, arguments);
15053
15083
  };
15054
15084
  }())).then(handleResults);
15055
15085
  } else {
@@ -15351,8 +15381,8 @@ function _typeof(o) {
15351
15381
  data: ctx.data,
15352
15382
  path: ctx.path,
15353
15383
  parent: ctx
15354
- }) ]).then((function(_ref9) {
15355
- var _ref0 = _slicedToArray(_ref9, 2), left = _ref0[0], right = _ref0[1];
15384
+ }) ]).then((function(_ref0) {
15385
+ var _ref1 = _slicedToArray(_ref0, 2), left = _ref1[0], right = _ref1[1];
15356
15386
  return handleParsed(left, right);
15357
15387
  }));
15358
15388
  } else {
@@ -15485,8 +15515,8 @@ function _typeof(o) {
15485
15515
  }
15486
15516
  var keyType = this._def.keyType;
15487
15517
  var valueType = this._def.valueType;
15488
- var pairs = _toConsumableArray(ctx.data.entries()).map((function(_ref1, index) {
15489
- var _ref10 = _slicedToArray(_ref1, 2), key = _ref10[0], value = _ref10[1];
15518
+ var pairs = _toConsumableArray(ctx.data.entries()).map((function(_ref10, index) {
15519
+ var _ref11 = _slicedToArray(_ref10, 2), key = _ref11[0], value = _ref11[1];
15490
15520
  return {
15491
15521
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [ index, "key" ])),
15492
15522
  value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [ index, "value" ]))
@@ -15494,36 +15524,36 @@ function _typeof(o) {
15494
15524
  }));
15495
15525
  if (ctx.common.async) {
15496
15526
  var finalMap = new Map;
15497
- return Promise.resolve().then(_asyncToGenerator(_regeneratorRuntime().mark((function _callee8() {
15527
+ return Promise.resolve().then(_asyncToGenerator(_regeneratorRuntime().mark((function _callee9() {
15498
15528
  var _iterator35, _step35, pair, key, _value1;
15499
- return _regeneratorRuntime().wrap((function _callee8$(_context8) {
15500
- while (1) switch (_context8.prev = _context8.next) {
15529
+ return _regeneratorRuntime().wrap((function _callee9$(_context9) {
15530
+ while (1) switch (_context9.prev = _context9.next) {
15501
15531
  case 0:
15502
15532
  _iterator35 = _createForOfIteratorHelper(pairs);
15503
- _context8.prev = 1;
15533
+ _context9.prev = 1;
15504
15534
  _iterator35.s();
15505
15535
 
15506
15536
  case 3:
15507
15537
  if ((_step35 = _iterator35.n()).done) {
15508
- _context8.next = 17;
15538
+ _context9.next = 17;
15509
15539
  break;
15510
15540
  }
15511
15541
  pair = _step35.value;
15512
- _context8.next = 7;
15542
+ _context9.next = 7;
15513
15543
  return pair.key;
15514
15544
 
15515
15545
  case 7:
15516
- key = _context8.sent;
15517
- _context8.next = 10;
15546
+ key = _context9.sent;
15547
+ _context9.next = 10;
15518
15548
  return pair.value;
15519
15549
 
15520
15550
  case 10:
15521
- _value1 = _context8.sent;
15551
+ _value1 = _context9.sent;
15522
15552
  if (!(key.status === "aborted" || _value1.status === "aborted")) {
15523
- _context8.next = 13;
15553
+ _context9.next = 13;
15524
15554
  break;
15525
15555
  }
15526
- return _context8.abrupt("return", INVALID);
15556
+ return _context9.abrupt("return", INVALID);
15527
15557
 
15528
15558
  case 13:
15529
15559
  if (key.status === "dirty" || _value1.status === "dirty") {
@@ -15532,34 +15562,34 @@ function _typeof(o) {
15532
15562
  finalMap.set(key.value, _value1.value);
15533
15563
 
15534
15564
  case 15:
15535
- _context8.next = 3;
15565
+ _context9.next = 3;
15536
15566
  break;
15537
15567
 
15538
15568
  case 17:
15539
- _context8.next = 22;
15569
+ _context9.next = 22;
15540
15570
  break;
15541
15571
 
15542
15572
  case 19:
15543
- _context8.prev = 19;
15544
- _context8.t0 = _context8["catch"](1);
15545
- _iterator35.e(_context8.t0);
15573
+ _context9.prev = 19;
15574
+ _context9.t0 = _context9["catch"](1);
15575
+ _iterator35.e(_context9.t0);
15546
15576
 
15547
15577
  case 22:
15548
- _context8.prev = 22;
15578
+ _context9.prev = 22;
15549
15579
  _iterator35.f();
15550
- return _context8.finish(22);
15580
+ return _context9.finish(22);
15551
15581
 
15552
15582
  case 25:
15553
- return _context8.abrupt("return", {
15583
+ return _context9.abrupt("return", {
15554
15584
  status: status.value,
15555
15585
  value: finalMap
15556
15586
  });
15557
15587
 
15558
15588
  case 26:
15559
15589
  case "end":
15560
- return _context8.stop();
15590
+ return _context9.stop();
15561
15591
  }
15562
- }), _callee8, null, [ [ 1, 19, 22, 25 ] ]);
15592
+ }), _callee9, null, [ [ 1, 19, 22, 25 ] ]);
15563
15593
  }))));
15564
15594
  } else {
15565
15595
  var _finalMap = new Map;
@@ -16020,19 +16050,19 @@ function _typeof(o) {
16020
16050
  var processed = effect.transform(ctx.data, checkCtx);
16021
16051
  if (ctx.common.async) {
16022
16052
  return Promise.resolve(processed).then(function() {
16023
- var _ref12 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9(processed) {
16053
+ var _ref13 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0(processed) {
16024
16054
  var result;
16025
- return _regeneratorRuntime().wrap((function _callee9$(_context9) {
16026
- while (1) switch (_context9.prev = _context9.next) {
16055
+ return _regeneratorRuntime().wrap((function _callee0$(_context0) {
16056
+ while (1) switch (_context0.prev = _context0.next) {
16027
16057
  case 0:
16028
16058
  if (!(status.value === "aborted")) {
16029
- _context9.next = 2;
16059
+ _context0.next = 2;
16030
16060
  break;
16031
16061
  }
16032
- return _context9.abrupt("return", INVALID);
16062
+ return _context0.abrupt("return", INVALID);
16033
16063
 
16034
16064
  case 2:
16035
- _context9.next = 4;
16065
+ _context0.next = 4;
16036
16066
  return _this14._def.schema._parseAsync({
16037
16067
  data: processed,
16038
16068
  path: ctx.path,
@@ -16040,38 +16070,38 @@ function _typeof(o) {
16040
16070
  });
16041
16071
 
16042
16072
  case 4:
16043
- result = _context9.sent;
16073
+ result = _context0.sent;
16044
16074
  if (!(result.status === "aborted")) {
16045
- _context9.next = 7;
16075
+ _context0.next = 7;
16046
16076
  break;
16047
16077
  }
16048
- return _context9.abrupt("return", INVALID);
16078
+ return _context0.abrupt("return", INVALID);
16049
16079
 
16050
16080
  case 7:
16051
16081
  if (!(result.status === "dirty")) {
16052
- _context9.next = 9;
16082
+ _context0.next = 9;
16053
16083
  break;
16054
16084
  }
16055
- return _context9.abrupt("return", DIRTY(result.value));
16085
+ return _context0.abrupt("return", DIRTY(result.value));
16056
16086
 
16057
16087
  case 9:
16058
16088
  if (!(status.value === "dirty")) {
16059
- _context9.next = 11;
16089
+ _context0.next = 11;
16060
16090
  break;
16061
16091
  }
16062
- return _context9.abrupt("return", DIRTY(result.value));
16092
+ return _context0.abrupt("return", DIRTY(result.value));
16063
16093
 
16064
16094
  case 11:
16065
- return _context9.abrupt("return", result);
16095
+ return _context0.abrupt("return", result);
16066
16096
 
16067
16097
  case 12:
16068
16098
  case "end":
16069
- return _context9.stop();
16099
+ return _context0.stop();
16070
16100
  }
16071
- }), _callee9);
16101
+ }), _callee0);
16072
16102
  })));
16073
- return function(_x14) {
16074
- return _ref12.apply(this, arguments);
16103
+ return function(_x15) {
16104
+ return _ref13.apply(this, arguments);
16075
16105
  };
16076
16106
  }());
16077
16107
  } else {
@@ -16402,12 +16432,12 @@ function _typeof(o) {
16402
16432
  var _this$_processInputPa13 = this._processInputParams(input), status = _this$_processInputPa13.status, ctx = _this$_processInputPa13.ctx;
16403
16433
  if (ctx.common.async) {
16404
16434
  var handleAsync = function() {
16405
- var _ref13 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
16435
+ var _ref14 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee1() {
16406
16436
  var inResult;
16407
- return _regeneratorRuntime().wrap((function _callee0$(_context0) {
16408
- while (1) switch (_context0.prev = _context0.next) {
16437
+ return _regeneratorRuntime().wrap((function _callee1$(_context1) {
16438
+ while (1) switch (_context1.prev = _context1.next) {
16409
16439
  case 0:
16410
- _context0.next = 2;
16440
+ _context1.next = 2;
16411
16441
  return _this16._def["in"]._parseAsync({
16412
16442
  data: ctx.data,
16413
16443
  path: ctx.path,
@@ -16415,23 +16445,23 @@ function _typeof(o) {
16415
16445
  });
16416
16446
 
16417
16447
  case 2:
16418
- inResult = _context0.sent;
16448
+ inResult = _context1.sent;
16419
16449
  if (!(inResult.status === "aborted")) {
16420
- _context0.next = 5;
16450
+ _context1.next = 5;
16421
16451
  break;
16422
16452
  }
16423
- return _context0.abrupt("return", INVALID);
16453
+ return _context1.abrupt("return", INVALID);
16424
16454
 
16425
16455
  case 5:
16426
16456
  if (!(inResult.status === "dirty")) {
16427
- _context0.next = 10;
16457
+ _context1.next = 10;
16428
16458
  break;
16429
16459
  }
16430
16460
  status.dirty();
16431
- return _context0.abrupt("return", DIRTY(inResult.value));
16461
+ return _context1.abrupt("return", DIRTY(inResult.value));
16432
16462
 
16433
16463
  case 10:
16434
- return _context0.abrupt("return", _this16._def.out._parseAsync({
16464
+ return _context1.abrupt("return", _this16._def.out._parseAsync({
16435
16465
  data: inResult.value,
16436
16466
  path: ctx.path,
16437
16467
  parent: ctx
@@ -16439,12 +16469,12 @@ function _typeof(o) {
16439
16469
 
16440
16470
  case 11:
16441
16471
  case "end":
16442
- return _context0.stop();
16472
+ return _context1.stop();
16443
16473
  }
16444
- }), _callee0);
16474
+ }), _callee1);
16445
16475
  })));
16446
16476
  return function handleAsync() {
16447
- return _ref13.apply(this, arguments);
16477
+ return _ref14.apply(this, arguments);
16448
16478
  };
16449
16479
  }();
16450
16480
  return handleAsync();
@@ -16784,13 +16814,13 @@ function _typeof(o) {
16784
16814
  return _FIREFLY.apply(this, arguments);
16785
16815
  }
16786
16816
  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) {
16817
+ _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12() {
16818
+ var _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, apiKey, url, _getUrlAndHeaders4, finalUrl, HEADERS, response, _yield$response$json, _data, _args12 = arguments;
16819
+ return _regeneratorRuntime().wrap((function _callee12$(_context12) {
16820
+ while (1) switch (_context12.prev = _context12.next) {
16791
16821
  case 0:
16792
- _context11.prev = 0;
16793
- _argsToArray3 = argsToArray(_args11), _argsToArray4 = _slicedToArray(_argsToArray3, 5),
16822
+ _context12.prev = 0;
16823
+ _argsToArray3 = argsToArray(_args12), _argsToArray4 = _slicedToArray(_argsToArray3, 5),
16794
16824
  platform = _argsToArray4[0], contentType = _argsToArray4[1], identifier = _argsToArray4[2],
16795
16825
  _argsToArray4$ = _argsToArray4[3], start = _argsToArray4$ === void 0 ? 0 : _argsToArray4$,
16796
16826
  _argsToArray4$2 = _argsToArray4[4], end = _argsToArray4$2 === void 0 ? 10 : _argsToArray4$2;
@@ -16816,35 +16846,35 @@ function _typeof(o) {
16816
16846
  "x-api-key": apiKey
16817
16847
  }
16818
16848
  }), finalUrl = _getUrlAndHeaders4.URL, HEADERS = _getUrlAndHeaders4.HEADERS;
16819
- _context11.next = 12;
16849
+ _context12.next = 12;
16820
16850
  return fetch(finalUrl, {
16821
16851
  method: "GET",
16822
16852
  headers: HEADERS
16823
16853
  });
16824
16854
 
16825
16855
  case 12:
16826
- response = _context11.sent;
16856
+ response = _context12.sent;
16827
16857
  if (response.ok) {
16828
- _context11.next = 15;
16858
+ _context12.next = 15;
16829
16859
  break;
16830
16860
  }
16831
16861
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
16832
16862
 
16833
16863
  case 15:
16834
- _context11.next = 17;
16864
+ _context12.next = 17;
16835
16865
  return response.json();
16836
16866
 
16837
16867
  case 17:
16838
- _yield$response$json = _context11.sent;
16868
+ _yield$response$json = _context12.sent;
16839
16869
  _data = _yield$response$json.data;
16840
16870
  if (Array.isArray(_data)) {
16841
- _context11.next = 21;
16871
+ _context12.next = 21;
16842
16872
  break;
16843
16873
  }
16844
- return _context11.abrupt("return", []);
16874
+ return _context12.abrupt("return", []);
16845
16875
 
16846
16876
  case 21:
16847
- return _context11.abrupt("return", _data.map((function(item) {
16877
+ return _context12.abrupt("return", _data.map((function(item) {
16848
16878
  var flat = {};
16849
16879
  for (var _i10 = 0, _Object$entries = Object.entries(item); _i10 < _Object$entries.length; _i10++) {
16850
16880
  var _Object$entries$_i = _slicedToArray(_Object$entries[_i10], 2), key = _Object$entries$_i[0], _value11 = _Object$entries$_i[1];
@@ -16857,15 +16887,15 @@ function _typeof(o) {
16857
16887
  })));
16858
16888
 
16859
16889
  case 24:
16860
- _context11.prev = 24;
16861
- _context11.t0 = _context11["catch"](0);
16862
- return _context11.abrupt("return", errorMessageHandler(_context11.t0, "FIREFLY"));
16890
+ _context12.prev = 24;
16891
+ _context12.t0 = _context12["catch"](0);
16892
+ return _context12.abrupt("return", errorMessageHandler(_context12.t0, "FIREFLY"));
16863
16893
 
16864
16894
  case 27:
16865
16895
  case "end":
16866
- return _context11.stop();
16896
+ return _context12.stop();
16867
16897
  }
16868
- }), _callee11, null, [ [ 0, 24 ] ]);
16898
+ }), _callee12, null, [ [ 0, 24 ] ]);
16869
16899
  })));
16870
16900
  return _FIREFLY.apply(this, arguments);
16871
16901
  }
@@ -16873,13 +16903,13 @@ function _typeof(o) {
16873
16903
  return _LENS.apply(this, arguments);
16874
16904
  }
16875
16905
  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) {
16906
+ _LENS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
16907
+ var _argsToArray5, _argsToArray6, contentType, identifier, _argsToArray6$, start, _argsToArray6$2, end, apiKey, url, typeMap, _getUrlAndHeaders5, finalUrl, HEADERS, response, _yield$response$json2, _data2, _args13 = arguments;
16908
+ return _regeneratorRuntime().wrap((function _callee13$(_context13) {
16909
+ while (1) switch (_context13.prev = _context13.next) {
16880
16910
  case 0:
16881
- _context12.prev = 0;
16882
- _argsToArray5 = argsToArray(_args12), _argsToArray6 = _slicedToArray(_argsToArray5, 4),
16911
+ _context13.prev = 0;
16912
+ _argsToArray5 = argsToArray(_args13), _argsToArray6 = _slicedToArray(_argsToArray5, 4),
16883
16913
  contentType = _argsToArray6[0], identifier = _argsToArray6[1], _argsToArray6$ = _argsToArray6[2],
16884
16914
  start = _argsToArray6$ === void 0 ? 0 : _argsToArray6$, _argsToArray6$2 = _argsToArray6[3],
16885
16915
  end = _argsToArray6$2 === void 0 ? 10 : _argsToArray6$2;
@@ -16908,35 +16938,35 @@ function _typeof(o) {
16908
16938
  "x-api-key": apiKey
16909
16939
  }
16910
16940
  }), finalUrl = _getUrlAndHeaders5.URL, HEADERS = _getUrlAndHeaders5.HEADERS;
16911
- _context12.next = 13;
16941
+ _context13.next = 13;
16912
16942
  return fetch(finalUrl, {
16913
16943
  method: "GET",
16914
16944
  headers: HEADERS
16915
16945
  });
16916
16946
 
16917
16947
  case 13:
16918
- response = _context12.sent;
16948
+ response = _context13.sent;
16919
16949
  if (response.ok) {
16920
- _context12.next = 16;
16950
+ _context13.next = 16;
16921
16951
  break;
16922
16952
  }
16923
16953
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
16924
16954
 
16925
16955
  case 16:
16926
- _context12.next = 18;
16956
+ _context13.next = 18;
16927
16957
  return response.json();
16928
16958
 
16929
16959
  case 18:
16930
- _yield$response$json2 = _context12.sent;
16960
+ _yield$response$json2 = _context13.sent;
16931
16961
  _data2 = _yield$response$json2.data;
16932
16962
  if (Array.isArray(_data2)) {
16933
- _context12.next = 22;
16963
+ _context13.next = 22;
16934
16964
  break;
16935
16965
  }
16936
- return _context12.abrupt("return", []);
16966
+ return _context13.abrupt("return", []);
16937
16967
 
16938
16968
  case 22:
16939
- return _context12.abrupt("return", _data2.map((function(item) {
16969
+ return _context13.abrupt("return", _data2.map((function(item) {
16940
16970
  var flat = {};
16941
16971
  for (var _i11 = 0, _Object$entries2 = Object.entries(item); _i11 < _Object$entries2.length; _i11++) {
16942
16972
  var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i11], 2), key = _Object$entries2$_i[0], _value12 = _Object$entries2$_i[1];
@@ -16949,15 +16979,15 @@ function _typeof(o) {
16949
16979
  })));
16950
16980
 
16951
16981
  case 25:
16952
- _context12.prev = 25;
16953
- _context12.t0 = _context12["catch"](0);
16954
- return _context12.abrupt("return", errorMessageHandler(_context12.t0, "LENS"));
16982
+ _context13.prev = 25;
16983
+ _context13.t0 = _context13["catch"](0);
16984
+ return _context13.abrupt("return", errorMessageHandler(_context13.t0, "LENS"));
16955
16985
 
16956
16986
  case 28:
16957
16987
  case "end":
16958
- return _context12.stop();
16988
+ return _context13.stop();
16959
16989
  }
16960
- }), _callee12, null, [ [ 0, 25 ] ]);
16990
+ }), _callee13, null, [ [ 0, 25 ] ]);
16961
16991
  })));
16962
16992
  return _LENS.apply(this, arguments);
16963
16993
  }
@@ -16965,13 +16995,13 @@ function _typeof(o) {
16965
16995
  return _FARCASTER.apply(this, arguments);
16966
16996
  }
16967
16997
  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) {
16998
+ _FARCASTER = _asyncToGenerator(_regeneratorRuntime().mark((function _callee14() {
16999
+ var _argsToArray7, _argsToArray8, contentType, identifier, _argsToArray8$, start, _argsToArray8$2, end, apiKey, url, typeMap, _getUrlAndHeaders6, finalUrl, HEADERS, response, _yield$response$json3, _data3, _args14 = arguments;
17000
+ return _regeneratorRuntime().wrap((function _callee14$(_context14) {
17001
+ while (1) switch (_context14.prev = _context14.next) {
16972
17002
  case 0:
16973
- _context13.prev = 0;
16974
- _argsToArray7 = argsToArray(_args13), _argsToArray8 = _slicedToArray(_argsToArray7, 4),
17003
+ _context14.prev = 0;
17004
+ _argsToArray7 = argsToArray(_args14), _argsToArray8 = _slicedToArray(_argsToArray7, 4),
16975
17005
  contentType = _argsToArray8[0], identifier = _argsToArray8[1], _argsToArray8$ = _argsToArray8[2],
16976
17006
  start = _argsToArray8$ === void 0 ? 0 : _argsToArray8$, _argsToArray8$2 = _argsToArray8[3],
16977
17007
  end = _argsToArray8$2 === void 0 ? 10 : _argsToArray8$2;
@@ -17001,35 +17031,35 @@ function _typeof(o) {
17001
17031
  "x-api-key": apiKey
17002
17032
  }
17003
17033
  }), finalUrl = _getUrlAndHeaders6.URL, HEADERS = _getUrlAndHeaders6.HEADERS;
17004
- _context13.next = 13;
17034
+ _context14.next = 13;
17005
17035
  return fetch(finalUrl, {
17006
17036
  method: "GET",
17007
17037
  headers: HEADERS
17008
17038
  });
17009
17039
 
17010
17040
  case 13:
17011
- response = _context13.sent;
17041
+ response = _context14.sent;
17012
17042
  if (response.ok) {
17013
- _context13.next = 16;
17043
+ _context14.next = 16;
17014
17044
  break;
17015
17045
  }
17016
17046
  throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
17017
17047
 
17018
17048
  case 16:
17019
- _context13.next = 18;
17049
+ _context14.next = 18;
17020
17050
  return response.json();
17021
17051
 
17022
17052
  case 18:
17023
- _yield$response$json3 = _context13.sent;
17053
+ _yield$response$json3 = _context14.sent;
17024
17054
  _data3 = _yield$response$json3.data;
17025
17055
  if (Array.isArray(_data3)) {
17026
- _context13.next = 22;
17056
+ _context14.next = 22;
17027
17057
  break;
17028
17058
  }
17029
- return _context13.abrupt("return", []);
17059
+ return _context14.abrupt("return", []);
17030
17060
 
17031
17061
  case 22:
17032
- return _context13.abrupt("return", _data3.map((function(item) {
17062
+ return _context14.abrupt("return", _data3.map((function(item) {
17033
17063
  var flat = {};
17034
17064
  for (var _i12 = 0, _Object$entries3 = Object.entries(item); _i12 < _Object$entries3.length; _i12++) {
17035
17065
  var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i12], 2), k = _Object$entries3$_i[0], v = _Object$entries3$_i[1];
@@ -17042,15 +17072,15 @@ function _typeof(o) {
17042
17072
  })));
17043
17073
 
17044
17074
  case 25:
17045
- _context13.prev = 25;
17046
- _context13.t0 = _context13["catch"](0);
17047
- return _context13.abrupt("return", errorMessageHandler(_context13.t0, "FARCASTER"));
17075
+ _context14.prev = 25;
17076
+ _context14.t0 = _context14["catch"](0);
17077
+ return _context14.abrupt("return", errorMessageHandler(_context14.t0, "FARCASTER"));
17048
17078
 
17049
17079
  case 28:
17050
17080
  case "end":
17051
- return _context13.stop();
17081
+ return _context14.stop();
17052
17082
  }
17053
- }), _callee13, null, [ [ 0, 25 ] ]);
17083
+ }), _callee14, null, [ [ 0, 25 ] ]);
17054
17084
  })));
17055
17085
  return _FARCASTER.apply(this, arguments);
17056
17086
  }
@@ -17058,13 +17088,13 @@ function _typeof(o) {
17058
17088
  return _BLOCKSCOUT.apply(this, arguments);
17059
17089
  }
17060
17090
  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) {
17091
+ _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15() {
17092
+ var _json$result, _json$result2, _argsToArray9, _argsToArray0, address, type, _argsToArray0$, chain, startTimestamp, endTimestamp, page, offset, startTs, endTs, resolvedAddress, hostname, requestUrl, response, json, _args15 = arguments;
17093
+ return _regeneratorRuntime().wrap((function _callee15$(_context15) {
17094
+ while (1) switch (_context15.prev = _context15.next) {
17065
17095
  case 0:
17066
- _context14.prev = 0;
17067
- _argsToArray9 = argsToArray(_args14), _argsToArray0 = _slicedToArray(_argsToArray9, 7),
17096
+ _context15.prev = 0;
17097
+ _argsToArray9 = argsToArray(_args15), _argsToArray0 = _slicedToArray(_argsToArray9, 7),
17068
17098
  address = _argsToArray0[0], type = _argsToArray0[1], _argsToArray0$ = _argsToArray0[2],
17069
17099
  chain = _argsToArray0$ === void 0 ? "ethereum" : _argsToArray0$, startTimestamp = _argsToArray0[3],
17070
17100
  endTimestamp = _argsToArray0[4], page = _argsToArray0[5], offset = _argsToArray0[6];
@@ -17079,85 +17109,72 @@ function _typeof(o) {
17079
17109
  });
17080
17110
  startTs = startTimestamp !== null && startTimestamp !== void 0 ? startTimestamp : Math.floor((Date.now() - 30 * 24 * 3600 * 1e3) / 1e3);
17081
17111
  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);
17112
+ _context15.next = 7;
17113
+ return fromEnsNameToAddress$1.validateAndGetAddress(address);
17090
17114
 
17091
- case 10:
17092
- resolvedAddress = _context14.sent;
17093
- if (resolvedAddress) {
17094
- _context14.next = 13;
17095
- break;
17096
- }
17097
- throw new EnsError(ensName);
17098
-
17099
- case 13:
17115
+ case 7:
17116
+ resolvedAddress = _context15.sent;
17100
17117
  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;
17118
+ _context15.t0 = type;
17119
+ _context15.next = _context15.t0 === "stat" ? 12 : _context15.t0 === "txns" ? 14 : _context15.t0 === "tokens" ? 16 : 18;
17103
17120
  break;
17104
17121
 
17105
- case 17:
17122
+ case 12:
17106
17123
  requestUrl = "".concat(hostname, "/api/v2/addresses/").concat(resolvedAddress, "/counters");
17107
- return _context14.abrupt("break", 23);
17124
+ return _context15.abrupt("break", 18);
17108
17125
 
17109
- case 19:
17126
+ case 14:
17110
17127
  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);
17128
+ return _context15.abrupt("break", 18);
17112
17129
 
17113
- case 21:
17130
+ case 16:
17114
17131
  requestUrl = "".concat(hostname, "/api?module=account&action=tokenlist") + "&address=".concat(resolvedAddress);
17115
- return _context14.abrupt("break", 23);
17132
+ return _context15.abrupt("break", 18);
17116
17133
 
17117
- case 23:
17118
- _context14.next = 25;
17134
+ case 18:
17135
+ _context15.next = 20;
17119
17136
  return fetch(requestUrl);
17120
17137
 
17121
- case 25:
17122
- response = _context14.sent;
17138
+ case 20:
17139
+ response = _context15.sent;
17123
17140
  if (response.ok) {
17124
- _context14.next = 28;
17141
+ _context15.next = 23;
17125
17142
  break;
17126
17143
  }
17127
17144
  throw new NetworkError("BLOCKSCOUT", response.status);
17128
17145
 
17129
- case 28:
17130
- _context14.next = 30;
17146
+ case 23:
17147
+ _context15.next = 25;
17131
17148
  return response.json();
17132
17149
 
17133
- case 30:
17134
- json = _context14.sent;
17150
+ case 25:
17151
+ json = _context15.sent;
17135
17152
  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;
17153
+ _context15.next = 28;
17137
17154
  break;
17138
17155
  }
17139
17156
  throw new ValidationError("Invalid parameters");
17140
17157
 
17141
- case 33:
17158
+ case 28:
17142
17159
  if (!(json !== null && json !== void 0 && (_json$result2 = json.result) !== null && _json$result2 !== void 0 && _json$result2.includes("Not found"))) {
17143
- _context14.next = 35;
17160
+ _context15.next = 30;
17144
17161
  break;
17145
17162
  }
17146
17163
  throw new ValidationError("Address information not found");
17147
17164
 
17148
- case 35:
17149
- return _context14.abrupt("return", type === "stat" ? [ json ] : json.result);
17165
+ case 30:
17166
+ return _context15.abrupt("return", type === "stat" ? [ json ] : json.result);
17150
17167
 
17151
- case 38:
17152
- _context14.prev = 38;
17153
- _context14.t1 = _context14["catch"](0);
17154
- return _context14.abrupt("return", errorMessageHandler(_context14.t1, "BLOCKSCOUT"));
17168
+ case 33:
17169
+ _context15.prev = 33;
17170
+ _context15.t1 = _context15["catch"](0);
17171
+ return _context15.abrupt("return", errorMessageHandler(_context15.t1, "BLOCKSCOUT"));
17155
17172
 
17156
- case 41:
17173
+ case 36:
17157
17174
  case "end":
17158
- return _context14.stop();
17175
+ return _context15.stop();
17159
17176
  }
17160
- }), _callee14, null, [ [ 0, 38 ] ]);
17177
+ }), _callee15, null, [ [ 0, 33 ] ]);
17161
17178
  })));
17162
17179
  return _BLOCKSCOUT.apply(this, arguments);
17163
17180
  }
@@ -17165,13 +17182,13 @@ function _typeof(o) {
17165
17182
  return _BASE.apply(this, arguments);
17166
17183
  }
17167
17184
  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) {
17185
+ _BASE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee16() {
17186
+ var _argsToArray1, _argsToArray10, type, address, startDate, endDate, page, limit, API_KEY, _args16 = arguments;
17187
+ return _regeneratorRuntime().wrap((function _callee16$(_context16) {
17188
+ while (1) switch (_context16.prev = _context16.next) {
17172
17189
  case 0:
17173
- _context15.prev = 0;
17174
- _argsToArray1 = argsToArray(_args15), _argsToArray10 = _slicedToArray(_argsToArray1, 6),
17190
+ _context16.prev = 0;
17191
+ _argsToArray1 = argsToArray(_args16), _argsToArray10 = _slicedToArray(_argsToArray1, 6),
17175
17192
  type = _argsToArray10[0], address = _argsToArray10[1], startDate = _argsToArray10[2],
17176
17193
  endDate = _argsToArray10[3], page = _argsToArray10[4], limit = _argsToArray10[5];
17177
17194
  validateParams(baseParamsSchema, {
@@ -17183,7 +17200,7 @@ function _typeof(o) {
17183
17200
  limit: limit
17184
17201
  });
17185
17202
  API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Basescan);
17186
- _context15.next = 6;
17203
+ _context16.next = 6;
17187
17204
  return handleScanRequest({
17188
17205
  type: type,
17189
17206
  address: address,
@@ -17198,18 +17215,18 @@ function _typeof(o) {
17198
17215
  });
17199
17216
 
17200
17217
  case 6:
17201
- return _context15.abrupt("return", _context15.sent);
17218
+ return _context16.abrupt("return", _context16.sent);
17202
17219
 
17203
17220
  case 9:
17204
- _context15.prev = 9;
17205
- _context15.t0 = _context15["catch"](0);
17206
- return _context15.abrupt("return", errorMessageHandler(_context15.t0, "BASE"));
17221
+ _context16.prev = 9;
17222
+ _context16.t0 = _context16["catch"](0);
17223
+ return _context16.abrupt("return", errorMessageHandler(_context16.t0, "BASE"));
17207
17224
 
17208
17225
  case 12:
17209
17226
  case "end":
17210
- return _context15.stop();
17227
+ return _context16.stop();
17211
17228
  }
17212
- }), _callee15, null, [ [ 0, 9 ] ]);
17229
+ }), _callee16, null, [ [ 0, 9 ] ]);
17213
17230
  })));
17214
17231
  return _BASE.apply(this, arguments);
17215
17232
  }
@@ -17217,13 +17234,13 @@ function _typeof(o) {
17217
17234
  return _GNOSIS.apply(this, arguments);
17218
17235
  }
17219
17236
  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) {
17237
+ _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
17238
+ var _argsToArray11, _argsToArray12, type, address, startDate, endDate, _argsToArray12$, page, _argsToArray12$2, limit, apiKey, _args17 = arguments;
17239
+ return _regeneratorRuntime().wrap((function _callee17$(_context17) {
17240
+ while (1) switch (_context17.prev = _context17.next) {
17224
17241
  case 0:
17225
- _context16.prev = 0;
17226
- _argsToArray11 = argsToArray(_args16), _argsToArray12 = _slicedToArray(_argsToArray11, 6),
17242
+ _context17.prev = 0;
17243
+ _argsToArray11 = argsToArray(_args17), _argsToArray12 = _slicedToArray(_argsToArray11, 6),
17227
17244
  type = _argsToArray12[0], address = _argsToArray12[1], startDate = _argsToArray12[2],
17228
17245
  endDate = _argsToArray12[3], _argsToArray12$ = _argsToArray12[4], page = _argsToArray12$ === void 0 ? 1 : _argsToArray12$,
17229
17246
  _argsToArray12$2 = _argsToArray12[5], limit = _argsToArray12$2 === void 0 ? 10 : _argsToArray12$2;
@@ -17236,7 +17253,7 @@ function _typeof(o) {
17236
17253
  limit: limit
17237
17254
  });
17238
17255
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Gnosisscan);
17239
- _context16.next = 6;
17256
+ _context17.next = 6;
17240
17257
  return handleScanRequest({
17241
17258
  type: type,
17242
17259
  address: address,
@@ -17251,18 +17268,18 @@ function _typeof(o) {
17251
17268
  });
17252
17269
 
17253
17270
  case 6:
17254
- return _context16.abrupt("return", _context16.sent);
17271
+ return _context17.abrupt("return", _context17.sent);
17255
17272
 
17256
17273
  case 9:
17257
- _context16.prev = 9;
17258
- _context16.t0 = _context16["catch"](0);
17259
- return _context16.abrupt("return", errorMessageHandler(_context16.t0, "GNOSIS"));
17274
+ _context17.prev = 9;
17275
+ _context17.t0 = _context17["catch"](0);
17276
+ return _context17.abrupt("return", errorMessageHandler(_context17.t0, "GNOSIS"));
17260
17277
 
17261
17278
  case 12:
17262
17279
  case "end":
17263
- return _context16.stop();
17280
+ return _context17.stop();
17264
17281
  }
17265
- }), _callee16, null, [ [ 0, 9 ] ]);
17282
+ }), _callee17, null, [ [ 0, 9 ] ]);
17266
17283
  })));
17267
17284
  return _GNOSIS.apply(this, arguments);
17268
17285
  }
@@ -17270,28 +17287,28 @@ function _typeof(o) {
17270
17287
  return _NEYNAR.apply(this, arguments);
17271
17288
  }
17272
17289
  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) {
17290
+ _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee18() {
17291
+ var neynarParamsSchema, _argsToArray13, _argsToArray14, username, apiKey, fid, url, _getUrlAndHeaders7, finalUrl, HEADERS, response, json, users, _args18 = arguments;
17292
+ return _regeneratorRuntime().wrap((function _callee18$(_context18) {
17293
+ while (1) switch (_context18.prev = _context18.next) {
17277
17294
  case 0:
17278
- _context17.prev = 0;
17295
+ _context18.prev = 0;
17279
17296
  neynarParamsSchema = objectType({
17280
17297
  username: stringType().nonempty()
17281
17298
  });
17282
- _argsToArray13 = argsToArray(_args17), _argsToArray14 = _slicedToArray(_argsToArray13, 1),
17299
+ _argsToArray13 = argsToArray(_args18), _argsToArray14 = _slicedToArray(_argsToArray13, 1),
17283
17300
  username = _argsToArray14[0];
17284
17301
  validateParams(neynarParamsSchema, {
17285
17302
  username: username
17286
17303
  });
17287
17304
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Neynar);
17288
- _context17.next = 7;
17305
+ _context18.next = 7;
17289
17306
  return fromUsernameToFid$1.fromUsernameToFid(username, apiKey);
17290
17307
 
17291
17308
  case 7:
17292
- fid = _context17.sent;
17309
+ fid = _context18.sent;
17293
17310
  if (fid) {
17294
- _context17.next = 10;
17311
+ _context18.next = 10;
17295
17312
  break;
17296
17313
  }
17297
17314
  throw new ValidationError("Invalid username: ".concat(username));
@@ -17306,37 +17323,37 @@ function _typeof(o) {
17306
17323
  "x-neynar-experimental": "false"
17307
17324
  }
17308
17325
  }), finalUrl = _getUrlAndHeaders7.URL, HEADERS = _getUrlAndHeaders7.HEADERS;
17309
- _context17.next = 14;
17326
+ _context18.next = 14;
17310
17327
  return fetch(finalUrl, {
17311
17328
  method: "GET",
17312
17329
  headers: HEADERS
17313
17330
  });
17314
17331
 
17315
17332
  case 14:
17316
- response = _context17.sent;
17333
+ response = _context18.sent;
17317
17334
  if (response.ok) {
17318
- _context17.next = 17;
17335
+ _context18.next = 17;
17319
17336
  break;
17320
17337
  }
17321
17338
  throw new NetworkError(SERVICES_API_KEY.Neynar, response.status);
17322
17339
 
17323
17340
  case 17:
17324
- _context17.next = 19;
17341
+ _context18.next = 19;
17325
17342
  return response.json();
17326
17343
 
17327
17344
  case 19:
17328
- json = _context17.sent;
17345
+ json = _context18.sent;
17329
17346
  users = (json === null || json === void 0 ? void 0 : json.users) || [];
17330
17347
  if (users.length) {
17331
- _context17.next = 23;
17348
+ _context18.next = 23;
17332
17349
  break;
17333
17350
  }
17334
- return _context17.abrupt("return", []);
17351
+ return _context18.abrupt("return", []);
17335
17352
 
17336
17353
  case 23:
17337
- return _context17.abrupt("return", users.map((function(_ref14) {
17354
+ return _context18.abrupt("return", users.map((function(_ref15) {
17338
17355
  var _user$profile, _user$profile2;
17339
- var user = _ref14.user;
17356
+ var user = _ref15.user;
17340
17357
  return {
17341
17358
  username: user.username,
17342
17359
  custody_address: user.custody_address,
@@ -17347,15 +17364,15 @@ function _typeof(o) {
17347
17364
  })));
17348
17365
 
17349
17366
  case 26:
17350
- _context17.prev = 26;
17351
- _context17.t0 = _context17["catch"](0);
17352
- return _context17.abrupt("return", errorMessageHandler(_context17.t0, "NEYNAR"));
17367
+ _context18.prev = 26;
17368
+ _context18.t0 = _context18["catch"](0);
17369
+ return _context18.abrupt("return", errorMessageHandler(_context18.t0, "NEYNAR"));
17353
17370
 
17354
17371
  case 29:
17355
17372
  case "end":
17356
- return _context17.stop();
17373
+ return _context18.stop();
17357
17374
  }
17358
- }), _callee17, null, [ [ 0, 26 ] ]);
17375
+ }), _callee18, null, [ [ 0, 26 ] ]);
17359
17376
  })));
17360
17377
  return _NEYNAR.apply(this, arguments);
17361
17378
  }
@@ -17363,13 +17380,13 @@ function _typeof(o) {
17363
17380
  return _ETHERSCAN.apply(this, arguments);
17364
17381
  }
17365
17382
  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) {
17383
+ _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee19() {
17384
+ var _argsToArray15, _argsToArray16, type, chain, address, startDate, endDate, _argsToArray16$, page, _argsToArray16$2, limit, chainId, apiKey, _args19 = arguments;
17385
+ return _regeneratorRuntime().wrap((function _callee19$(_context19) {
17386
+ while (1) switch (_context19.prev = _context19.next) {
17370
17387
  case 0:
17371
- _context18.prev = 0;
17372
- _argsToArray15 = argsToArray(_args18), _argsToArray16 = _slicedToArray(_argsToArray15, 7),
17388
+ _context19.prev = 0;
17389
+ _argsToArray15 = argsToArray(_args19), _argsToArray16 = _slicedToArray(_argsToArray15, 7),
17373
17390
  type = _argsToArray16[0], chain = _argsToArray16[1], address = _argsToArray16[2],
17374
17391
  startDate = _argsToArray16[3], endDate = _argsToArray16[4], _argsToArray16$ = _argsToArray16[5],
17375
17392
  page = _argsToArray16$ === void 0 ? 1 : _argsToArray16$, _argsToArray16$2 = _argsToArray16[6],
@@ -17385,14 +17402,14 @@ function _typeof(o) {
17385
17402
  });
17386
17403
  chainId = CHAIN_ID_MAP[chain];
17387
17404
  if (chainId) {
17388
- _context18.next = 6;
17405
+ _context19.next = 6;
17389
17406
  break;
17390
17407
  }
17391
17408
  throw new ValidationError("Invalid chain: ".concat(chain));
17392
17409
 
17393
17410
  case 6:
17394
17411
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Etherscan);
17395
- _context18.next = 9;
17412
+ _context19.next = 9;
17396
17413
  return handleScanRequest({
17397
17414
  type: type,
17398
17415
  address: address,
@@ -17407,18 +17424,18 @@ function _typeof(o) {
17407
17424
  });
17408
17425
 
17409
17426
  case 9:
17410
- return _context18.abrupt("return", _context18.sent);
17427
+ return _context19.abrupt("return", _context19.sent);
17411
17428
 
17412
17429
  case 12:
17413
- _context18.prev = 12;
17414
- _context18.t0 = _context18["catch"](0);
17415
- return _context18.abrupt("return", errorMessageHandler(_context18.t0, "ETHERSCAN"));
17430
+ _context19.prev = 12;
17431
+ _context19.t0 = _context19["catch"](0);
17432
+ return _context19.abrupt("return", errorMessageHandler(_context19.t0, "ETHERSCAN"));
17416
17433
 
17417
17434
  case 15:
17418
17435
  case "end":
17419
- return _context18.stop();
17436
+ return _context19.stop();
17420
17437
  }
17421
- }), _callee18, null, [ [ 0, 12 ] ]);
17438
+ }), _callee19, null, [ [ 0, 12 ] ]);
17422
17439
  })));
17423
17440
  return _ETHERSCAN.apply(this, arguments);
17424
17441
  }
@@ -17426,13 +17443,13 @@ function _typeof(o) {
17426
17443
  return _COINGECKO.apply(this, arguments);
17427
17444
  }
17428
17445
  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) {
17446
+ _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20() {
17447
+ 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, _args20 = arguments;
17448
+ return _regeneratorRuntime().wrap((function _callee20$(_context20) {
17449
+ while (1) switch (_context20.prev = _context20.next) {
17433
17450
  case 0:
17434
- _context19.prev = 0;
17435
- _argsToArray17 = argsToArray(_args19), _argsToArray18 = _slicedToArray(_argsToArray17, 3),
17451
+ _context20.prev = 0;
17452
+ _argsToArray17 = argsToArray(_args20), _argsToArray18 = _slicedToArray(_argsToArray17, 3),
17436
17453
  category = _argsToArray18[0], param1 = _argsToArray18[1], param2 = _argsToArray18[2];
17437
17454
  validateParams(coingeckoParamsSchema, {
17438
17455
  category: category,
@@ -17445,14 +17462,14 @@ function _typeof(o) {
17445
17462
  "x-cg-demo-api-key": apiKey
17446
17463
  };
17447
17464
  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;
17465
+ _context20.t0 = category === null || category === void 0 || (_category$toLowerCase = category.toLowerCase) === null || _category$toLowerCase === void 0 ? void 0 : _category$toLowerCase.call(category);
17466
+ _context20.next = _context20.t0 === "price" ? 9 : _context20.t0 === "market" ? 12 : _context20.t0 === "stablecoins" ? 17 : _context20.t0 === "derivatives" ? 21 : 23;
17450
17467
  break;
17451
17468
 
17452
17469
  case 9:
17453
17470
  vs = param2 || "usd";
17454
17471
  url = "https://api.coingecko.com/api/v3/simple/price?vs_currencies=".concat(vs, "&symbols=").concat(param1);
17455
- return _context19.abrupt("break", 23);
17472
+ return _context20.abrupt("break", 23);
17456
17473
 
17457
17474
  case 12:
17458
17475
  map = {
@@ -17469,17 +17486,17 @@ function _typeof(o) {
17469
17486
  _category = map[param1] || "";
17470
17487
  trend = param2 ? "&price_change_percentage=".concat(param2) : "";
17471
17488
  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);
17489
+ return _context20.abrupt("break", 23);
17473
17490
 
17474
17491
  case 17:
17475
17492
  _category2 = param1 === "all" ? "stablecoins" : param1;
17476
17493
  _trend = param2 ? "&price_change_percentage=".concat(param2) : "";
17477
17494
  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);
17495
+ return _context20.abrupt("break", 23);
17479
17496
 
17480
17497
  case 21:
17481
17498
  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);
17499
+ return _context20.abrupt("break", 23);
17483
17500
 
17484
17501
  case 23:
17485
17502
  _getUrlAndHeaders8 = getUrlAndHeaders({
@@ -17487,25 +17504,25 @@ function _typeof(o) {
17487
17504
  serviceName: "Coingecko",
17488
17505
  headers: headers
17489
17506
  }), finalUrl = _getUrlAndHeaders8.URL, HEADERS = _getUrlAndHeaders8.HEADERS;
17490
- _context19.next = 26;
17507
+ _context20.next = 26;
17491
17508
  return fetch(finalUrl, {
17492
17509
  headers: HEADERS
17493
17510
  });
17494
17511
 
17495
17512
  case 26:
17496
- res = _context19.sent;
17497
- _context19.next = 29;
17513
+ res = _context20.sent;
17514
+ _context20.next = 29;
17498
17515
  return res.json();
17499
17516
 
17500
17517
  case 29:
17501
- json = _context19.sent;
17518
+ json = _context20.sent;
17502
17519
  if (res.ok) {
17503
- _context19.next = 35;
17520
+ _context20.next = 35;
17504
17521
  break;
17505
17522
  }
17506
17523
  msg = (json === null || json === void 0 || (_json$status = json.status) === null || _json$status === void 0 ? void 0 : _json$status.error_message) || "";
17507
17524
  if (!msg.includes("API Key Missing")) {
17508
- _context19.next = 34;
17525
+ _context20.next = 34;
17509
17526
  break;
17510
17527
  }
17511
17528
  throw new InvalidApiKeyError(SERVICES_API_KEY.Coingecko);
@@ -17515,7 +17532,7 @@ function _typeof(o) {
17515
17532
 
17516
17533
  case 35:
17517
17534
  if (!(category === "price")) {
17518
- _context19.next = 39;
17535
+ _context20.next = 39;
17519
17536
  break;
17520
17537
  }
17521
17538
  out = {};
@@ -17528,11 +17545,11 @@ function _typeof(o) {
17528
17545
  out["".concat(token.charAt(0).toUpperCase() + token.slice(1), "_").concat(cur.toUpperCase())] = val;
17529
17546
  }
17530
17547
  }
17531
- return _context19.abrupt("return", [ out ]);
17548
+ return _context20.abrupt("return", [ out ]);
17532
17549
 
17533
17550
  case 39:
17534
17551
  _data4 = Array.isArray(json) ? json : [ json ];
17535
- return _context19.abrupt("return", _data4.map((function(item) {
17552
+ return _context20.abrupt("return", _data4.map((function(item) {
17536
17553
  var flat = {};
17537
17554
  for (var _i15 = 0, _Object$entries6 = Object.entries(item); _i15 < _Object$entries6.length; _i15++) {
17538
17555
  var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i15], 2), key = _Object$entries6$_i[0], _value13 = _Object$entries6$_i[1];
@@ -17544,15 +17561,15 @@ function _typeof(o) {
17544
17561
  })));
17545
17562
 
17546
17563
  case 43:
17547
- _context19.prev = 43;
17548
- _context19.t1 = _context19["catch"](0);
17549
- return _context19.abrupt("return", errorMessageHandler(_context19.t1, "COINGECKO"));
17564
+ _context20.prev = 43;
17565
+ _context20.t1 = _context20["catch"](0);
17566
+ return _context20.abrupt("return", errorMessageHandler(_context20.t1, "COINGECKO"));
17550
17567
 
17551
17568
  case 46:
17552
17569
  case "end":
17553
- return _context19.stop();
17570
+ return _context20.stop();
17554
17571
  }
17555
- }), _callee19, null, [ [ 0, 43 ] ]);
17572
+ }), _callee20, null, [ [ 0, 43 ] ]);
17556
17573
  })));
17557
17574
  return _COINGECKO.apply(this, arguments);
17558
17575
  }
@@ -17560,74 +17577,74 @@ function _typeof(o) {
17560
17577
  return _EOA.apply(this, arguments);
17561
17578
  }
17562
17579
  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) {
17580
+ _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee22() {
17581
+ 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;
17582
+ return _regeneratorRuntime().wrap((function _callee22$(_context25) {
17583
+ while (1) switch (_context25.prev = _context25.next) {
17567
17584
  case 0:
17568
- _context24.prev = 0;
17585
+ _context25.prev = 0;
17569
17586
  fetchJSON = function() {
17570
- var _ref15 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20(url) {
17587
+ var _ref16 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee21(url) {
17571
17588
  var _getUrlAndHeaders9, finalUrl, HEADERS, res, json;
17572
- return _regeneratorRuntime().wrap((function _callee20$(_context20) {
17573
- while (1) switch (_context20.prev = _context20.next) {
17589
+ return _regeneratorRuntime().wrap((function _callee21$(_context21) {
17590
+ while (1) switch (_context21.prev = _context21.next) {
17574
17591
  case 0:
17575
17592
  _getUrlAndHeaders9 = getUrlAndHeaders({
17576
17593
  url: url,
17577
17594
  serviceName: "Etherscan",
17578
17595
  headers: {}
17579
17596
  }), finalUrl = _getUrlAndHeaders9.URL, HEADERS = _getUrlAndHeaders9.HEADERS;
17580
- _context20.next = 3;
17597
+ _context21.next = 3;
17581
17598
  return fetch(finalUrl, {
17582
17599
  method: "GET",
17583
17600
  headers: HEADERS
17584
17601
  });
17585
17602
 
17586
17603
  case 3:
17587
- res = _context20.sent;
17604
+ res = _context21.sent;
17588
17605
  if (res.ok) {
17589
- _context20.next = 6;
17606
+ _context21.next = 6;
17590
17607
  break;
17591
17608
  }
17592
17609
  throw new NetworkError(SERVICES_API_KEY.Etherscan, res.status);
17593
17610
 
17594
17611
  case 6:
17595
- _context20.next = 8;
17612
+ _context21.next = 8;
17596
17613
  return res.json();
17597
17614
 
17598
17615
  case 8:
17599
- json = _context20.sent;
17616
+ json = _context21.sent;
17600
17617
  if (!(typeof json.result === "string")) {
17601
- _context20.next = 14;
17618
+ _context21.next = 14;
17602
17619
  break;
17603
17620
  }
17604
17621
  if (!json.result.includes("Invalid API Key")) {
17605
- _context20.next = 12;
17622
+ _context21.next = 12;
17606
17623
  break;
17607
17624
  }
17608
17625
  throw new InvalidApiKeyError(SERVICES_API_KEY.Etherscan);
17609
17626
 
17610
17627
  case 12:
17611
17628
  if (!json.result.includes("Max rate limit reached")) {
17612
- _context20.next = 14;
17629
+ _context21.next = 14;
17613
17630
  break;
17614
17631
  }
17615
17632
  throw new RateLimitError(SERVICES_API_KEY.Etherscan);
17616
17633
 
17617
17634
  case 14:
17618
- return _context20.abrupt("return", json.result);
17635
+ return _context21.abrupt("return", json.result);
17619
17636
 
17620
17637
  case 15:
17621
17638
  case "end":
17622
- return _context20.stop();
17639
+ return _context21.stop();
17623
17640
  }
17624
- }), _callee20);
17641
+ }), _callee21);
17625
17642
  })));
17626
- return function fetchJSON(_x17) {
17627
- return _ref15.apply(this, arguments);
17643
+ return function fetchJSON(_x18) {
17644
+ return _ref16.apply(this, arguments);
17628
17645
  };
17629
17646
  }();
17630
- _argsToArray19 = argsToArray(_args24), _argsToArray20 = _slicedToArray(_argsToArray19, 7),
17647
+ _argsToArray19 = argsToArray(_args25), _argsToArray20 = _slicedToArray(_argsToArray19, 7),
17631
17648
  addresses = _argsToArray20[0], category = _argsToArray20[1], chains = _argsToArray20[2],
17632
17649
  startTime = _argsToArray20[3], endTime = _argsToArray20[4], _argsToArray20$ = _argsToArray20[5],
17633
17650
  page = _argsToArray20$ === void 0 ? 1 : _argsToArray20$, _argsToArray20$2 = _argsToArray20[6],
@@ -17650,97 +17667,89 @@ function _typeof(o) {
17650
17667
  })).filter(Boolean);
17651
17668
  ADDRESS_MAP = {};
17652
17669
  _iterator41 = _createForOfIteratorHelper(INPUTS);
17653
- _context24.prev = 9;
17670
+ _context25.prev = 9;
17654
17671
  _iterator41.s();
17655
17672
 
17656
17673
  case 11:
17657
17674
  if ((_step41 = _iterator41.n()).done) {
17658
- _context24.next = 26;
17675
+ _context25.next = 23;
17659
17676
  break;
17660
17677
  }
17661
17678
  inp = _step41.value;
17662
17679
  if (!isAddress$1.isAddress(inp)) {
17663
- _context24.next = 17;
17680
+ _context25.next = 17;
17664
17681
  break;
17665
17682
  }
17666
17683
  ADDRESS_MAP[inp.toLowerCase()] = null;
17667
- _context24.next = 24;
17684
+ _context25.next = 21;
17668
17685
  break;
17669
17686
 
17670
17687
  case 17:
17671
- ens = inp;
17672
- _context24.next = 20;
17673
- return fromEnsNameToAddress$1.fromEnsNameToAddress(ens);
17688
+ _context25.next = 19;
17689
+ return fromEnsNameToAddress$1.validateAndGetAddress(inp);
17674
17690
 
17675
- case 20:
17676
- resolved = _context24.sent;
17677
- if (resolved) {
17678
- _context24.next = 23;
17679
- break;
17680
- }
17681
- throw new EnsError(ens);
17682
-
17683
- case 23:
17684
- ADDRESS_MAP[resolved.toLowerCase()] = ens;
17691
+ case 19:
17692
+ _address = _context25.sent;
17693
+ ADDRESS_MAP[_address.toLowerCase()] = _address;
17685
17694
 
17686
- case 24:
17687
- _context24.next = 11;
17695
+ case 21:
17696
+ _context25.next = 11;
17688
17697
  break;
17689
17698
 
17690
- case 26:
17691
- _context24.next = 31;
17699
+ case 23:
17700
+ _context25.next = 28;
17692
17701
  break;
17693
17702
 
17694
- case 28:
17695
- _context24.prev = 28;
17696
- _context24.t0 = _context24["catch"](9);
17697
- _iterator41.e(_context24.t0);
17703
+ case 25:
17704
+ _context25.prev = 25;
17705
+ _context25.t0 = _context25["catch"](9);
17706
+ _iterator41.e(_context25.t0);
17698
17707
 
17699
- case 31:
17700
- _context24.prev = 31;
17708
+ case 28:
17709
+ _context25.prev = 28;
17701
17710
  _iterator41.f();
17702
- return _context24.finish(31);
17711
+ return _context25.finish(28);
17703
17712
 
17704
- case 34:
17713
+ case 31:
17705
17714
  ADDRS = Object.keys(ADDRESS_MAP);
17706
17715
  out = [];
17707
17716
  _iterator42 = _createForOfIteratorHelper(CHAINS);
17708
- _context24.prev = 37;
17717
+ _context25.prev = 34;
17709
17718
  _loop = _regeneratorRuntime().mark((function _loop() {
17710
17719
  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) {
17720
+ return _regeneratorRuntime().wrap((function _loop$(_context24) {
17721
+ while (1) switch (_context24.prev = _context24.next) {
17713
17722
  case 0:
17714
17723
  chain = _step42.value;
17715
17724
  chainId = CHAIN_ID_MAP[chain];
17716
17725
  if (chainId) {
17717
- _context23.next = 4;
17726
+ _context24.next = 4;
17718
17727
  break;
17719
17728
  }
17720
17729
  throw new ValidationError("Invalid chain: ".concat(chain));
17721
17730
 
17722
17731
  case 4:
17723
17732
  if (!(category === "balance")) {
17724
- _context23.next = 17;
17733
+ _context24.next = 17;
17725
17734
  break;
17726
17735
  }
17727
17736
  _loop2 = _regeneratorRuntime().mark((function _loop2(i) {
17728
17737
  var slice, url, data;
17729
- return _regeneratorRuntime().wrap((function _loop2$(_context21) {
17730
- while (1) switch (_context21.prev = _context21.next) {
17738
+ return _regeneratorRuntime().wrap((function _loop2$(_context22) {
17739
+ while (1) switch (_context22.prev = _context22.next) {
17731
17740
  case 0:
17732
17741
  slice = ADDRS.slice(i, i + 20).join(",");
17733
17742
  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;
17743
+ _context22.next = 4;
17735
17744
  return fetchJSON(url);
17736
17745
 
17737
17746
  case 4:
17738
- data = _context21.sent;
17747
+ data = _context22.sent;
17739
17748
  if (Array.isArray(data)) {
17740
- _context21.next = 7;
17749
+ _context22.next = 7;
17741
17750
  break;
17742
17751
  }
17743
- return _context21.abrupt("return", {
17752
+ return _context22.abrupt("return", {
17744
17753
  v: {
17745
17754
  v: data
17746
17755
  }
@@ -17757,7 +17766,7 @@ function _typeof(o) {
17757
17766
 
17758
17767
  case 8:
17759
17768
  case "end":
17760
- return _context21.stop();
17769
+ return _context22.stop();
17761
17770
  }
17762
17771
  }), _loop2);
17763
17772
  }));
@@ -17765,48 +17774,48 @@ function _typeof(o) {
17765
17774
 
17766
17775
  case 7:
17767
17776
  if (!(i < ADDRS.length)) {
17768
- _context23.next = 15;
17777
+ _context24.next = 15;
17769
17778
  break;
17770
17779
  }
17771
- return _context23.delegateYield(_loop2(i), "t0", 9);
17780
+ return _context24.delegateYield(_loop2(i), "t0", 9);
17772
17781
 
17773
17782
  case 9:
17774
- _ret2 = _context23.t0;
17783
+ _ret2 = _context24.t0;
17775
17784
  if (!_ret2) {
17776
- _context23.next = 12;
17785
+ _context24.next = 12;
17777
17786
  break;
17778
17787
  }
17779
- return _context23.abrupt("return", _ret2.v);
17788
+ return _context24.abrupt("return", _ret2.v);
17780
17789
 
17781
17790
  case 12:
17782
17791
  i += 20;
17783
- _context23.next = 7;
17792
+ _context24.next = 7;
17784
17793
  break;
17785
17794
 
17786
17795
  case 15:
17787
- _context23.next = 37;
17796
+ _context24.next = 37;
17788
17797
  break;
17789
17798
 
17790
17799
  case 17:
17791
- _context23.next = 19;
17800
+ _context24.next = 19;
17792
17801
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startTime), chain, apiKey);
17793
17802
 
17794
17803
  case 19:
17795
- sb = _context23.sent;
17796
- _context23.next = 22;
17804
+ sb = _context24.sent;
17805
+ _context24.next = 22;
17797
17806
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endTime), chain, apiKey);
17798
17807
 
17799
17808
  case 22:
17800
- eb = _context23.sent;
17809
+ eb = _context24.sent;
17801
17810
  if (sb) {
17802
- _context23.next = 25;
17811
+ _context24.next = 25;
17803
17812
  break;
17804
17813
  }
17805
17814
  throw new ValidationError("Invalid startTime: ".concat(startTime));
17806
17815
 
17807
17816
  case 25:
17808
17817
  if (eb) {
17809
- _context23.next = 27;
17818
+ _context24.next = 27;
17810
17819
  break;
17811
17820
  }
17812
17821
  throw new ValidationError("Invalid endTime: ".concat(endTime));
@@ -17814,21 +17823,21 @@ function _typeof(o) {
17814
17823
  case 27:
17815
17824
  _loop3 = _regeneratorRuntime().mark((function _loop3() {
17816
17825
  var addr, url, data;
17817
- return _regeneratorRuntime().wrap((function _loop3$(_context22) {
17818
- while (1) switch (_context22.prev = _context22.next) {
17826
+ return _regeneratorRuntime().wrap((function _loop3$(_context23) {
17827
+ while (1) switch (_context23.prev = _context23.next) {
17819
17828
  case 0:
17820
17829
  addr = _ADDRS[_i16];
17821
17830
  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;
17831
+ _context23.next = 4;
17823
17832
  return fetchJSON(url);
17824
17833
 
17825
17834
  case 4:
17826
- data = _context22.sent;
17835
+ data = _context23.sent;
17827
17836
  if (Array.isArray(data)) {
17828
- _context22.next = 7;
17837
+ _context23.next = 7;
17829
17838
  break;
17830
17839
  }
17831
- return _context22.abrupt("return", {
17840
+ return _context23.abrupt("return", {
17832
17841
  v: {
17833
17842
  v: data
17834
17843
  }
@@ -17845,7 +17854,7 @@ function _typeof(o) {
17845
17854
 
17846
17855
  case 8:
17847
17856
  case "end":
17848
- return _context22.stop();
17857
+ return _context23.stop();
17849
17858
  }
17850
17859
  }), _loop3);
17851
17860
  }));
@@ -17853,90 +17862,90 @@ function _typeof(o) {
17853
17862
 
17854
17863
  case 29:
17855
17864
  if (!(_i16 < _ADDRS.length)) {
17856
- _context23.next = 37;
17865
+ _context24.next = 37;
17857
17866
  break;
17858
17867
  }
17859
- return _context23.delegateYield(_loop3(), "t1", 31);
17868
+ return _context24.delegateYield(_loop3(), "t1", 31);
17860
17869
 
17861
17870
  case 31:
17862
- _ret3 = _context23.t1;
17871
+ _ret3 = _context24.t1;
17863
17872
  if (!_ret3) {
17864
- _context23.next = 34;
17873
+ _context24.next = 34;
17865
17874
  break;
17866
17875
  }
17867
- return _context23.abrupt("return", _ret3.v);
17876
+ return _context24.abrupt("return", _ret3.v);
17868
17877
 
17869
17878
  case 34:
17870
17879
  _i16++;
17871
- _context23.next = 29;
17880
+ _context24.next = 29;
17872
17881
  break;
17873
17882
 
17874
17883
  case 37:
17875
17884
  case "end":
17876
- return _context23.stop();
17885
+ return _context24.stop();
17877
17886
  }
17878
17887
  }), _loop);
17879
17888
  }));
17880
17889
  _iterator42.s();
17881
17890
 
17882
- case 40:
17891
+ case 37:
17883
17892
  if ((_step42 = _iterator42.n()).done) {
17884
- _context24.next = 47;
17893
+ _context25.next = 44;
17885
17894
  break;
17886
17895
  }
17887
- return _context24.delegateYield(_loop(), "t1", 42);
17896
+ return _context25.delegateYield(_loop(), "t1", 39);
17888
17897
 
17889
- case 42:
17890
- _ret = _context24.t1;
17898
+ case 39:
17899
+ _ret = _context25.t1;
17891
17900
  if (!_ret) {
17892
- _context24.next = 45;
17901
+ _context25.next = 42;
17893
17902
  break;
17894
17903
  }
17895
- return _context24.abrupt("return", _ret.v);
17904
+ return _context25.abrupt("return", _ret.v);
17896
17905
 
17897
- case 45:
17898
- _context24.next = 40;
17906
+ case 42:
17907
+ _context25.next = 37;
17899
17908
  break;
17900
17909
 
17901
- case 47:
17902
- _context24.next = 52;
17910
+ case 44:
17911
+ _context25.next = 49;
17903
17912
  break;
17904
17913
 
17914
+ case 46:
17915
+ _context25.prev = 46;
17916
+ _context25.t2 = _context25["catch"](34);
17917
+ _iterator42.e(_context25.t2);
17918
+
17905
17919
  case 49:
17906
- _context24.prev = 49;
17907
- _context24.t2 = _context24["catch"](37);
17908
- _iterator42.e(_context24.t2);
17920
+ _context25.prev = 49;
17921
+ _iterator42.f();
17922
+ return _context25.finish(49);
17909
17923
 
17910
17924
  case 52:
17911
- _context24.prev = 52;
17912
- _iterator42.f();
17913
- return _context24.finish(52);
17925
+ return _context25.abrupt("return", out);
17914
17926
 
17915
17927
  case 55:
17916
- return _context24.abrupt("return", out);
17928
+ _context25.prev = 55;
17929
+ _context25.t3 = _context25["catch"](0);
17930
+ return _context25.abrupt("return", errorMessageHandler(_context25.t3, "EOA"));
17917
17931
 
17918
17932
  case 58:
17919
- _context24.prev = 58;
17920
- _context24.t3 = _context24["catch"](0);
17921
- return _context24.abrupt("return", errorMessageHandler(_context24.t3, "EOA"));
17922
-
17923
- case 61:
17924
17933
  case "end":
17925
- return _context24.stop();
17934
+ return _context25.stop();
17926
17935
  }
17927
- }), _callee21, null, [ [ 0, 58 ], [ 9, 28, 31, 34 ], [ 37, 49, 52, 55 ] ]);
17936
+ }), _callee22, null, [ [ 0, 55 ], [ 9, 25, 28, 31 ], [ 34, 46, 49, 52 ] ]);
17928
17937
  })));
17929
17938
  return _EOA.apply(this, arguments);
17930
17939
  }
17931
- function FLVURL(_x15, _x16) {
17940
+ function FLVURL(_x16, _x17) {
17932
17941
  return _FLVURL.apply(this, arguments);
17933
17942
  }
17934
17943
  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) {
17944
+ _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee23(token, vs_currencies) {
17945
+ return _regeneratorRuntime().wrap((function _callee23$(_context26) {
17946
+ while (1) switch (_context26.prev = _context26.next) {
17938
17947
  case 0:
17939
- return _context25.abrupt("return", new Promise((function(resolve) {
17948
+ return _context26.abrupt("return", new Promise((function(resolve) {
17940
17949
  setTimeout((function() {
17941
17950
  resolve([ {
17942
17951
  Yoo: "gotcha"
@@ -17946,9 +17955,9 @@ function _typeof(o) {
17946
17955
 
17947
17956
  case 1:
17948
17957
  case "end":
17949
- return _context25.stop();
17958
+ return _context26.stop();
17950
17959
  }
17951
- }), _callee22);
17960
+ }), _callee23);
17952
17961
  })));
17953
17962
  return _FLVURL.apply(this, arguments);
17954
17963
  }
@@ -17956,13 +17965,13 @@ function _typeof(o) {
17956
17965
  return _SAFE.apply(this, arguments);
17957
17966
  }
17958
17967
  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) {
17968
+ _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee24() {
17969
+ var _argsToArray21, _argsToArray22, address, utility, chain, _argsToArray22$, limit, _argsToArray22$2, offset, apiKey, chainId, resolved, url, _getUrlAndHeaders0, finalUrl, HEADERS, res, json, _args27 = arguments;
17970
+ return _regeneratorRuntime().wrap((function _callee24$(_context27) {
17971
+ while (1) switch (_context27.prev = _context27.next) {
17963
17972
  case 0:
17964
- _context26.prev = 0;
17965
- _argsToArray21 = argsToArray(_args26), _argsToArray22 = _slicedToArray(_argsToArray21, 5),
17973
+ _context27.prev = 0;
17974
+ _argsToArray21 = argsToArray(_args27), _argsToArray22 = _slicedToArray(_argsToArray21, 5),
17966
17975
  address = _argsToArray22[0], utility = _argsToArray22[1], chain = _argsToArray22[2],
17967
17976
  _argsToArray22$ = _argsToArray22[3], limit = _argsToArray22$ === void 0 ? 10 : _argsToArray22$,
17968
17977
  _argsToArray22$2 = _argsToArray22[4], offset = _argsToArray22$2 === void 0 ? 0 : _argsToArray22$2;
@@ -17976,30 +17985,17 @@ function _typeof(o) {
17976
17985
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Safe);
17977
17986
  chainId = SAFE_CHAIN_MAP[chain];
17978
17987
  if (chainId) {
17979
- _context26.next = 7;
17988
+ _context27.next = 7;
17980
17989
  break;
17981
17990
  }
17982
17991
  throw new ValidationError("Invalid chain: ".concat(chain));
17983
17992
 
17984
17993
  case 7:
17985
- resolved = address;
17986
- if (isAddress$1.isAddress(resolved)) {
17987
- _context26.next = 15;
17988
- break;
17989
- }
17990
- ens = resolved;
17991
- _context26.next = 12;
17992
- return fromEnsNameToAddress$1.fromEnsNameToAddress(ens);
17993
-
17994
- case 12:
17995
- resolved = _context26.sent;
17996
- if (resolved) {
17997
- _context26.next = 15;
17998
- break;
17999
- }
18000
- throw new EnsError(ens);
17994
+ _context27.next = 9;
17995
+ return fromEnsNameToAddress$1.validateAndGetAddress(address);
18001
17996
 
18002
- case 15:
17997
+ case 9:
17998
+ resolved = _context27.sent;
18003
17999
  url = "https://api.safe.global/tx-service/".concat(chainId, "/api/v2/safes/").concat(resolved, "/multisig-transactions?limit=").concat(limit, "&offset=").concat(offset);
18004
18000
  _getUrlAndHeaders0 = getUrlAndHeaders({
18005
18001
  url: url,
@@ -18008,47 +18004,47 @@ function _typeof(o) {
18008
18004
  Authorization: "Bearer ".concat(apiKey)
18009
18005
  }
18010
18006
  }), finalUrl = _getUrlAndHeaders0.URL, HEADERS = _getUrlAndHeaders0.HEADERS;
18011
- _context26.next = 19;
18007
+ _context27.next = 14;
18012
18008
  return fetch(finalUrl, {
18013
18009
  headers: HEADERS
18014
18010
  });
18015
18011
 
18016
- case 19:
18017
- res = _context26.sent;
18012
+ case 14:
18013
+ res = _context27.sent;
18018
18014
  if (res.ok) {
18019
- _context26.next = 22;
18015
+ _context27.next = 17;
18020
18016
  break;
18021
18017
  }
18022
18018
  throw new NetworkError(SERVICES_API_KEY.Safe, res.status);
18023
18019
 
18024
- case 22:
18025
- _context26.next = 24;
18020
+ case 17:
18021
+ _context27.next = 19;
18026
18022
  return res.json();
18027
18023
 
18028
- case 24:
18029
- json = _context26.sent;
18024
+ case 19:
18025
+ json = _context27.sent;
18030
18026
  if (Array.isArray(json.results)) {
18031
- _context26.next = 27;
18027
+ _context27.next = 22;
18032
18028
  break;
18033
18029
  }
18034
18030
  throw new ValidationError("Invalid API response");
18035
18031
 
18036
- case 27:
18037
- return _context26.abrupt("return", json.results.map((function(_ref16) {
18038
- var confirmations = _ref16.confirmations, dataDecoded = _ref16.dataDecoded, rest = _objectWithoutProperties(_ref16, _excluded);
18032
+ case 22:
18033
+ return _context27.abrupt("return", json.results.map((function(_ref17) {
18034
+ var confirmations = _ref17.confirmations, dataDecoded = _ref17.dataDecoded, rest = _objectWithoutProperties(_ref17, _excluded);
18039
18035
  return rest;
18040
18036
  })));
18041
18037
 
18042
- case 30:
18043
- _context26.prev = 30;
18044
- _context26.t0 = _context26["catch"](0);
18045
- return _context26.abrupt("return", errorMessageHandler(_context26.t0, "SAFE"));
18038
+ case 25:
18039
+ _context27.prev = 25;
18040
+ _context27.t0 = _context27["catch"](0);
18041
+ return _context27.abrupt("return", errorMessageHandler(_context27.t0, "SAFE"));
18046
18042
 
18047
- case 33:
18043
+ case 28:
18048
18044
  case "end":
18049
- return _context26.stop();
18045
+ return _context27.stop();
18050
18046
  }
18051
- }), _callee23, null, [ [ 0, 30 ] ]);
18047
+ }), _callee24, null, [ [ 0, 25 ] ]);
18052
18048
  })));
18053
18049
  return _SAFE.apply(this, arguments);
18054
18050
  }
@@ -18056,13 +18052,13 @@ function _typeof(o) {
18056
18052
  return _DEFILLAMA.apply(this, arguments);
18057
18053
  }
18058
18054
  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) {
18055
+ _DEFILLAMA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee25() {
18056
+ var _argsToArray23, _argsToArray24, category, apiKey, url, res, json, _args28 = arguments;
18057
+ return _regeneratorRuntime().wrap((function _callee25$(_context28) {
18058
+ while (1) switch (_context28.prev = _context28.next) {
18063
18059
  case 0:
18064
- _context27.prev = 0;
18065
- _argsToArray23 = argsToArray(_args27), _argsToArray24 = _slicedToArray(_argsToArray23, 1),
18060
+ _context28.prev = 0;
18061
+ _argsToArray23 = argsToArray(_args28), _argsToArray24 = _slicedToArray(_argsToArray23, 1),
18066
18062
  category = _argsToArray24[0];
18067
18063
  validateParams(defillamaParamsSchema, {
18068
18064
  category: category
@@ -18070,47 +18066,47 @@ function _typeof(o) {
18070
18066
  apiKey = window.localStorage.getItem(SERVICES_API_KEY.Defillama);
18071
18067
  url = CATEGORY_URLS[category];
18072
18068
  if (url) {
18073
- _context27.next = 7;
18069
+ _context28.next = 7;
18074
18070
  break;
18075
18071
  }
18076
18072
  throw new ValidationError("Invalid category: ".concat(category));
18077
18073
 
18078
18074
  case 7:
18079
- _context27.next = 9;
18075
+ _context28.next = 9;
18080
18076
  return fetch(url);
18081
18077
 
18082
18078
  case 9:
18083
- res = _context27.sent;
18079
+ res = _context28.sent;
18084
18080
  if (res.ok) {
18085
- _context27.next = 12;
18081
+ _context28.next = 12;
18086
18082
  break;
18087
18083
  }
18088
18084
  throw new NetworkError(SERVICES_API_KEY.Defillama, res.status);
18089
18085
 
18090
18086
  case 12:
18091
- _context27.next = 14;
18087
+ _context28.next = 14;
18092
18088
  return res.json();
18093
18089
 
18094
18090
  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;
18091
+ json = _context28.sent;
18092
+ _context28.t0 = category;
18093
+ _context28.next = _context28.t0 === "protocols" ? 18 : _context28.t0 === "yields" ? 20 : _context28.t0 === "dex" ? 22 : _context28.t0 === "fees" ? 22 : 24;
18098
18094
  break;
18099
18095
 
18100
18096
  case 18:
18101
18097
  json = Array.isArray(json) ? json.slice(0, 500) : [];
18102
- return _context27.abrupt("break", 24);
18098
+ return _context28.abrupt("break", 24);
18103
18099
 
18104
18100
  case 20:
18105
18101
  json = Array.isArray(json.data) ? json.data.slice(0, 500) : [];
18106
- return _context27.abrupt("break", 24);
18102
+ return _context28.abrupt("break", 24);
18107
18103
 
18108
18104
  case 22:
18109
18105
  json = Array.isArray(json.protocols) ? json.protocols.slice(0, 500) : [];
18110
- return _context27.abrupt("break", 24);
18106
+ return _context28.abrupt("break", 24);
18111
18107
 
18112
18108
  case 24:
18113
- return _context27.abrupt("return", (Array.isArray(json) ? json : [ json ]).map((function(item) {
18109
+ return _context28.abrupt("return", (Array.isArray(json) ? json : [ json ]).map((function(item) {
18114
18110
  var out = {};
18115
18111
  for (var _i17 = 0, _Object$entries7 = Object.entries(item); _i17 < _Object$entries7.length; _i17++) {
18116
18112
  var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i17], 2), k = _Object$entries7$_i[0], v = _Object$entries7$_i[1];
@@ -18120,15 +18116,15 @@ function _typeof(o) {
18120
18116
  })));
18121
18117
 
18122
18118
  case 27:
18123
- _context27.prev = 27;
18124
- _context27.t1 = _context27["catch"](0);
18125
- return _context27.abrupt("return", errorMessageHandler(_context27.t1, "DEFILLAMA"));
18119
+ _context28.prev = 27;
18120
+ _context28.t1 = _context28["catch"](0);
18121
+ return _context28.abrupt("return", errorMessageHandler(_context28.t1, "DEFILLAMA"));
18126
18122
 
18127
18123
  case 30:
18128
18124
  case "end":
18129
- return _context27.stop();
18125
+ return _context28.stop();
18130
18126
  }
18131
- }), _callee24, null, [ [ 0, 27 ] ]);
18127
+ }), _callee25, null, [ [ 0, 27 ] ]);
18132
18128
  })));
18133
18129
  return _DEFILLAMA.apply(this, arguments);
18134
18130
  }
@@ -18136,13 +18132,13 @@ function _typeof(o) {
18136
18132
  return _UNISWAP.apply(this, arguments);
18137
18133
  }
18138
18134
  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) {
18135
+ _UNISWAP = _asyncToGenerator(_regeneratorRuntime().mark((function _callee26() {
18136
+ var _argsToArray25, _argsToArray26, graphType, category, param1, param2, baseUrl, url, res, json, _args29 = arguments;
18137
+ return _regeneratorRuntime().wrap((function _callee26$(_context29) {
18138
+ while (1) switch (_context29.prev = _context29.next) {
18143
18139
  case 0:
18144
- _context28.prev = 0;
18145
- _argsToArray25 = argsToArray(_args28), _argsToArray26 = _slicedToArray(_argsToArray25, 4),
18140
+ _context29.prev = 0;
18141
+ _argsToArray25 = argsToArray(_args29), _argsToArray26 = _slicedToArray(_argsToArray25, 4),
18146
18142
  graphType = _argsToArray26[0], category = _argsToArray26[1], param1 = _argsToArray26[2],
18147
18143
  param2 = _argsToArray26[3];
18148
18144
  validateParams(uniswapParamsSchema, {
@@ -18153,49 +18149,49 @@ function _typeof(o) {
18153
18149
  });
18154
18150
  baseUrl = "https://onchain-proxy.fileverse.io/third-party";
18155
18151
  url = "".concat(baseUrl) + "?service=uniswap" + "&graphType=".concat(graphType) + "&category=".concat(category) + "&input1=".concat(encodeURIComponent(param1)) + (param2 ? "&input2=".concat(encodeURIComponent(param2)) : "");
18156
- _context28.next = 7;
18152
+ _context29.next = 7;
18157
18153
  return fetch(url);
18158
18154
 
18159
18155
  case 7:
18160
- res = _context28.sent;
18156
+ res = _context29.sent;
18161
18157
  if (res.ok) {
18162
- _context28.next = 10;
18158
+ _context29.next = 10;
18163
18159
  break;
18164
18160
  }
18165
18161
  throw new NetworkError("UNISWAP", res.status);
18166
18162
 
18167
18163
  case 10:
18168
- _context28.next = 12;
18164
+ _context29.next = 12;
18169
18165
  return res.json();
18170
18166
 
18171
18167
  case 12:
18172
- json = _context28.sent;
18168
+ json = _context29.sent;
18173
18169
  if (!Array.isArray(json)) {
18174
- _context28.next = 15;
18170
+ _context29.next = 15;
18175
18171
  break;
18176
18172
  }
18177
- return _context28.abrupt("return", json.map((function(item) {
18173
+ return _context29.abrupt("return", json.map((function(item) {
18178
18174
  var flat = {};
18179
- Object.entries(item).forEach((function(_ref17) {
18180
- var _ref18 = _slicedToArray(_ref17, 2), k = _ref18[0], v = _ref18[1];
18175
+ Object.entries(item).forEach((function(_ref18) {
18176
+ var _ref19 = _slicedToArray(_ref18, 2), k = _ref19[0], v = _ref19[1];
18181
18177
  if (v === null || _typeof(v) !== "object") flat[k] = v;
18182
18178
  }));
18183
18179
  return flat;
18184
18180
  })));
18185
18181
 
18186
18182
  case 15:
18187
- return _context28.abrupt("return", json);
18183
+ return _context29.abrupt("return", json);
18188
18184
 
18189
18185
  case 18:
18190
- _context28.prev = 18;
18191
- _context28.t0 = _context28["catch"](0);
18192
- return _context28.abrupt("return", errorMessageHandler(_context28.t0, "UNISWAP"));
18186
+ _context29.prev = 18;
18187
+ _context29.t0 = _context29["catch"](0);
18188
+ return _context29.abrupt("return", errorMessageHandler(_context29.t0, "UNISWAP"));
18193
18189
 
18194
18190
  case 21:
18195
18191
  case "end":
18196
- return _context28.stop();
18192
+ return _context29.stop();
18197
18193
  }
18198
- }), _callee25, null, [ [ 0, 18 ] ]);
18194
+ }), _callee26, null, [ [ 0, 18 ] ]);
18199
18195
  })));
18200
18196
  return _UNISWAP.apply(this, arguments);
18201
18197
  }
@@ -18203,13 +18199,13 @@ function _typeof(o) {
18203
18199
  return _AAVE.apply(this, arguments);
18204
18200
  }
18205
18201
  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) {
18202
+ _AAVE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee27() {
18203
+ var _argsToArray27, _argsToArray28, graphType, category, param1, param2, baseUrl, url, res, json, _args30 = arguments;
18204
+ return _regeneratorRuntime().wrap((function _callee27$(_context30) {
18205
+ while (1) switch (_context30.prev = _context30.next) {
18210
18206
  case 0:
18211
- _context29.prev = 0;
18212
- _argsToArray27 = argsToArray(_args29), _argsToArray28 = _slicedToArray(_argsToArray27, 4),
18207
+ _context30.prev = 0;
18208
+ _argsToArray27 = argsToArray(_args30), _argsToArray28 = _slicedToArray(_argsToArray27, 4),
18213
18209
  graphType = _argsToArray28[0], category = _argsToArray28[1], param1 = _argsToArray28[2],
18214
18210
  param2 = _argsToArray28[3];
18215
18211
  validateParams(aaveParamsSchema, {
@@ -18220,49 +18216,49 @@ function _typeof(o) {
18220
18216
  });
18221
18217
  baseUrl = "https://onchain-proxy.fileverse.io/third-party";
18222
18218
  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;
18219
+ _context30.next = 7;
18224
18220
  return fetch(url);
18225
18221
 
18226
18222
  case 7:
18227
- res = _context29.sent;
18223
+ res = _context30.sent;
18228
18224
  if (res.ok) {
18229
- _context29.next = 10;
18225
+ _context30.next = 10;
18230
18226
  break;
18231
18227
  }
18232
18228
  throw new NetworkError("AAVE", res.status);
18233
18229
 
18234
18230
  case 10:
18235
- _context29.next = 12;
18231
+ _context30.next = 12;
18236
18232
  return res.json();
18237
18233
 
18238
18234
  case 12:
18239
- json = _context29.sent;
18235
+ json = _context30.sent;
18240
18236
  if (!Array.isArray(json)) {
18241
- _context29.next = 15;
18237
+ _context30.next = 15;
18242
18238
  break;
18243
18239
  }
18244
- return _context29.abrupt("return", json.map((function(item) {
18240
+ return _context30.abrupt("return", json.map((function(item) {
18245
18241
  var flat = {};
18246
- Object.entries(item).forEach((function(_ref19) {
18247
- var _ref20 = _slicedToArray(_ref19, 2), k = _ref20[0], v = _ref20[1];
18242
+ Object.entries(item).forEach((function(_ref20) {
18243
+ var _ref21 = _slicedToArray(_ref20, 2), k = _ref21[0], v = _ref21[1];
18248
18244
  if (v === null || _typeof(v) !== "object") flat[k] = v;
18249
18245
  }));
18250
18246
  return flat;
18251
18247
  })));
18252
18248
 
18253
18249
  case 15:
18254
- return _context29.abrupt("return", json);
18250
+ return _context30.abrupt("return", json);
18255
18251
 
18256
18252
  case 18:
18257
- _context29.prev = 18;
18258
- _context29.t0 = _context29["catch"](0);
18259
- return _context29.abrupt("return", errorMessageHandler(_context29.t0, "AAVE"));
18253
+ _context30.prev = 18;
18254
+ _context30.t0 = _context30["catch"](0);
18255
+ return _context30.abrupt("return", errorMessageHandler(_context30.t0, "AAVE"));
18260
18256
 
18261
18257
  case 21:
18262
18258
  case "end":
18263
- return _context29.stop();
18259
+ return _context30.stop();
18264
18260
  }
18265
- }), _callee26, null, [ [ 0, 18 ] ]);
18261
+ }), _callee27, null, [ [ 0, 18 ] ]);
18266
18262
  })));
18267
18263
  return _AAVE.apply(this, arguments);
18268
18264
  }