@fileverse-dev/formulajs 4.4.11-mod-70 → 4.4.11-mod-68-patch-3
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 +388 -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-3 */
|
|
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,34 @@ 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({
|
|
11163
|
+
url: url,
|
|
11164
|
+
serviceName: "Etherscan",
|
|
11165
|
+
headers: {}
|
|
11166
|
+
}), finalUrl = _getUrlAndHeaders.URL, HEADERS = _getUrlAndHeaders.HEADERS;
|
|
11167
|
+
_context.next = 7;
|
|
11168
|
+
return fetch(finalUrl, {
|
|
11169
|
+
method: "GET",
|
|
11170
|
+
headers: HEADERS
|
|
11171
|
+
});
|
|
11088
11172
|
|
|
11089
|
-
case
|
|
11173
|
+
case 7:
|
|
11090
11174
|
res = _context.sent;
|
|
11091
|
-
_context.next =
|
|
11175
|
+
_context.next = 10;
|
|
11092
11176
|
return res.json();
|
|
11093
11177
|
|
|
11094
|
-
case
|
|
11178
|
+
case 10:
|
|
11095
11179
|
json = _context.sent;
|
|
11096
11180
|
return _context.abrupt("return", parseInt(json.result));
|
|
11097
11181
|
|
|
11098
|
-
case
|
|
11182
|
+
case 12:
|
|
11099
11183
|
case "end":
|
|
11100
11184
|
return _context.stop();
|
|
11101
11185
|
}
|
|
11102
11186
|
}), _callee);
|
|
11103
11187
|
})));
|
|
11104
11188
|
return function fromTimeStampToBlock(_x2, _x3, _x4) {
|
|
11105
|
-
return
|
|
11189
|
+
return _ref2.apply(this, arguments);
|
|
11106
11190
|
};
|
|
11107
11191
|
}();
|
|
11108
11192
|
var fromTimestampToBlock = {
|
|
@@ -11239,15 +11323,15 @@ function _typeof(o) {
|
|
|
11239
11323
|
return _handleScanRequest.apply(this, arguments);
|
|
11240
11324
|
}
|
|
11241
11325
|
function _handleScanRequest() {
|
|
11242
|
-
_handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(
|
|
11243
|
-
var type, address, startDate, endDate,
|
|
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, url, _yield$Promise$all, _yield$Promise$all2, startBlock, endBlock, _getUrlAndHeaders3, finalUrl, HEADERS, res, json;
|
|
11244
11328
|
return _regeneratorRuntime().wrap((function _callee10$(_context10) {
|
|
11245
11329
|
while (1) switch (_context10.prev = _context10.next) {
|
|
11246
11330
|
case 0:
|
|
11247
|
-
type =
|
|
11248
|
-
|
|
11249
|
-
offset =
|
|
11250
|
-
chainId =
|
|
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;
|
|
11251
11335
|
API_INFO_MAP = {
|
|
11252
11336
|
BASE: {
|
|
11253
11337
|
url: "https://api.basescan.org/api",
|
|
@@ -11292,7 +11376,7 @@ function _typeof(o) {
|
|
|
11292
11376
|
"all-txns": "txlist",
|
|
11293
11377
|
"token-txns": "tokentx",
|
|
11294
11378
|
"nft-txns": "tokennfttx",
|
|
11295
|
-
gas: "
|
|
11379
|
+
gas: "gastracker"
|
|
11296
11380
|
};
|
|
11297
11381
|
action = ACTION_MAP[type];
|
|
11298
11382
|
if (action) {
|
|
@@ -11302,33 +11386,40 @@ function _typeof(o) {
|
|
|
11302
11386
|
throw new ValidationError("Invalid type: ".concat(type));
|
|
11303
11387
|
|
|
11304
11388
|
case 17:
|
|
11305
|
-
|
|
11306
|
-
url = "".concat(baseUrl, "?chainid=").concat(chainId, "&module=").concat(module, "&action=").concat(action, "&apikey=").concat(apiKey);
|
|
11389
|
+
url = "".concat(baseUrl, "?chainid=").concat(chainId, "&module=account&action=").concat(action, "&apikey=").concat(apiKey);
|
|
11307
11390
|
if (![ "all-txns", "token-txns", "nft-txns" ].includes(type)) {
|
|
11308
|
-
_context10.next =
|
|
11391
|
+
_context10.next = 29;
|
|
11309
11392
|
break;
|
|
11310
11393
|
}
|
|
11311
11394
|
url += "&address=".concat(address, "&startblock=0&endblock=99999999&sort=asc");
|
|
11312
11395
|
if (!(!isNaN(startDate) && !isNaN(endDate))) {
|
|
11313
|
-
_context10.next =
|
|
11396
|
+
_context10.next = 28;
|
|
11314
11397
|
break;
|
|
11315
11398
|
}
|
|
11316
|
-
_context10.next =
|
|
11399
|
+
_context10.next = 23;
|
|
11317
11400
|
return Promise.all([ fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startDate), network, apiKey), fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endDate), network, apiKey) ]);
|
|
11318
11401
|
|
|
11319
|
-
case
|
|
11402
|
+
case 23:
|
|
11320
11403
|
_yield$Promise$all = _context10.sent;
|
|
11321
11404
|
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
11322
11405
|
startBlock = _yield$Promise$all2[0];
|
|
11323
11406
|
endBlock = _yield$Promise$all2[1];
|
|
11324
11407
|
url += "&startblock=".concat(startBlock || "0", "&endblock=").concat(endBlock || "99999999");
|
|
11325
11408
|
|
|
11326
|
-
case
|
|
11409
|
+
case 28:
|
|
11327
11410
|
url += "&page=".concat(page, "&offset=").concat(offset);
|
|
11328
11411
|
|
|
11329
|
-
case
|
|
11412
|
+
case 29:
|
|
11413
|
+
_getUrlAndHeaders3 = getUrlAndHeaders({
|
|
11414
|
+
url: url,
|
|
11415
|
+
serviceName: "Etherscan",
|
|
11416
|
+
headers: {}
|
|
11417
|
+
}), finalUrl = _getUrlAndHeaders3.URL, HEADERS = _getUrlAndHeaders3.HEADERS;
|
|
11330
11418
|
_context10.next = 32;
|
|
11331
|
-
return fetch(
|
|
11419
|
+
return fetch(finalUrl, {
|
|
11420
|
+
method: "GET",
|
|
11421
|
+
headers: HEADERS
|
|
11422
|
+
});
|
|
11332
11423
|
|
|
11333
11424
|
case 32:
|
|
11334
11425
|
res = _context10.sent;
|
|
@@ -11362,7 +11453,7 @@ function _typeof(o) {
|
|
|
11362
11453
|
throw new RateLimitError(apiInfo.apiKeyName);
|
|
11363
11454
|
|
|
11364
11455
|
case 43:
|
|
11365
|
-
return _context10.abrupt("return",
|
|
11456
|
+
return _context10.abrupt("return", json.result);
|
|
11366
11457
|
|
|
11367
11458
|
case 44:
|
|
11368
11459
|
case "end":
|
|
@@ -11373,8 +11464,8 @@ function _typeof(o) {
|
|
|
11373
11464
|
return _handleScanRequest.apply(this, arguments);
|
|
11374
11465
|
}
|
|
11375
11466
|
var fromUsernameToFid = function() {
|
|
11376
|
-
var
|
|
11377
|
-
var url, res, json, users, user;
|
|
11467
|
+
var _ref4 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(username, apiKey) {
|
|
11468
|
+
var url, _getUrlAndHeaders2, finalUrl, HEADERS, res, json, users, user;
|
|
11378
11469
|
return _regeneratorRuntime().wrap((function _callee2$(_context2) {
|
|
11379
11470
|
while (1) switch (_context2.prev = _context2.next) {
|
|
11380
11471
|
case 0:
|
|
@@ -11386,20 +11477,26 @@ function _typeof(o) {
|
|
|
11386
11477
|
|
|
11387
11478
|
case 2:
|
|
11388
11479
|
url = "https://api.neynar.com/v2/farcaster/user/search/?q=".concat(username, "&limit=5");
|
|
11389
|
-
|
|
11390
|
-
|
|
11480
|
+
_getUrlAndHeaders2 = getUrlAndHeaders({
|
|
11481
|
+
url: url,
|
|
11482
|
+
serviceName: "Neynar",
|
|
11391
11483
|
headers: {
|
|
11392
11484
|
"x-api-key": apiKey,
|
|
11393
11485
|
"x-neynar-experimental": "false"
|
|
11394
11486
|
}
|
|
11487
|
+
}), finalUrl = _getUrlAndHeaders2.URL, HEADERS = _getUrlAndHeaders2.HEADERS;
|
|
11488
|
+
_context2.next = 6;
|
|
11489
|
+
return fetch(finalUrl, {
|
|
11490
|
+
method: "GET",
|
|
11491
|
+
headers: HEADERS
|
|
11395
11492
|
});
|
|
11396
11493
|
|
|
11397
|
-
case
|
|
11494
|
+
case 6:
|
|
11398
11495
|
res = _context2.sent;
|
|
11399
|
-
_context2.next =
|
|
11496
|
+
_context2.next = 9;
|
|
11400
11497
|
return res.json();
|
|
11401
11498
|
|
|
11402
|
-
case
|
|
11499
|
+
case 9:
|
|
11403
11500
|
json = _context2.sent;
|
|
11404
11501
|
users = json.result ? json.result.users : [];
|
|
11405
11502
|
user = users.find((function(user) {
|
|
@@ -11407,14 +11504,14 @@ function _typeof(o) {
|
|
|
11407
11504
|
}));
|
|
11408
11505
|
return _context2.abrupt("return", user && user.fid || null);
|
|
11409
11506
|
|
|
11410
|
-
case
|
|
11507
|
+
case 13:
|
|
11411
11508
|
case "end":
|
|
11412
11509
|
return _context2.stop();
|
|
11413
11510
|
}
|
|
11414
11511
|
}), _callee2);
|
|
11415
11512
|
})));
|
|
11416
11513
|
return function fromUsernameToFid(_x7, _x8) {
|
|
11417
|
-
return
|
|
11514
|
+
return _ref4.apply(this, arguments);
|
|
11418
11515
|
};
|
|
11419
11516
|
}();
|
|
11420
11517
|
var fromUsernameToFid$1 = {
|
|
@@ -12161,7 +12258,7 @@ function _typeof(o) {
|
|
|
12161
12258
|
description: description
|
|
12162
12259
|
};
|
|
12163
12260
|
var customMap = function customMap(iss, ctx) {
|
|
12164
|
-
var
|
|
12261
|
+
var _ref6;
|
|
12165
12262
|
var message = params.message;
|
|
12166
12263
|
if (iss.code === "invalid_enum_value") {
|
|
12167
12264
|
return {
|
|
@@ -12169,16 +12266,16 @@ function _typeof(o) {
|
|
|
12169
12266
|
};
|
|
12170
12267
|
}
|
|
12171
12268
|
if (typeof ctx.data === "undefined") {
|
|
12172
|
-
var
|
|
12269
|
+
var _ref5;
|
|
12173
12270
|
return {
|
|
12174
|
-
message: (
|
|
12271
|
+
message: (_ref5 = message !== null && message !== void 0 ? message : required_error) !== null && _ref5 !== void 0 ? _ref5 : ctx.defaultError
|
|
12175
12272
|
};
|
|
12176
12273
|
}
|
|
12177
12274
|
if (iss.code !== "invalid_type") return {
|
|
12178
12275
|
message: ctx.defaultError
|
|
12179
12276
|
};
|
|
12180
12277
|
return {
|
|
12181
|
-
message: (
|
|
12278
|
+
message: (_ref6 = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _ref6 !== void 0 ? _ref6 : ctx.defaultError
|
|
12182
12279
|
};
|
|
12183
12280
|
};
|
|
12184
12281
|
return {
|
|
@@ -14918,7 +15015,7 @@ function _typeof(o) {
|
|
|
14918
15015
|
}
|
|
14919
15016
|
if (ctx.common.async) {
|
|
14920
15017
|
return Promise.all(options.map(function() {
|
|
14921
|
-
var
|
|
15018
|
+
var _ref8 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7(option) {
|
|
14922
15019
|
var childCtx;
|
|
14923
15020
|
return _regeneratorRuntime().wrap((function _callee7$(_context7) {
|
|
14924
15021
|
while (1) switch (_context7.prev = _context7.next) {
|
|
@@ -14951,7 +15048,7 @@ function _typeof(o) {
|
|
|
14951
15048
|
}), _callee7);
|
|
14952
15049
|
})));
|
|
14953
15050
|
return function(_x13) {
|
|
14954
|
-
return
|
|
15051
|
+
return _ref8.apply(this, arguments);
|
|
14955
15052
|
};
|
|
14956
15053
|
}())).then(handleResults);
|
|
14957
15054
|
} else {
|
|
@@ -15253,8 +15350,8 @@ function _typeof(o) {
|
|
|
15253
15350
|
data: ctx.data,
|
|
15254
15351
|
path: ctx.path,
|
|
15255
15352
|
parent: ctx
|
|
15256
|
-
}) ]).then((function(
|
|
15257
|
-
var
|
|
15353
|
+
}) ]).then((function(_ref9) {
|
|
15354
|
+
var _ref0 = _slicedToArray(_ref9, 2), left = _ref0[0], right = _ref0[1];
|
|
15258
15355
|
return handleParsed(left, right);
|
|
15259
15356
|
}));
|
|
15260
15357
|
} else {
|
|
@@ -15387,8 +15484,8 @@ function _typeof(o) {
|
|
|
15387
15484
|
}
|
|
15388
15485
|
var keyType = this._def.keyType;
|
|
15389
15486
|
var valueType = this._def.valueType;
|
|
15390
|
-
var pairs = _toConsumableArray(ctx.data.entries()).map((function(
|
|
15391
|
-
var
|
|
15487
|
+
var pairs = _toConsumableArray(ctx.data.entries()).map((function(_ref1, index) {
|
|
15488
|
+
var _ref10 = _slicedToArray(_ref1, 2), key = _ref10[0], value = _ref10[1];
|
|
15392
15489
|
return {
|
|
15393
15490
|
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [ index, "key" ])),
|
|
15394
15491
|
value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [ index, "value" ]))
|
|
@@ -15922,7 +16019,7 @@ function _typeof(o) {
|
|
|
15922
16019
|
var processed = effect.transform(ctx.data, checkCtx);
|
|
15923
16020
|
if (ctx.common.async) {
|
|
15924
16021
|
return Promise.resolve(processed).then(function() {
|
|
15925
|
-
var
|
|
16022
|
+
var _ref12 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9(processed) {
|
|
15926
16023
|
var result;
|
|
15927
16024
|
return _regeneratorRuntime().wrap((function _callee9$(_context9) {
|
|
15928
16025
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -15973,7 +16070,7 @@ function _typeof(o) {
|
|
|
15973
16070
|
}), _callee9);
|
|
15974
16071
|
})));
|
|
15975
16072
|
return function(_x14) {
|
|
15976
|
-
return
|
|
16073
|
+
return _ref12.apply(this, arguments);
|
|
15977
16074
|
};
|
|
15978
16075
|
}());
|
|
15979
16076
|
} else {
|
|
@@ -16304,7 +16401,7 @@ function _typeof(o) {
|
|
|
16304
16401
|
var _this$_processInputPa13 = this._processInputParams(input), status = _this$_processInputPa13.status, ctx = _this$_processInputPa13.ctx;
|
|
16305
16402
|
if (ctx.common.async) {
|
|
16306
16403
|
var handleAsync = function() {
|
|
16307
|
-
var
|
|
16404
|
+
var _ref13 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
|
|
16308
16405
|
var inResult;
|
|
16309
16406
|
return _regeneratorRuntime().wrap((function _callee0$(_context0) {
|
|
16310
16407
|
while (1) switch (_context0.prev = _context0.next) {
|
|
@@ -16346,7 +16443,7 @@ function _typeof(o) {
|
|
|
16346
16443
|
}), _callee0);
|
|
16347
16444
|
})));
|
|
16348
16445
|
return function handleAsync() {
|
|
16349
|
-
return
|
|
16446
|
+
return _ref13.apply(this, arguments);
|
|
16350
16447
|
};
|
|
16351
16448
|
}();
|
|
16352
16449
|
return handleAsync();
|
|
@@ -16476,18 +16573,14 @@ function _typeof(o) {
|
|
|
16476
16573
|
contentType: enumType([ "posts", "replies", "channels" ]),
|
|
16477
16574
|
identifier: stringType().nonempty(),
|
|
16478
16575
|
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)
|
|
16576
|
+
end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
|
|
16482
16577
|
});
|
|
16483
16578
|
var lensSchema = objectType({
|
|
16484
16579
|
platform: literalType("lens"),
|
|
16485
16580
|
contentType: enumType([ "posts", "replies" ]),
|
|
16486
16581
|
identifier: stringType().nonempty(),
|
|
16487
16582
|
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)
|
|
16583
|
+
end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
|
|
16491
16584
|
});
|
|
16492
16585
|
var fireflyParamsSchema = discriminatedUnionType("platform", [ farcasterSchema, lensSchema ]);
|
|
16493
16586
|
var fireFlyPlaformType = {
|
|
@@ -16505,33 +16598,21 @@ function _typeof(o) {
|
|
|
16505
16598
|
contentType: enumType([ "posts", "replies" ]),
|
|
16506
16599
|
identifier: stringType().nonempty(),
|
|
16507
16600
|
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)
|
|
16601
|
+
end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
|
|
16511
16602
|
});
|
|
16512
16603
|
var farcasterParamsSchema = objectType({
|
|
16513
16604
|
contentType: enumType([ "posts", "replies", "channels" ]),
|
|
16514
16605
|
identifier: stringType().nonempty(),
|
|
16515
16606
|
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)
|
|
16607
|
+
end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
|
|
16519
16608
|
});
|
|
16520
16609
|
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);
|
|
16610
|
+
var _val$split = val.split("/"), _val$split2 = _slicedToArray(_val$split, 3), mm = _val$split2[0], dd = _val$split2[1], yyyy = _val$split2[2];
|
|
16611
|
+
return Math.floor(new Date("".concat(yyyy, "-").concat(mm, "-").concat(dd)).getTime() / 1e3);
|
|
16525
16612
|
};
|
|
16526
16613
|
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
|
-
}));
|
|
16614
|
+
return typeof val === "string" && /^\d{2}\/\d{2}\/\d{4}$/.test(val) ? dateStringToTimestamp(val) : val;
|
|
16615
|
+
}), numberType()["int"]().nonnegative());
|
|
16535
16616
|
var blockscoutParamsSchema = objectType({
|
|
16536
16617
|
address: stringType().nonempty(),
|
|
16537
16618
|
type: enumType([ "stat", "txns", "tokens" ]),
|
|
@@ -16539,18 +16620,14 @@ function _typeof(o) {
|
|
|
16539
16620
|
startTimestamp: dateOrTimestamp.optional(),
|
|
16540
16621
|
endTimestamp: dateOrTimestamp.optional(),
|
|
16541
16622
|
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)
|
|
16623
|
+
offset: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
|
|
16545
16624
|
});
|
|
16546
16625
|
var gasSchema$1 = objectType({
|
|
16547
16626
|
type: literalType("gas"),
|
|
16548
16627
|
startDate: dateOrTimestamp.optional(),
|
|
16549
16628
|
endDate: dateOrTimestamp.optional(),
|
|
16550
16629
|
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)
|
|
16630
|
+
limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
|
|
16554
16631
|
});
|
|
16555
16632
|
var txnSchema$1 = objectType({
|
|
16556
16633
|
type: enumType([ "all-txns", "token-txns", "nft-txns" ]),
|
|
@@ -16558,9 +16635,7 @@ function _typeof(o) {
|
|
|
16558
16635
|
startDate: dateOrTimestamp.optional(),
|
|
16559
16636
|
endDate: dateOrTimestamp.optional(),
|
|
16560
16637
|
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)
|
|
16638
|
+
limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
|
|
16564
16639
|
});
|
|
16565
16640
|
var baseParamsSchema = discriminatedUnionType("type", [ gasSchema$1, txnSchema$1 ]);
|
|
16566
16641
|
var gasSchema = objectType({
|
|
@@ -16568,9 +16643,7 @@ function _typeof(o) {
|
|
|
16568
16643
|
startDate: dateOrTimestamp.optional(),
|
|
16569
16644
|
endDate: dateOrTimestamp.optional(),
|
|
16570
16645
|
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)
|
|
16646
|
+
limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
|
|
16574
16647
|
});
|
|
16575
16648
|
var txnSchema = objectType({
|
|
16576
16649
|
type: enumType([ "all-txns", "token-txns", "nft-txns" ]),
|
|
@@ -16579,24 +16652,9 @@ function _typeof(o) {
|
|
|
16579
16652
|
endDate: dateOrTimestamp.optional(),
|
|
16580
16653
|
chain: enumType([ "ethereum", "base", "gnosis" ]),
|
|
16581
16654
|
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)
|
|
16655
|
+
limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
|
|
16585
16656
|
});
|
|
16586
16657
|
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
16658
|
var priceSchema = objectType({
|
|
16601
16659
|
category: literalType("price"),
|
|
16602
16660
|
param1: stringType().nonempty(),
|
|
@@ -16606,13 +16664,13 @@ function _typeof(o) {
|
|
|
16606
16664
|
var marketSchema = objectType({
|
|
16607
16665
|
category: literalType("market"),
|
|
16608
16666
|
param1: enumType(marketEcosystems),
|
|
16609
|
-
param2:
|
|
16667
|
+
param2: enumType([ "1h", "24h", "7d" ]).optional()
|
|
16610
16668
|
});
|
|
16611
16669
|
var stablecoinsTypes = [ "all", "yield-bearing-stablecoins", "crypto-backed-stablecoin" ];
|
|
16612
16670
|
var stablecoinsSchema = objectType({
|
|
16613
16671
|
category: literalType("stablecoins"),
|
|
16614
16672
|
param1: enumType(stablecoinsTypes),
|
|
16615
|
-
param2:
|
|
16673
|
+
param2: enumType([ "1h", "24h", "7d" ]).optional()
|
|
16616
16674
|
});
|
|
16617
16675
|
var derivativesSchema = objectType({
|
|
16618
16676
|
category: literalType("derivatives"),
|
|
@@ -16631,9 +16689,7 @@ function _typeof(o) {
|
|
|
16631
16689
|
startTime: dateOrTimestamp.optional(),
|
|
16632
16690
|
endTime: dateOrTimestamp.optional(),
|
|
16633
16691
|
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)
|
|
16692
|
+
offset: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10)
|
|
16637
16693
|
});
|
|
16638
16694
|
var eoaParamsSchema = preprocessType((function(val) {
|
|
16639
16695
|
var obj = _objectSpread({}, val || {});
|
|
@@ -16655,9 +16711,7 @@ function _typeof(o) {
|
|
|
16655
16711
|
address: stringType().nonempty(),
|
|
16656
16712
|
utility: literalType("txns"),
|
|
16657
16713
|
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),
|
|
16714
|
+
limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT)["default"](10),
|
|
16661
16715
|
offset: numberType()["int"]().nonnegative()["default"](0)
|
|
16662
16716
|
});
|
|
16663
16717
|
var categories = [ "protocols", "yields", "dex", "fees" ];
|
|
@@ -16687,7 +16741,7 @@ function _typeof(o) {
|
|
|
16687
16741
|
}
|
|
16688
16742
|
function _FIREFLY() {
|
|
16689
16743
|
_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;
|
|
16744
|
+
var _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, apiKey, url, _getUrlAndHeaders4, finalUrl, HEADERS, response, _yield$response$json, _data, _args11 = arguments;
|
|
16691
16745
|
return _regeneratorRuntime().wrap((function _callee11$(_context11) {
|
|
16692
16746
|
while (1) switch (_context11.prev = _context11.next) {
|
|
16693
16747
|
case 0:
|
|
@@ -16718,35 +16772,39 @@ function _typeof(o) {
|
|
|
16718
16772
|
url.searchParams.set("type", fireFlyPlaformType[platform][contentType]);
|
|
16719
16773
|
url.searchParams.set("start", String(start));
|
|
16720
16774
|
url.searchParams.set("end", String(end));
|
|
16721
|
-
|
|
16722
|
-
|
|
16723
|
-
|
|
16724
|
-
|
|
16725
|
-
|
|
16775
|
+
_getUrlAndHeaders4 = getUrlAndHeaders({
|
|
16776
|
+
url: url.toString(),
|
|
16777
|
+
serviceName: "Firefly",
|
|
16778
|
+
headers: headers
|
|
16779
|
+
}), finalUrl = _getUrlAndHeaders4.URL, HEADERS = _getUrlAndHeaders4.HEADERS;
|
|
16780
|
+
_context11.next = 14;
|
|
16781
|
+
return fetch(finalUrl, {
|
|
16782
|
+
method: "GET",
|
|
16783
|
+
headers: HEADERS
|
|
16726
16784
|
});
|
|
16727
16785
|
|
|
16728
|
-
case
|
|
16786
|
+
case 14:
|
|
16729
16787
|
response = _context11.sent;
|
|
16730
16788
|
if (response.ok) {
|
|
16731
|
-
_context11.next =
|
|
16789
|
+
_context11.next = 17;
|
|
16732
16790
|
break;
|
|
16733
16791
|
}
|
|
16734
16792
|
throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
|
|
16735
16793
|
|
|
16736
|
-
case
|
|
16737
|
-
_context11.next =
|
|
16794
|
+
case 17:
|
|
16795
|
+
_context11.next = 19;
|
|
16738
16796
|
return response.json();
|
|
16739
16797
|
|
|
16740
|
-
case
|
|
16798
|
+
case 19:
|
|
16741
16799
|
_yield$response$json = _context11.sent;
|
|
16742
16800
|
_data = _yield$response$json.data;
|
|
16743
16801
|
if (Array.isArray(_data)) {
|
|
16744
|
-
_context11.next =
|
|
16802
|
+
_context11.next = 23;
|
|
16745
16803
|
break;
|
|
16746
16804
|
}
|
|
16747
16805
|
return _context11.abrupt("return", []);
|
|
16748
16806
|
|
|
16749
|
-
case
|
|
16807
|
+
case 23:
|
|
16750
16808
|
return _context11.abrupt("return", _data.map((function(item) {
|
|
16751
16809
|
var flat = {};
|
|
16752
16810
|
for (var _i10 = 0, _Object$entries = Object.entries(item); _i10 < _Object$entries.length; _i10++) {
|
|
@@ -16759,16 +16817,16 @@ function _typeof(o) {
|
|
|
16759
16817
|
return flat;
|
|
16760
16818
|
})));
|
|
16761
16819
|
|
|
16762
|
-
case
|
|
16763
|
-
_context11.prev =
|
|
16820
|
+
case 26:
|
|
16821
|
+
_context11.prev = 26;
|
|
16764
16822
|
_context11.t0 = _context11["catch"](0);
|
|
16765
16823
|
return _context11.abrupt("return", errorMessageHandler(_context11.t0, "FIREFLY"));
|
|
16766
16824
|
|
|
16767
|
-
case
|
|
16825
|
+
case 29:
|
|
16768
16826
|
case "end":
|
|
16769
16827
|
return _context11.stop();
|
|
16770
16828
|
}
|
|
16771
|
-
}), _callee11, null, [ [ 0,
|
|
16829
|
+
}), _callee11, null, [ [ 0, 26 ] ]);
|
|
16772
16830
|
})));
|
|
16773
16831
|
return _FIREFLY.apply(this, arguments);
|
|
16774
16832
|
}
|
|
@@ -16777,7 +16835,7 @@ function _typeof(o) {
|
|
|
16777
16835
|
}
|
|
16778
16836
|
function _LENS() {
|
|
16779
16837
|
_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;
|
|
16838
|
+
var _argsToArray5, _argsToArray6, contentType, identifier, _argsToArray6$, start, _argsToArray6$2, end, apiKey, url, typeMap, _getUrlAndHeaders5, finalUrl, HEADERS, response, _yield$response$json2, _data2, _args12 = arguments;
|
|
16781
16839
|
return _regeneratorRuntime().wrap((function _callee12$(_context12) {
|
|
16782
16840
|
while (1) switch (_context12.prev = _context12.next) {
|
|
16783
16841
|
case 0:
|
|
@@ -16811,35 +16869,39 @@ function _typeof(o) {
|
|
|
16811
16869
|
url.searchParams.set("type", typeMap[contentType]);
|
|
16812
16870
|
url.searchParams.set("start", String(start));
|
|
16813
16871
|
url.searchParams.set("end", String(end));
|
|
16814
|
-
|
|
16815
|
-
|
|
16816
|
-
|
|
16817
|
-
|
|
16818
|
-
|
|
16872
|
+
_getUrlAndHeaders5 = getUrlAndHeaders({
|
|
16873
|
+
url: url.toString(),
|
|
16874
|
+
serviceName: "Firefly",
|
|
16875
|
+
headers: headers
|
|
16876
|
+
}), finalUrl = _getUrlAndHeaders5.URL, HEADERS = _getUrlAndHeaders5.HEADERS;
|
|
16877
|
+
_context12.next = 15;
|
|
16878
|
+
return fetch(finalUrl, {
|
|
16879
|
+
method: "GET",
|
|
16880
|
+
headers: HEADERS
|
|
16819
16881
|
});
|
|
16820
16882
|
|
|
16821
|
-
case
|
|
16883
|
+
case 15:
|
|
16822
16884
|
response = _context12.sent;
|
|
16823
16885
|
if (response.ok) {
|
|
16824
|
-
_context12.next =
|
|
16886
|
+
_context12.next = 18;
|
|
16825
16887
|
break;
|
|
16826
16888
|
}
|
|
16827
16889
|
throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
|
|
16828
16890
|
|
|
16829
|
-
case
|
|
16830
|
-
_context12.next =
|
|
16891
|
+
case 18:
|
|
16892
|
+
_context12.next = 20;
|
|
16831
16893
|
return response.json();
|
|
16832
16894
|
|
|
16833
|
-
case
|
|
16895
|
+
case 20:
|
|
16834
16896
|
_yield$response$json2 = _context12.sent;
|
|
16835
16897
|
_data2 = _yield$response$json2.data;
|
|
16836
16898
|
if (Array.isArray(_data2)) {
|
|
16837
|
-
_context12.next =
|
|
16899
|
+
_context12.next = 24;
|
|
16838
16900
|
break;
|
|
16839
16901
|
}
|
|
16840
16902
|
return _context12.abrupt("return", []);
|
|
16841
16903
|
|
|
16842
|
-
case
|
|
16904
|
+
case 24:
|
|
16843
16905
|
return _context12.abrupt("return", _data2.map((function(item) {
|
|
16844
16906
|
var flat = {};
|
|
16845
16907
|
for (var _i11 = 0, _Object$entries2 = Object.entries(item); _i11 < _Object$entries2.length; _i11++) {
|
|
@@ -16852,16 +16914,16 @@ function _typeof(o) {
|
|
|
16852
16914
|
return flat;
|
|
16853
16915
|
})));
|
|
16854
16916
|
|
|
16855
|
-
case
|
|
16856
|
-
_context12.prev =
|
|
16917
|
+
case 27:
|
|
16918
|
+
_context12.prev = 27;
|
|
16857
16919
|
_context12.t0 = _context12["catch"](0);
|
|
16858
16920
|
return _context12.abrupt("return", errorMessageHandler(_context12.t0, "LENS"));
|
|
16859
16921
|
|
|
16860
|
-
case
|
|
16922
|
+
case 30:
|
|
16861
16923
|
case "end":
|
|
16862
16924
|
return _context12.stop();
|
|
16863
16925
|
}
|
|
16864
|
-
}), _callee12, null, [ [ 0,
|
|
16926
|
+
}), _callee12, null, [ [ 0, 27 ] ]);
|
|
16865
16927
|
})));
|
|
16866
16928
|
return _LENS.apply(this, arguments);
|
|
16867
16929
|
}
|
|
@@ -16870,7 +16932,7 @@ function _typeof(o) {
|
|
|
16870
16932
|
}
|
|
16871
16933
|
function _FARCASTER() {
|
|
16872
16934
|
_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;
|
|
16935
|
+
var _argsToArray7, _argsToArray8, contentType, identifier, _argsToArray8$, start, _argsToArray8$2, end, apiKey, url, typeMap, _getUrlAndHeaders6, finalUrl, HEADERS, response, _yield$response$json3, _data3, _args13 = arguments;
|
|
16874
16936
|
return _regeneratorRuntime().wrap((function _callee13$(_context13) {
|
|
16875
16937
|
while (1) switch (_context13.prev = _context13.next) {
|
|
16876
16938
|
case 0:
|
|
@@ -16905,35 +16967,39 @@ function _typeof(o) {
|
|
|
16905
16967
|
url.searchParams.set("type", typeMap[contentType]);
|
|
16906
16968
|
url.searchParams.set("start", String(start));
|
|
16907
16969
|
url.searchParams.set("end", String(end));
|
|
16908
|
-
|
|
16909
|
-
|
|
16910
|
-
|
|
16911
|
-
|
|
16912
|
-
|
|
16970
|
+
_getUrlAndHeaders6 = getUrlAndHeaders({
|
|
16971
|
+
url: url.toString(),
|
|
16972
|
+
serviceName: "Firefly",
|
|
16973
|
+
headers: headers
|
|
16974
|
+
}), finalUrl = _getUrlAndHeaders6.URL, HEADERS = _getUrlAndHeaders6.HEADERS;
|
|
16975
|
+
_context13.next = 15;
|
|
16976
|
+
return fetch(finalUrl, {
|
|
16977
|
+
method: "GET",
|
|
16978
|
+
headers: HEADERS
|
|
16913
16979
|
});
|
|
16914
16980
|
|
|
16915
|
-
case
|
|
16981
|
+
case 15:
|
|
16916
16982
|
response = _context13.sent;
|
|
16917
16983
|
if (response.ok) {
|
|
16918
|
-
_context13.next =
|
|
16984
|
+
_context13.next = 18;
|
|
16919
16985
|
break;
|
|
16920
16986
|
}
|
|
16921
16987
|
throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
|
|
16922
16988
|
|
|
16923
|
-
case
|
|
16924
|
-
_context13.next =
|
|
16989
|
+
case 18:
|
|
16990
|
+
_context13.next = 20;
|
|
16925
16991
|
return response.json();
|
|
16926
16992
|
|
|
16927
|
-
case
|
|
16993
|
+
case 20:
|
|
16928
16994
|
_yield$response$json3 = _context13.sent;
|
|
16929
16995
|
_data3 = _yield$response$json3.data;
|
|
16930
16996
|
if (Array.isArray(_data3)) {
|
|
16931
|
-
_context13.next =
|
|
16997
|
+
_context13.next = 24;
|
|
16932
16998
|
break;
|
|
16933
16999
|
}
|
|
16934
17000
|
return _context13.abrupt("return", []);
|
|
16935
17001
|
|
|
16936
|
-
case
|
|
17002
|
+
case 24:
|
|
16937
17003
|
return _context13.abrupt("return", _data3.map((function(item) {
|
|
16938
17004
|
var flat = {};
|
|
16939
17005
|
for (var _i12 = 0, _Object$entries3 = Object.entries(item); _i12 < _Object$entries3.length; _i12++) {
|
|
@@ -16946,16 +17012,16 @@ function _typeof(o) {
|
|
|
16946
17012
|
return flat;
|
|
16947
17013
|
})));
|
|
16948
17014
|
|
|
16949
|
-
case
|
|
16950
|
-
_context13.prev =
|
|
17015
|
+
case 27:
|
|
17016
|
+
_context13.prev = 27;
|
|
16951
17017
|
_context13.t0 = _context13["catch"](0);
|
|
16952
17018
|
return _context13.abrupt("return", errorMessageHandler(_context13.t0, "FARCASTER"));
|
|
16953
17019
|
|
|
16954
|
-
case
|
|
17020
|
+
case 30:
|
|
16955
17021
|
case "end":
|
|
16956
17022
|
return _context13.stop();
|
|
16957
17023
|
}
|
|
16958
|
-
}), _callee13, null, [ [ 0,
|
|
17024
|
+
}), _callee13, null, [ [ 0, 27 ] ]);
|
|
16959
17025
|
})));
|
|
16960
17026
|
return _FARCASTER.apply(this, arguments);
|
|
16961
17027
|
}
|
|
@@ -17071,7 +17137,7 @@ function _typeof(o) {
|
|
|
17071
17137
|
}
|
|
17072
17138
|
function _BASE() {
|
|
17073
17139
|
_BASE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15() {
|
|
17074
|
-
var _argsToArray1, _argsToArray10, type, address, startDate, endDate, page, limit,
|
|
17140
|
+
var _argsToArray1, _argsToArray10, type, address, startDate, endDate, page, limit, _API_KEY, _args15 = arguments;
|
|
17075
17141
|
return _regeneratorRuntime().wrap((function _callee15$(_context15) {
|
|
17076
17142
|
while (1) switch (_context15.prev = _context15.next) {
|
|
17077
17143
|
case 0:
|
|
@@ -17087,8 +17153,8 @@ function _typeof(o) {
|
|
|
17087
17153
|
page: page,
|
|
17088
17154
|
limit: limit
|
|
17089
17155
|
});
|
|
17090
|
-
|
|
17091
|
-
if (
|
|
17156
|
+
_API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Basescan);
|
|
17157
|
+
if (_API_KEY) {
|
|
17092
17158
|
_context15.next = 6;
|
|
17093
17159
|
break;
|
|
17094
17160
|
}
|
|
@@ -17103,7 +17169,7 @@ function _typeof(o) {
|
|
|
17103
17169
|
endDate: endDate,
|
|
17104
17170
|
page: page,
|
|
17105
17171
|
offset: limit,
|
|
17106
|
-
apiKey:
|
|
17172
|
+
apiKey: _API_KEY,
|
|
17107
17173
|
functionName: "BASE",
|
|
17108
17174
|
chainId: CHAIN_ID_MAP.base,
|
|
17109
17175
|
network: "base"
|
|
@@ -17190,7 +17256,7 @@ function _typeof(o) {
|
|
|
17190
17256
|
}
|
|
17191
17257
|
function _NEYNAR() {
|
|
17192
17258
|
_NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
|
|
17193
|
-
var neynarParamsSchema, _argsToArray13, _argsToArray14, username, apiKey, fid, url, response, json, users, _args17 = arguments;
|
|
17259
|
+
var neynarParamsSchema, _argsToArray13, _argsToArray14, username, apiKey, fid, url, _getUrlAndHeaders7, finalUrl, HEADERS, response, json, users, _args17 = arguments;
|
|
17194
17260
|
return _regeneratorRuntime().wrap((function _callee17$(_context17) {
|
|
17195
17261
|
while (1) switch (_context17.prev = _context17.next) {
|
|
17196
17262
|
case 0:
|
|
@@ -17224,39 +17290,47 @@ function _typeof(o) {
|
|
|
17224
17290
|
|
|
17225
17291
|
case 12:
|
|
17226
17292
|
url = "https://api.neynar.com/v2/farcaster/followers?fid=".concat(fid);
|
|
17227
|
-
|
|
17228
|
-
|
|
17293
|
+
_getUrlAndHeaders7 = getUrlAndHeaders({
|
|
17294
|
+
url: url.toString(),
|
|
17295
|
+
serviceName: "Firefly",
|
|
17229
17296
|
headers: {
|
|
17230
|
-
|
|
17231
|
-
|
|
17297
|
+
headers: {
|
|
17298
|
+
"x-api-key": API_KEY,
|
|
17299
|
+
"x-neynar-experimental": "false"
|
|
17300
|
+
}
|
|
17232
17301
|
}
|
|
17302
|
+
}), finalUrl = _getUrlAndHeaders7.URL, HEADERS = _getUrlAndHeaders7.HEADERS;
|
|
17303
|
+
_context17.next = 16;
|
|
17304
|
+
return fetch(finalUrl, {
|
|
17305
|
+
method: "GET",
|
|
17306
|
+
headers: HEADERS
|
|
17233
17307
|
});
|
|
17234
17308
|
|
|
17235
|
-
case
|
|
17309
|
+
case 16:
|
|
17236
17310
|
response = _context17.sent;
|
|
17237
17311
|
if (response.ok) {
|
|
17238
|
-
_context17.next =
|
|
17312
|
+
_context17.next = 19;
|
|
17239
17313
|
break;
|
|
17240
17314
|
}
|
|
17241
17315
|
throw new NetworkError(SERVICES_API_KEY.Neynar, response.status);
|
|
17242
17316
|
|
|
17243
|
-
case
|
|
17244
|
-
_context17.next =
|
|
17317
|
+
case 19:
|
|
17318
|
+
_context17.next = 21;
|
|
17245
17319
|
return response.json();
|
|
17246
17320
|
|
|
17247
|
-
case
|
|
17321
|
+
case 21:
|
|
17248
17322
|
json = _context17.sent;
|
|
17249
17323
|
users = (json === null || json === void 0 ? void 0 : json.users) || [];
|
|
17250
17324
|
if (users.length) {
|
|
17251
|
-
_context17.next =
|
|
17325
|
+
_context17.next = 25;
|
|
17252
17326
|
break;
|
|
17253
17327
|
}
|
|
17254
17328
|
return _context17.abrupt("return", []);
|
|
17255
17329
|
|
|
17256
|
-
case
|
|
17257
|
-
return _context17.abrupt("return", users.map((function(
|
|
17330
|
+
case 25:
|
|
17331
|
+
return _context17.abrupt("return", users.map((function(_ref14) {
|
|
17258
17332
|
var _user$profile, _user$profile2;
|
|
17259
|
-
var user =
|
|
17333
|
+
var user = _ref14.user;
|
|
17260
17334
|
return {
|
|
17261
17335
|
username: user.username,
|
|
17262
17336
|
custody_address: user.custody_address,
|
|
@@ -17266,16 +17340,16 @@ function _typeof(o) {
|
|
|
17266
17340
|
};
|
|
17267
17341
|
})));
|
|
17268
17342
|
|
|
17269
|
-
case
|
|
17270
|
-
_context17.prev =
|
|
17343
|
+
case 28:
|
|
17344
|
+
_context17.prev = 28;
|
|
17271
17345
|
_context17.t0 = _context17["catch"](0);
|
|
17272
17346
|
return _context17.abrupt("return", errorMessageHandler(_context17.t0, "NEYNAR"));
|
|
17273
17347
|
|
|
17274
|
-
case
|
|
17348
|
+
case 31:
|
|
17275
17349
|
case "end":
|
|
17276
17350
|
return _context17.stop();
|
|
17277
17351
|
}
|
|
17278
|
-
}), _callee17, null, [ [ 0,
|
|
17352
|
+
}), _callee17, null, [ [ 0, 28 ] ]);
|
|
17279
17353
|
})));
|
|
17280
17354
|
return _NEYNAR.apply(this, arguments);
|
|
17281
17355
|
}
|
|
@@ -17354,7 +17428,7 @@ function _typeof(o) {
|
|
|
17354
17428
|
}
|
|
17355
17429
|
function _COINGECKO() {
|
|
17356
17430
|
_COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee19() {
|
|
17357
|
-
var _category$toLowerCase, _argsToArray17, _argsToArray18, category, param1, param2, apiKey,
|
|
17431
|
+
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
17432
|
return _regeneratorRuntime().wrap((function _callee19$(_context19) {
|
|
17359
17433
|
while (1) switch (_context19.prev = _context19.next) {
|
|
17360
17434
|
case 0:
|
|
@@ -17374,7 +17448,7 @@ function _typeof(o) {
|
|
|
17374
17448
|
throw new MissingApiKeyError(SERVICES_API_KEY.Coingecko);
|
|
17375
17449
|
|
|
17376
17450
|
case 6:
|
|
17377
|
-
|
|
17451
|
+
_headers = {
|
|
17378
17452
|
accept: "application/json",
|
|
17379
17453
|
"x-cg-demo-api-key": apiKey
|
|
17380
17454
|
};
|
|
@@ -17418,7 +17492,7 @@ function _typeof(o) {
|
|
|
17418
17492
|
case 25:
|
|
17419
17493
|
_context19.next = 27;
|
|
17420
17494
|
return fetch(url, {
|
|
17421
|
-
headers:
|
|
17495
|
+
headers: _headers
|
|
17422
17496
|
});
|
|
17423
17497
|
|
|
17424
17498
|
case 27:
|
|
@@ -17494,58 +17568,68 @@ function _typeof(o) {
|
|
|
17494
17568
|
return _regeneratorRuntime().wrap((function _callee21$(_context24) {
|
|
17495
17569
|
while (1) switch (_context24.prev = _context24.next) {
|
|
17496
17570
|
case 0:
|
|
17497
|
-
|
|
17571
|
+
console.log("EOA");
|
|
17572
|
+
_context24.prev = 1;
|
|
17498
17573
|
fetchJSON = function() {
|
|
17499
|
-
var
|
|
17500
|
-
var res, json;
|
|
17574
|
+
var _ref15 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20(url) {
|
|
17575
|
+
var _getUrlAndHeaders8, finalUrl, HEADERS, res, json;
|
|
17501
17576
|
return _regeneratorRuntime().wrap((function _callee20$(_context20) {
|
|
17502
17577
|
while (1) switch (_context20.prev = _context20.next) {
|
|
17503
17578
|
case 0:
|
|
17504
|
-
|
|
17505
|
-
|
|
17579
|
+
_getUrlAndHeaders8 = getUrlAndHeaders({
|
|
17580
|
+
url: url,
|
|
17581
|
+
serviceName: "Etherscan",
|
|
17582
|
+
headers: {}
|
|
17583
|
+
}), finalUrl = _getUrlAndHeaders8.URL, HEADERS = _getUrlAndHeaders8.HEADERS;
|
|
17584
|
+
console.log("finalUrl", finalUrl, HEADERS);
|
|
17585
|
+
_context20.next = 4;
|
|
17586
|
+
return fetch(finalUrl, {
|
|
17587
|
+
method: "GET",
|
|
17588
|
+
headers: HEADERS
|
|
17589
|
+
});
|
|
17506
17590
|
|
|
17507
|
-
case
|
|
17591
|
+
case 4:
|
|
17508
17592
|
res = _context20.sent;
|
|
17509
17593
|
if (res.ok) {
|
|
17510
|
-
_context20.next =
|
|
17594
|
+
_context20.next = 7;
|
|
17511
17595
|
break;
|
|
17512
17596
|
}
|
|
17513
17597
|
throw new NetworkError(SERVICES_API_KEY.Etherscan, res.status);
|
|
17514
17598
|
|
|
17515
|
-
case
|
|
17516
|
-
_context20.next =
|
|
17599
|
+
case 7:
|
|
17600
|
+
_context20.next = 9;
|
|
17517
17601
|
return res.json();
|
|
17518
17602
|
|
|
17519
|
-
case
|
|
17603
|
+
case 9:
|
|
17520
17604
|
json = _context20.sent;
|
|
17521
17605
|
if (!(typeof json.result === "string")) {
|
|
17522
|
-
_context20.next =
|
|
17606
|
+
_context20.next = 15;
|
|
17523
17607
|
break;
|
|
17524
17608
|
}
|
|
17525
17609
|
if (!json.result.includes("Invalid API Key")) {
|
|
17526
|
-
_context20.next =
|
|
17610
|
+
_context20.next = 13;
|
|
17527
17611
|
break;
|
|
17528
17612
|
}
|
|
17529
17613
|
throw new InvalidApiKeyError(SERVICES_API_KEY.Etherscan);
|
|
17530
17614
|
|
|
17531
|
-
case
|
|
17615
|
+
case 13:
|
|
17532
17616
|
if (!json.result.includes("Max rate limit reached")) {
|
|
17533
|
-
_context20.next =
|
|
17617
|
+
_context20.next = 15;
|
|
17534
17618
|
break;
|
|
17535
17619
|
}
|
|
17536
17620
|
throw new RateLimitError(SERVICES_API_KEY.Etherscan);
|
|
17537
17621
|
|
|
17538
|
-
case
|
|
17622
|
+
case 15:
|
|
17539
17623
|
return _context20.abrupt("return", json.result);
|
|
17540
17624
|
|
|
17541
|
-
case
|
|
17625
|
+
case 16:
|
|
17542
17626
|
case "end":
|
|
17543
17627
|
return _context20.stop();
|
|
17544
17628
|
}
|
|
17545
17629
|
}), _callee20);
|
|
17546
17630
|
})));
|
|
17547
17631
|
return function fetchJSON(_x17) {
|
|
17548
|
-
return
|
|
17632
|
+
return _ref15.apply(this, arguments);
|
|
17549
17633
|
};
|
|
17550
17634
|
}();
|
|
17551
17635
|
_argsToArray19 = argsToArray(_args24), _argsToArray20 = _slicedToArray(_argsToArray19, 7),
|
|
@@ -17563,13 +17647,14 @@ function _typeof(o) {
|
|
|
17563
17647
|
offset: offset
|
|
17564
17648
|
});
|
|
17565
17649
|
apiKey = window.localStorage.getItem(SERVICES_API_KEY.Etherscan);
|
|
17650
|
+
console.log("apiKey", apiKey);
|
|
17566
17651
|
if (apiKey) {
|
|
17567
|
-
_context24.next =
|
|
17652
|
+
_context24.next = 9;
|
|
17568
17653
|
break;
|
|
17569
17654
|
}
|
|
17570
17655
|
throw new MissingApiKeyError(SERVICES_API_KEY.Etherscan);
|
|
17571
17656
|
|
|
17572
|
-
case
|
|
17657
|
+
case 9:
|
|
17573
17658
|
INPUTS = addresses.split(",").map((function(s) {
|
|
17574
17659
|
return s.trim();
|
|
17575
17660
|
})).filter(Boolean);
|
|
@@ -17578,62 +17663,63 @@ function _typeof(o) {
|
|
|
17578
17663
|
})).filter(Boolean);
|
|
17579
17664
|
ADDRESS_MAP = {};
|
|
17580
17665
|
_iterator41 = _createForOfIteratorHelper(INPUTS);
|
|
17581
|
-
_context24.prev =
|
|
17666
|
+
_context24.prev = 13;
|
|
17582
17667
|
_iterator41.s();
|
|
17583
17668
|
|
|
17584
|
-
case
|
|
17669
|
+
case 15:
|
|
17585
17670
|
if ((_step41 = _iterator41.n()).done) {
|
|
17586
|
-
_context24.next =
|
|
17671
|
+
_context24.next = 30;
|
|
17587
17672
|
break;
|
|
17588
17673
|
}
|
|
17589
17674
|
inp = _step41.value;
|
|
17590
17675
|
if (!isAddress$1.isAddress(inp)) {
|
|
17591
|
-
_context24.next =
|
|
17676
|
+
_context24.next = 21;
|
|
17592
17677
|
break;
|
|
17593
17678
|
}
|
|
17594
17679
|
ADDRESS_MAP[inp.toLowerCase()] = null;
|
|
17595
|
-
_context24.next =
|
|
17680
|
+
_context24.next = 28;
|
|
17596
17681
|
break;
|
|
17597
17682
|
|
|
17598
|
-
case
|
|
17683
|
+
case 21:
|
|
17599
17684
|
ens = inp;
|
|
17600
|
-
_context24.next =
|
|
17685
|
+
_context24.next = 24;
|
|
17601
17686
|
return fromEnsNameToAddress$1.fromEnsNameToAddress(ens);
|
|
17602
17687
|
|
|
17603
|
-
case
|
|
17688
|
+
case 24:
|
|
17604
17689
|
resolved = _context24.sent;
|
|
17605
17690
|
if (resolved) {
|
|
17606
|
-
_context24.next =
|
|
17691
|
+
_context24.next = 27;
|
|
17607
17692
|
break;
|
|
17608
17693
|
}
|
|
17609
17694
|
throw new EnsError(ens);
|
|
17610
17695
|
|
|
17611
|
-
case
|
|
17696
|
+
case 27:
|
|
17612
17697
|
ADDRESS_MAP[resolved.toLowerCase()] = ens;
|
|
17613
17698
|
|
|
17614
|
-
case 26:
|
|
17615
|
-
_context24.next = 13;
|
|
17616
|
-
break;
|
|
17617
|
-
|
|
17618
17699
|
case 28:
|
|
17619
|
-
_context24.next =
|
|
17700
|
+
_context24.next = 15;
|
|
17620
17701
|
break;
|
|
17621
17702
|
|
|
17622
17703
|
case 30:
|
|
17623
|
-
_context24.
|
|
17624
|
-
|
|
17704
|
+
_context24.next = 35;
|
|
17705
|
+
break;
|
|
17706
|
+
|
|
17707
|
+
case 32:
|
|
17708
|
+
_context24.prev = 32;
|
|
17709
|
+
_context24.t0 = _context24["catch"](13);
|
|
17625
17710
|
_iterator41.e(_context24.t0);
|
|
17626
17711
|
|
|
17627
|
-
case
|
|
17628
|
-
_context24.prev =
|
|
17712
|
+
case 35:
|
|
17713
|
+
_context24.prev = 35;
|
|
17629
17714
|
_iterator41.f();
|
|
17630
|
-
return _context24.finish(
|
|
17715
|
+
return _context24.finish(35);
|
|
17631
17716
|
|
|
17632
|
-
case
|
|
17717
|
+
case 38:
|
|
17633
17718
|
ADDRS = Object.keys(ADDRESS_MAP);
|
|
17719
|
+
console.log("ADDRS", ADDRS);
|
|
17634
17720
|
out = [];
|
|
17635
17721
|
_iterator42 = _createForOfIteratorHelper(CHAINS);
|
|
17636
|
-
_context24.prev =
|
|
17722
|
+
_context24.prev = 42;
|
|
17637
17723
|
_loop = _regeneratorRuntime().mark((function _loop() {
|
|
17638
17724
|
var chain, chainId, _loop2, _ret2, i, sb, eb, _loop3, _ret3, _i16, _ADDRS;
|
|
17639
17725
|
return _regeneratorRuntime().wrap((function _loop$(_context23) {
|
|
@@ -17807,52 +17893,52 @@ function _typeof(o) {
|
|
|
17807
17893
|
}));
|
|
17808
17894
|
_iterator42.s();
|
|
17809
17895
|
|
|
17810
|
-
case
|
|
17896
|
+
case 45:
|
|
17811
17897
|
if ((_step42 = _iterator42.n()).done) {
|
|
17812
|
-
_context24.next =
|
|
17898
|
+
_context24.next = 52;
|
|
17813
17899
|
break;
|
|
17814
17900
|
}
|
|
17815
|
-
return _context24.delegateYield(_loop(), "t1",
|
|
17901
|
+
return _context24.delegateYield(_loop(), "t1", 47);
|
|
17816
17902
|
|
|
17817
|
-
case
|
|
17903
|
+
case 47:
|
|
17818
17904
|
_ret = _context24.t1;
|
|
17819
17905
|
if (!_ret) {
|
|
17820
|
-
_context24.next =
|
|
17906
|
+
_context24.next = 50;
|
|
17821
17907
|
break;
|
|
17822
17908
|
}
|
|
17823
17909
|
return _context24.abrupt("return", _ret.v);
|
|
17824
17910
|
|
|
17825
|
-
case
|
|
17826
|
-
_context24.next =
|
|
17911
|
+
case 50:
|
|
17912
|
+
_context24.next = 45;
|
|
17827
17913
|
break;
|
|
17828
17914
|
|
|
17829
|
-
case
|
|
17830
|
-
_context24.next =
|
|
17915
|
+
case 52:
|
|
17916
|
+
_context24.next = 57;
|
|
17831
17917
|
break;
|
|
17832
17918
|
|
|
17833
|
-
case 51:
|
|
17834
|
-
_context24.prev = 51;
|
|
17835
|
-
_context24.t2 = _context24["catch"](39);
|
|
17836
|
-
_iterator42.e(_context24.t2);
|
|
17837
|
-
|
|
17838
17919
|
case 54:
|
|
17839
17920
|
_context24.prev = 54;
|
|
17840
|
-
|
|
17841
|
-
|
|
17921
|
+
_context24.t2 = _context24["catch"](42);
|
|
17922
|
+
_iterator42.e(_context24.t2);
|
|
17842
17923
|
|
|
17843
17924
|
case 57:
|
|
17844
|
-
|
|
17925
|
+
_context24.prev = 57;
|
|
17926
|
+
_iterator42.f();
|
|
17927
|
+
return _context24.finish(57);
|
|
17845
17928
|
|
|
17846
17929
|
case 60:
|
|
17847
|
-
_context24.
|
|
17848
|
-
_context24.t3 = _context24["catch"](0);
|
|
17849
|
-
return _context24.abrupt("return", errorMessageHandler(_context24.t3, "EOA"));
|
|
17930
|
+
return _context24.abrupt("return", out);
|
|
17850
17931
|
|
|
17851
17932
|
case 63:
|
|
17933
|
+
_context24.prev = 63;
|
|
17934
|
+
_context24.t3 = _context24["catch"](1);
|
|
17935
|
+
return _context24.abrupt("return", errorMessageHandler(_context24.t3, "EOA"));
|
|
17936
|
+
|
|
17937
|
+
case 66:
|
|
17852
17938
|
case "end":
|
|
17853
17939
|
return _context24.stop();
|
|
17854
17940
|
}
|
|
17855
|
-
}), _callee21, null, [ [
|
|
17941
|
+
}), _callee21, null, [ [ 1, 63 ], [ 13, 32, 35, 38 ], [ 42, 54, 57, 60 ] ]);
|
|
17856
17942
|
})));
|
|
17857
17943
|
return _EOA.apply(this, arguments);
|
|
17858
17944
|
}
|
|
@@ -17964,8 +18050,8 @@ function _typeof(o) {
|
|
|
17964
18050
|
throw new ValidationError("Invalid API response");
|
|
17965
18051
|
|
|
17966
18052
|
case 28:
|
|
17967
|
-
return _context26.abrupt("return", json.results.map((function(
|
|
17968
|
-
var confirmations =
|
|
18053
|
+
return _context26.abrupt("return", json.results.map((function(_ref16) {
|
|
18054
|
+
var confirmations = _ref16.confirmations, dataDecoded = _ref16.dataDecoded, rest = _objectWithoutProperties(_ref16, _excluded);
|
|
17969
18055
|
return rest;
|
|
17970
18056
|
})));
|
|
17971
18057
|
|
|
@@ -18113,8 +18199,8 @@ function _typeof(o) {
|
|
|
18113
18199
|
}
|
|
18114
18200
|
return _context28.abrupt("return", json.map((function(item) {
|
|
18115
18201
|
var flat = {};
|
|
18116
|
-
Object.entries(item).forEach((function(
|
|
18117
|
-
var
|
|
18202
|
+
Object.entries(item).forEach((function(_ref17) {
|
|
18203
|
+
var _ref18 = _slicedToArray(_ref17, 2), k = _ref18[0], v = _ref18[1];
|
|
18118
18204
|
if (v === null || _typeof(v) !== "object") flat[k] = v;
|
|
18119
18205
|
}));
|
|
18120
18206
|
return flat;
|
|
@@ -18180,8 +18266,8 @@ function _typeof(o) {
|
|
|
18180
18266
|
}
|
|
18181
18267
|
return _context29.abrupt("return", json.map((function(item) {
|
|
18182
18268
|
var flat = {};
|
|
18183
|
-
Object.entries(item).forEach((function(
|
|
18184
|
-
var
|
|
18269
|
+
Object.entries(item).forEach((function(_ref19) {
|
|
18270
|
+
var _ref20 = _slicedToArray(_ref19, 2), k = _ref20[0], v = _ref20[1];
|
|
18185
18271
|
if (v === null || _typeof(v) !== "object") flat[k] = v;
|
|
18186
18272
|
}));
|
|
18187
18273
|
return flat;
|