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