@fileverse-dev/formulajs 4.4.11-mod-68-patch-7 → 4.4.11-mod-71
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 +333 -429
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +104 -245
- package/lib/esm/crypto-constants.mjs +2 -2
- package/lib/esm/index.mjs +104 -245
- 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-71 */
|
|
2
2
|
var _excluded = [ "confirmations", "dataDecoded" ];
|
|
3
3
|
|
|
4
4
|
function _objectWithoutProperties(e, t) {
|
|
@@ -21,6 +21,38 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
function ownKeys(e, r) {
|
|
25
|
+
var t = Object.keys(e);
|
|
26
|
+
if (Object.getOwnPropertySymbols) {
|
|
27
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
28
|
+
r && (o = o.filter((function(r) {
|
|
29
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
30
|
+
}))), t.push.apply(t, o);
|
|
31
|
+
}
|
|
32
|
+
return t;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function _objectSpread(e) {
|
|
36
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
37
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
38
|
+
r % 2 ? ownKeys(Object(t), !0).forEach((function(r) {
|
|
39
|
+
_defineProperty(e, r, t[r]);
|
|
40
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach((function(r) {
|
|
41
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
return e;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function _defineProperty(e, r, t) {
|
|
48
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
49
|
+
value: t,
|
|
50
|
+
enumerable: !0,
|
|
51
|
+
configurable: !0,
|
|
52
|
+
writable: !0
|
|
53
|
+
}) : e[r] = t, e;
|
|
54
|
+
}
|
|
55
|
+
|
|
24
56
|
function _createForOfIteratorHelper(r, e) {
|
|
25
57
|
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
26
58
|
if (!t) {
|
|
@@ -81,6 +113,22 @@ function _createClass(e, r, t) {
|
|
|
81
113
|
}), e;
|
|
82
114
|
}
|
|
83
115
|
|
|
116
|
+
function _toPropertyKey(t) {
|
|
117
|
+
var i = _toPrimitive(t, "string");
|
|
118
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function _toPrimitive(t, r) {
|
|
122
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
123
|
+
var e = t[Symbol.toPrimitive];
|
|
124
|
+
if (void 0 !== e) {
|
|
125
|
+
var i = e.call(t, r || "default");
|
|
126
|
+
if ("object" != _typeof(i)) return i;
|
|
127
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
128
|
+
}
|
|
129
|
+
return ("string" === r ? String : Number)(t);
|
|
130
|
+
}
|
|
131
|
+
|
|
84
132
|
function _classCallCheck(a, n) {
|
|
85
133
|
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
86
134
|
}
|
|
@@ -463,54 +511,6 @@ function _asyncToGenerator(n) {
|
|
|
463
511
|
};
|
|
464
512
|
}
|
|
465
513
|
|
|
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,130 +11068,41 @@ function _typeof(o) {
|
|
|
11068
11068
|
Neynar: "Neynar",
|
|
11069
11069
|
Defillama: "Defillama"
|
|
11070
11070
|
};
|
|
11071
|
-
var PROXY_MAP = {
|
|
11072
|
-
Etherscan: {
|
|
11073
|
-
url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
|
|
11074
|
-
removeParams: [ "apikey" ]
|
|
11075
|
-
},
|
|
11076
|
-
Basescan: {
|
|
11077
|
-
url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
|
|
11078
|
-
removeParams: [ "apikey" ]
|
|
11079
|
-
},
|
|
11080
|
-
Gnosisscan: {
|
|
11081
|
-
url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
|
|
11082
|
-
removeParams: [ "apikey" ]
|
|
11083
|
-
},
|
|
11084
|
-
Coingecko: {
|
|
11085
|
-
url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
|
|
11086
|
-
removeParams: [ "apikey" ]
|
|
11087
|
-
},
|
|
11088
|
-
Firefly: {
|
|
11089
|
-
url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
|
|
11090
|
-
removeParams: [ "apikey" ]
|
|
11091
|
-
},
|
|
11092
|
-
Neynar: {
|
|
11093
|
-
url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
|
|
11094
|
-
removeParams: [ "api_key" ]
|
|
11095
|
-
},
|
|
11096
|
-
Safe: {
|
|
11097
|
-
url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
|
|
11098
|
-
removeParams: [ "api_key" ]
|
|
11099
|
-
},
|
|
11100
|
-
Defillama: {
|
|
11101
|
-
url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
|
|
11102
|
-
removeParams: [ "api_key" ]
|
|
11103
|
-
},
|
|
11104
|
-
GnosisPay: {
|
|
11105
|
-
url: "https://staging-api-proxy-ca4268d7d581.herokuapp.com/proxy",
|
|
11106
|
-
removeParams: [ "api_key" ]
|
|
11107
|
-
}
|
|
11108
|
-
};
|
|
11109
|
-
function removeUrlParams(url, paramsToRemove) {
|
|
11110
|
-
if (!paramsToRemove || paramsToRemove.length === 0) {
|
|
11111
|
-
return url;
|
|
11112
|
-
}
|
|
11113
|
-
var urlObj = new URL(url);
|
|
11114
|
-
paramsToRemove.forEach((function(param) {
|
|
11115
|
-
if (urlObj.searchParams.has(param)) {
|
|
11116
|
-
urlObj.searchParams["delete"](param);
|
|
11117
|
-
}
|
|
11118
|
-
}));
|
|
11119
|
-
return urlObj.toString();
|
|
11120
|
-
}
|
|
11121
|
-
function getUrlAndHeaders(_ref) {
|
|
11122
|
-
var url = _ref.url, serviceName = _ref.serviceName, _ref$headers = _ref.headers, headers = _ref$headers === void 0 ? {} : _ref$headers;
|
|
11123
|
-
console.log("getUrlAndHeaders new modified function from formulajs", url, serviceName);
|
|
11124
|
-
var apiKeyLS = window.localStorage.getItem(SERVICES_API_KEY[serviceName]);
|
|
11125
|
-
var isProxyModeEnabledValue = apiKeyLS === "DEFAULT_PROXY_MODE";
|
|
11126
|
-
var proxyConfig = PROXY_MAP[serviceName];
|
|
11127
|
-
if (isProxyModeEnabledValue && proxyConfig && serviceName && SERVICES_API_KEY[serviceName]) {
|
|
11128
|
-
console.log("isProxyModeEnabledValue", isProxyModeEnabledValue);
|
|
11129
|
-
var cleanedUrl = removeUrlParams(url, proxyConfig.removeParams);
|
|
11130
|
-
return {
|
|
11131
|
-
URL: proxyConfig.url,
|
|
11132
|
-
HEADERS: {
|
|
11133
|
-
"target-url": cleanedUrl,
|
|
11134
|
-
method: "GET",
|
|
11135
|
-
"Content-Type": "application/json"
|
|
11136
|
-
}
|
|
11137
|
-
};
|
|
11138
|
-
}
|
|
11139
|
-
return {
|
|
11140
|
-
URL: url,
|
|
11141
|
-
HEADERS: _objectSpread(_objectSpread({}, headers), {}, {
|
|
11142
|
-
method: "GET",
|
|
11143
|
-
"Content-Type": "application/json"
|
|
11144
|
-
})
|
|
11145
|
-
};
|
|
11146
|
-
}
|
|
11147
11071
|
var fromTimeStampToBlock = function() {
|
|
11148
|
-
var
|
|
11149
|
-
var chainId, url,
|
|
11072
|
+
var _ref = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(timestamp, chain, apiKey) {
|
|
11073
|
+
var chainId, url, res, json;
|
|
11150
11074
|
return _regeneratorRuntime().wrap((function _callee$(_context) {
|
|
11151
11075
|
while (1) switch (_context.prev = _context.next) {
|
|
11152
11076
|
case 0:
|
|
11153
|
-
console.log("fromTimeStampToBlock", timestamp, chain, apiKey);
|
|
11154
11077
|
if (!(!timestamp || !chain || !apiKey)) {
|
|
11155
|
-
_context.next =
|
|
11078
|
+
_context.next = 2;
|
|
11156
11079
|
break;
|
|
11157
11080
|
}
|
|
11158
11081
|
return _context.abrupt("return");
|
|
11159
11082
|
|
|
11160
|
-
case
|
|
11083
|
+
case 2:
|
|
11161
11084
|
chainId = CHAIN_ID_MAP[chain];
|
|
11162
|
-
console.log("chainId", chainId);
|
|
11163
11085
|
url = "https://api.etherscan.io/v2/api?module=block&action=getblocknobytime×tamp=".concat(timestamp, "&closest=before&apikey=").concat(apiKey, "&chainId=").concat(chainId);
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
url: url,
|
|
11167
|
-
serviceName: "Etherscan",
|
|
11168
|
-
headers: {}
|
|
11169
|
-
}), finalUrl = _getUrlAndHeaders.URL, HEADERS = _getUrlAndHeaders.HEADERS;
|
|
11170
|
-
console.log("finalUrl", finalUrl, HEADERS);
|
|
11171
|
-
_context.next = 11;
|
|
11172
|
-
return fetch(finalUrl, {
|
|
11173
|
-
method: "GET",
|
|
11174
|
-
headers: HEADERS
|
|
11175
|
-
});
|
|
11086
|
+
_context.next = 6;
|
|
11087
|
+
return fetch(url);
|
|
11176
11088
|
|
|
11177
|
-
case
|
|
11089
|
+
case 6:
|
|
11178
11090
|
res = _context.sent;
|
|
11179
|
-
|
|
11180
|
-
_context.next = 15;
|
|
11091
|
+
_context.next = 9;
|
|
11181
11092
|
return res.json();
|
|
11182
11093
|
|
|
11183
|
-
case
|
|
11094
|
+
case 9:
|
|
11184
11095
|
json = _context.sent;
|
|
11185
11096
|
return _context.abrupt("return", parseInt(json.result));
|
|
11186
11097
|
|
|
11187
|
-
case
|
|
11098
|
+
case 11:
|
|
11188
11099
|
case "end":
|
|
11189
11100
|
return _context.stop();
|
|
11190
11101
|
}
|
|
11191
11102
|
}), _callee);
|
|
11192
11103
|
})));
|
|
11193
11104
|
return function fromTimeStampToBlock(_x2, _x3, _x4) {
|
|
11194
|
-
return
|
|
11105
|
+
return _ref.apply(this, arguments);
|
|
11195
11106
|
};
|
|
11196
11107
|
}();
|
|
11197
11108
|
var fromTimestampToBlock = {
|
|
@@ -11328,15 +11239,15 @@ function _typeof(o) {
|
|
|
11328
11239
|
return _handleScanRequest.apply(this, arguments);
|
|
11329
11240
|
}
|
|
11330
11241
|
function _handleScanRequest() {
|
|
11331
|
-
_handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(
|
|
11332
|
-
var type, address, startDate, endDate,
|
|
11242
|
+
_handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(_ref2) {
|
|
11243
|
+
var type, address, startDate, endDate, _ref2$page, page, _ref2$offset, offset, apiKey, functionName, chainId, network, API_INFO_MAP, ensName, apiInfo, baseUrl, ACTION_MAP, action, module, url, _yield$Promise$all, _yield$Promise$all2, startBlock, endBlock, res, json;
|
|
11333
11244
|
return _regeneratorRuntime().wrap((function _callee10$(_context10) {
|
|
11334
11245
|
while (1) switch (_context10.prev = _context10.next) {
|
|
11335
11246
|
case 0:
|
|
11336
|
-
type =
|
|
11337
|
-
|
|
11338
|
-
offset =
|
|
11339
|
-
chainId =
|
|
11247
|
+
type = _ref2.type, address = _ref2.address, startDate = _ref2.startDate, endDate = _ref2.endDate,
|
|
11248
|
+
_ref2$page = _ref2.page, page = _ref2$page === void 0 ? 1 : _ref2$page, _ref2$offset = _ref2.offset,
|
|
11249
|
+
offset = _ref2$offset === void 0 ? 10 : _ref2$offset, apiKey = _ref2.apiKey, functionName = _ref2.functionName,
|
|
11250
|
+
chainId = _ref2.chainId, network = _ref2.network;
|
|
11340
11251
|
API_INFO_MAP = {
|
|
11341
11252
|
BASE: {
|
|
11342
11253
|
url: "https://api.basescan.org/api",
|
|
@@ -11381,7 +11292,7 @@ function _typeof(o) {
|
|
|
11381
11292
|
"all-txns": "txlist",
|
|
11382
11293
|
"token-txns": "tokentx",
|
|
11383
11294
|
"nft-txns": "tokennfttx",
|
|
11384
|
-
gas: "
|
|
11295
|
+
gas: "gasoracle"
|
|
11385
11296
|
};
|
|
11386
11297
|
action = ACTION_MAP[type];
|
|
11387
11298
|
if (action) {
|
|
@@ -11391,40 +11302,33 @@ function _typeof(o) {
|
|
|
11391
11302
|
throw new ValidationError("Invalid type: ".concat(type));
|
|
11392
11303
|
|
|
11393
11304
|
case 17:
|
|
11394
|
-
|
|
11305
|
+
module = action === "gasoracle" ? "gastracker" : "account";
|
|
11306
|
+
url = "".concat(baseUrl, "?chainid=").concat(chainId, "&module=").concat(module, "&action=").concat(action, "&apikey=").concat(apiKey);
|
|
11395
11307
|
if (![ "all-txns", "token-txns", "nft-txns" ].includes(type)) {
|
|
11396
|
-
_context10.next =
|
|
11308
|
+
_context10.next = 30;
|
|
11397
11309
|
break;
|
|
11398
11310
|
}
|
|
11399
11311
|
url += "&address=".concat(address, "&startblock=0&endblock=99999999&sort=asc");
|
|
11400
11312
|
if (!(!isNaN(startDate) && !isNaN(endDate))) {
|
|
11401
|
-
_context10.next =
|
|
11313
|
+
_context10.next = 29;
|
|
11402
11314
|
break;
|
|
11403
11315
|
}
|
|
11404
|
-
_context10.next =
|
|
11316
|
+
_context10.next = 24;
|
|
11405
11317
|
return Promise.all([ fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startDate), network, apiKey), fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endDate), network, apiKey) ]);
|
|
11406
11318
|
|
|
11407
|
-
case
|
|
11319
|
+
case 24:
|
|
11408
11320
|
_yield$Promise$all = _context10.sent;
|
|
11409
11321
|
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
11410
11322
|
startBlock = _yield$Promise$all2[0];
|
|
11411
11323
|
endBlock = _yield$Promise$all2[1];
|
|
11412
11324
|
url += "&startblock=".concat(startBlock || "0", "&endblock=").concat(endBlock || "99999999");
|
|
11413
11325
|
|
|
11414
|
-
case
|
|
11326
|
+
case 29:
|
|
11415
11327
|
url += "&page=".concat(page, "&offset=").concat(offset);
|
|
11416
11328
|
|
|
11417
|
-
case
|
|
11418
|
-
_getUrlAndHeaders3 = getUrlAndHeaders({
|
|
11419
|
-
url: url,
|
|
11420
|
-
serviceName: "Etherscan",
|
|
11421
|
-
headers: {}
|
|
11422
|
-
}), finalUrl = _getUrlAndHeaders3.URL, HEADERS = _getUrlAndHeaders3.HEADERS;
|
|
11329
|
+
case 30:
|
|
11423
11330
|
_context10.next = 32;
|
|
11424
|
-
return fetch(
|
|
11425
|
-
method: "GET",
|
|
11426
|
-
headers: HEADERS
|
|
11427
|
-
});
|
|
11331
|
+
return fetch(url);
|
|
11428
11332
|
|
|
11429
11333
|
case 32:
|
|
11430
11334
|
res = _context10.sent;
|
|
@@ -11458,7 +11362,7 @@ function _typeof(o) {
|
|
|
11458
11362
|
throw new RateLimitError(apiInfo.apiKeyName);
|
|
11459
11363
|
|
|
11460
11364
|
case 43:
|
|
11461
|
-
return _context10.abrupt("return", json.result);
|
|
11365
|
+
return _context10.abrupt("return", type === "gas" && !Array.isArray(json.result) ? [ json.result ] : json.result);
|
|
11462
11366
|
|
|
11463
11367
|
case 44:
|
|
11464
11368
|
case "end":
|
|
@@ -11469,8 +11373,8 @@ function _typeof(o) {
|
|
|
11469
11373
|
return _handleScanRequest.apply(this, arguments);
|
|
11470
11374
|
}
|
|
11471
11375
|
var fromUsernameToFid = function() {
|
|
11472
|
-
var
|
|
11473
|
-
var url,
|
|
11376
|
+
var _ref3 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(username, apiKey) {
|
|
11377
|
+
var url, res, json, users, user;
|
|
11474
11378
|
return _regeneratorRuntime().wrap((function _callee2$(_context2) {
|
|
11475
11379
|
while (1) switch (_context2.prev = _context2.next) {
|
|
11476
11380
|
case 0:
|
|
@@ -11482,26 +11386,20 @@ function _typeof(o) {
|
|
|
11482
11386
|
|
|
11483
11387
|
case 2:
|
|
11484
11388
|
url = "https://api.neynar.com/v2/farcaster/user/search/?q=".concat(username, "&limit=5");
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
serviceName: "Neynar",
|
|
11389
|
+
_context2.next = 5;
|
|
11390
|
+
return fetch(url, {
|
|
11488
11391
|
headers: {
|
|
11489
11392
|
"x-api-key": apiKey,
|
|
11490
11393
|
"x-neynar-experimental": "false"
|
|
11491
11394
|
}
|
|
11492
|
-
}), finalUrl = _getUrlAndHeaders2.URL, HEADERS = _getUrlAndHeaders2.HEADERS;
|
|
11493
|
-
_context2.next = 6;
|
|
11494
|
-
return fetch(finalUrl, {
|
|
11495
|
-
method: "GET",
|
|
11496
|
-
headers: HEADERS
|
|
11497
11395
|
});
|
|
11498
11396
|
|
|
11499
|
-
case
|
|
11397
|
+
case 5:
|
|
11500
11398
|
res = _context2.sent;
|
|
11501
|
-
_context2.next =
|
|
11399
|
+
_context2.next = 8;
|
|
11502
11400
|
return res.json();
|
|
11503
11401
|
|
|
11504
|
-
case
|
|
11402
|
+
case 8:
|
|
11505
11403
|
json = _context2.sent;
|
|
11506
11404
|
users = json.result ? json.result.users : [];
|
|
11507
11405
|
user = users.find((function(user) {
|
|
@@ -11509,14 +11407,14 @@ function _typeof(o) {
|
|
|
11509
11407
|
}));
|
|
11510
11408
|
return _context2.abrupt("return", user && user.fid || null);
|
|
11511
11409
|
|
|
11512
|
-
case
|
|
11410
|
+
case 12:
|
|
11513
11411
|
case "end":
|
|
11514
11412
|
return _context2.stop();
|
|
11515
11413
|
}
|
|
11516
11414
|
}), _callee2);
|
|
11517
11415
|
})));
|
|
11518
11416
|
return function fromUsernameToFid(_x7, _x8) {
|
|
11519
|
-
return
|
|
11417
|
+
return _ref3.apply(this, arguments);
|
|
11520
11418
|
};
|
|
11521
11419
|
}();
|
|
11522
11420
|
var fromUsernameToFid$1 = {
|
|
@@ -12263,7 +12161,7 @@ function _typeof(o) {
|
|
|
12263
12161
|
description: description
|
|
12264
12162
|
};
|
|
12265
12163
|
var customMap = function customMap(iss, ctx) {
|
|
12266
|
-
var
|
|
12164
|
+
var _ref5;
|
|
12267
12165
|
var message = params.message;
|
|
12268
12166
|
if (iss.code === "invalid_enum_value") {
|
|
12269
12167
|
return {
|
|
@@ -12271,16 +12169,16 @@ function _typeof(o) {
|
|
|
12271
12169
|
};
|
|
12272
12170
|
}
|
|
12273
12171
|
if (typeof ctx.data === "undefined") {
|
|
12274
|
-
var
|
|
12172
|
+
var _ref4;
|
|
12275
12173
|
return {
|
|
12276
|
-
message: (
|
|
12174
|
+
message: (_ref4 = message !== null && message !== void 0 ? message : required_error) !== null && _ref4 !== void 0 ? _ref4 : ctx.defaultError
|
|
12277
12175
|
};
|
|
12278
12176
|
}
|
|
12279
12177
|
if (iss.code !== "invalid_type") return {
|
|
12280
12178
|
message: ctx.defaultError
|
|
12281
12179
|
};
|
|
12282
12180
|
return {
|
|
12283
|
-
message: (
|
|
12181
|
+
message: (_ref5 = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _ref5 !== void 0 ? _ref5 : ctx.defaultError
|
|
12284
12182
|
};
|
|
12285
12183
|
};
|
|
12286
12184
|
return {
|
|
@@ -15020,7 +14918,7 @@ function _typeof(o) {
|
|
|
15020
14918
|
}
|
|
15021
14919
|
if (ctx.common.async) {
|
|
15022
14920
|
return Promise.all(options.map(function() {
|
|
15023
|
-
var
|
|
14921
|
+
var _ref7 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7(option) {
|
|
15024
14922
|
var childCtx;
|
|
15025
14923
|
return _regeneratorRuntime().wrap((function _callee7$(_context7) {
|
|
15026
14924
|
while (1) switch (_context7.prev = _context7.next) {
|
|
@@ -15053,7 +14951,7 @@ function _typeof(o) {
|
|
|
15053
14951
|
}), _callee7);
|
|
15054
14952
|
})));
|
|
15055
14953
|
return function(_x13) {
|
|
15056
|
-
return
|
|
14954
|
+
return _ref7.apply(this, arguments);
|
|
15057
14955
|
};
|
|
15058
14956
|
}())).then(handleResults);
|
|
15059
14957
|
} else {
|
|
@@ -15355,8 +15253,8 @@ function _typeof(o) {
|
|
|
15355
15253
|
data: ctx.data,
|
|
15356
15254
|
path: ctx.path,
|
|
15357
15255
|
parent: ctx
|
|
15358
|
-
}) ]).then((function(
|
|
15359
|
-
var
|
|
15256
|
+
}) ]).then((function(_ref8) {
|
|
15257
|
+
var _ref9 = _slicedToArray(_ref8, 2), left = _ref9[0], right = _ref9[1];
|
|
15360
15258
|
return handleParsed(left, right);
|
|
15361
15259
|
}));
|
|
15362
15260
|
} else {
|
|
@@ -15489,8 +15387,8 @@ function _typeof(o) {
|
|
|
15489
15387
|
}
|
|
15490
15388
|
var keyType = this._def.keyType;
|
|
15491
15389
|
var valueType = this._def.valueType;
|
|
15492
|
-
var pairs = _toConsumableArray(ctx.data.entries()).map((function(
|
|
15493
|
-
var
|
|
15390
|
+
var pairs = _toConsumableArray(ctx.data.entries()).map((function(_ref0, index) {
|
|
15391
|
+
var _ref1 = _slicedToArray(_ref0, 2), key = _ref1[0], value = _ref1[1];
|
|
15494
15392
|
return {
|
|
15495
15393
|
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [ index, "key" ])),
|
|
15496
15394
|
value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [ index, "value" ]))
|
|
@@ -16024,7 +15922,7 @@ function _typeof(o) {
|
|
|
16024
15922
|
var processed = effect.transform(ctx.data, checkCtx);
|
|
16025
15923
|
if (ctx.common.async) {
|
|
16026
15924
|
return Promise.resolve(processed).then(function() {
|
|
16027
|
-
var
|
|
15925
|
+
var _ref11 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9(processed) {
|
|
16028
15926
|
var result;
|
|
16029
15927
|
return _regeneratorRuntime().wrap((function _callee9$(_context9) {
|
|
16030
15928
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -16075,7 +15973,7 @@ function _typeof(o) {
|
|
|
16075
15973
|
}), _callee9);
|
|
16076
15974
|
})));
|
|
16077
15975
|
return function(_x14) {
|
|
16078
|
-
return
|
|
15976
|
+
return _ref11.apply(this, arguments);
|
|
16079
15977
|
};
|
|
16080
15978
|
}());
|
|
16081
15979
|
} else {
|
|
@@ -16406,7 +16304,7 @@ function _typeof(o) {
|
|
|
16406
16304
|
var _this$_processInputPa13 = this._processInputParams(input), status = _this$_processInputPa13.status, ctx = _this$_processInputPa13.ctx;
|
|
16407
16305
|
if (ctx.common.async) {
|
|
16408
16306
|
var handleAsync = function() {
|
|
16409
|
-
var
|
|
16307
|
+
var _ref12 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
|
|
16410
16308
|
var inResult;
|
|
16411
16309
|
return _regeneratorRuntime().wrap((function _callee0$(_context0) {
|
|
16412
16310
|
while (1) switch (_context0.prev = _context0.next) {
|
|
@@ -16448,7 +16346,7 @@ function _typeof(o) {
|
|
|
16448
16346
|
}), _callee0);
|
|
16449
16347
|
})));
|
|
16450
16348
|
return function handleAsync() {
|
|
16451
|
-
return
|
|
16349
|
+
return _ref12.apply(this, arguments);
|
|
16452
16350
|
};
|
|
16453
16351
|
}();
|
|
16454
16352
|
return handleAsync();
|
|
@@ -16578,14 +16476,18 @@ function _typeof(o) {
|
|
|
16578
16476
|
contentType: enumType([ "posts", "replies", "channels" ]),
|
|
16579
16477
|
identifier: stringType().nonempty(),
|
|
16580
16478
|
start: numberType()["int"]().nonnegative()["default"](0),
|
|
16581
|
-
end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT
|
|
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)
|
|
16582
16482
|
});
|
|
16583
16483
|
var lensSchema = objectType({
|
|
16584
16484
|
platform: literalType("lens"),
|
|
16585
16485
|
contentType: enumType([ "posts", "replies" ]),
|
|
16586
16486
|
identifier: stringType().nonempty(),
|
|
16587
16487
|
start: numberType()["int"]().nonnegative()["default"](0),
|
|
16588
|
-
end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT
|
|
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)
|
|
16589
16491
|
});
|
|
16590
16492
|
var fireflyParamsSchema = discriminatedUnionType("platform", [ farcasterSchema, lensSchema ]);
|
|
16591
16493
|
var fireFlyPlaformType = {
|
|
@@ -16603,21 +16505,33 @@ function _typeof(o) {
|
|
|
16603
16505
|
contentType: enumType([ "posts", "replies" ]),
|
|
16604
16506
|
identifier: stringType().nonempty(),
|
|
16605
16507
|
start: numberType()["int"]().nonnegative()["default"](0),
|
|
16606
|
-
end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT
|
|
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)
|
|
16607
16511
|
});
|
|
16608
16512
|
var farcasterParamsSchema = objectType({
|
|
16609
16513
|
contentType: enumType([ "posts", "replies", "channels" ]),
|
|
16610
16514
|
identifier: stringType().nonempty(),
|
|
16611
16515
|
start: numberType()["int"]().nonnegative()["default"](0),
|
|
16612
|
-
end: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT
|
|
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)
|
|
16613
16519
|
});
|
|
16614
16520
|
var dateStringToTimestamp = function dateStringToTimestamp(val) {
|
|
16615
|
-
var _val$split = val.split("/"), _val$split2 = _slicedToArray(_val$split, 3),
|
|
16616
|
-
|
|
16521
|
+
var _val$split = val.split("/"), _val$split2 = _slicedToArray(_val$split, 3), dd = _val$split2[0], mm = _val$split2[1], yyyy = _val$split2[2];
|
|
16522
|
+
var date = new Date("".concat(yyyy, "-").concat(mm.padStart(2, "0"), "-").concat(dd.padStart(2, "0")));
|
|
16523
|
+
var timestamp = date.getTime();
|
|
16524
|
+
return isNaN(timestamp) ? NaN : Math.floor(timestamp / 1e3);
|
|
16617
16525
|
};
|
|
16618
16526
|
var dateOrTimestamp = preprocessType((function(val) {
|
|
16619
|
-
return typeof val === "string" && /^\d{2}\/\d{2}\/\d{4}$/.test(val) ? dateStringToTimestamp(val) : val;
|
|
16620
|
-
}), numberType(
|
|
16527
|
+
return typeof val === "string" && /^\d{1,2}\/\d{1,2}\/\d{4}$/.test(val) ? dateStringToTimestamp(val) : val;
|
|
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
|
+
}));
|
|
16621
16535
|
var blockscoutParamsSchema = objectType({
|
|
16622
16536
|
address: stringType().nonempty(),
|
|
16623
16537
|
type: enumType([ "stat", "txns", "tokens" ]),
|
|
@@ -16625,14 +16539,18 @@ function _typeof(o) {
|
|
|
16625
16539
|
startTimestamp: dateOrTimestamp.optional(),
|
|
16626
16540
|
endTimestamp: dateOrTimestamp.optional(),
|
|
16627
16541
|
page: numberType()["int"]().nonnegative()["default"](1),
|
|
16628
|
-
offset: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT
|
|
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)
|
|
16629
16545
|
});
|
|
16630
16546
|
var gasSchema$1 = objectType({
|
|
16631
16547
|
type: literalType("gas"),
|
|
16632
16548
|
startDate: dateOrTimestamp.optional(),
|
|
16633
16549
|
endDate: dateOrTimestamp.optional(),
|
|
16634
16550
|
page: numberType()["int"]().nonnegative()["default"](1),
|
|
16635
|
-
limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT
|
|
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)
|
|
16636
16554
|
});
|
|
16637
16555
|
var txnSchema$1 = objectType({
|
|
16638
16556
|
type: enumType([ "all-txns", "token-txns", "nft-txns" ]),
|
|
@@ -16640,7 +16558,9 @@ function _typeof(o) {
|
|
|
16640
16558
|
startDate: dateOrTimestamp.optional(),
|
|
16641
16559
|
endDate: dateOrTimestamp.optional(),
|
|
16642
16560
|
page: numberType()["int"]().nonnegative()["default"](1),
|
|
16643
|
-
limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT
|
|
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)
|
|
16644
16564
|
});
|
|
16645
16565
|
var baseParamsSchema = discriminatedUnionType("type", [ gasSchema$1, txnSchema$1 ]);
|
|
16646
16566
|
var gasSchema = objectType({
|
|
@@ -16648,7 +16568,9 @@ function _typeof(o) {
|
|
|
16648
16568
|
startDate: dateOrTimestamp.optional(),
|
|
16649
16569
|
endDate: dateOrTimestamp.optional(),
|
|
16650
16570
|
page: numberType()["int"]().nonnegative()["default"](1),
|
|
16651
|
-
limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT
|
|
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)
|
|
16652
16574
|
});
|
|
16653
16575
|
var txnSchema = objectType({
|
|
16654
16576
|
type: enumType([ "all-txns", "token-txns", "nft-txns" ]),
|
|
@@ -16657,9 +16579,24 @@ function _typeof(o) {
|
|
|
16657
16579
|
endDate: dateOrTimestamp.optional(),
|
|
16658
16580
|
chain: enumType([ "ethereum", "base", "gnosis" ]),
|
|
16659
16581
|
page: numberType()["int"]().nonnegative()["default"](1),
|
|
16660
|
-
limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT
|
|
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)
|
|
16661
16585
|
});
|
|
16662
16586
|
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();
|
|
16663
16600
|
var priceSchema = objectType({
|
|
16664
16601
|
category: literalType("price"),
|
|
16665
16602
|
param1: stringType().nonempty(),
|
|
@@ -16669,13 +16606,13 @@ function _typeof(o) {
|
|
|
16669
16606
|
var marketSchema = objectType({
|
|
16670
16607
|
category: literalType("market"),
|
|
16671
16608
|
param1: enumType(marketEcosystems),
|
|
16672
|
-
param2:
|
|
16609
|
+
param2: param2Schema
|
|
16673
16610
|
});
|
|
16674
16611
|
var stablecoinsTypes = [ "all", "yield-bearing-stablecoins", "crypto-backed-stablecoin" ];
|
|
16675
16612
|
var stablecoinsSchema = objectType({
|
|
16676
16613
|
category: literalType("stablecoins"),
|
|
16677
16614
|
param1: enumType(stablecoinsTypes),
|
|
16678
|
-
param2:
|
|
16615
|
+
param2: param2Schema
|
|
16679
16616
|
});
|
|
16680
16617
|
var derivativesSchema = objectType({
|
|
16681
16618
|
category: literalType("derivatives"),
|
|
@@ -16694,7 +16631,9 @@ function _typeof(o) {
|
|
|
16694
16631
|
startTime: dateOrTimestamp.optional(),
|
|
16695
16632
|
endTime: dateOrTimestamp.optional(),
|
|
16696
16633
|
page: numberType()["int"]().nonnegative()["default"](1),
|
|
16697
|
-
offset: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT
|
|
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)
|
|
16698
16637
|
});
|
|
16699
16638
|
var eoaParamsSchema = preprocessType((function(val) {
|
|
16700
16639
|
var obj = _objectSpread({}, val || {});
|
|
@@ -16716,7 +16655,9 @@ function _typeof(o) {
|
|
|
16716
16655
|
address: stringType().nonempty(),
|
|
16717
16656
|
utility: literalType("txns"),
|
|
16718
16657
|
chain: enumType([ "ethereum", "gnosis" ]),
|
|
16719
|
-
limit: numberType()["int"]().nonnegative().max(MAX_PAGE_LIMIT
|
|
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),
|
|
16720
16661
|
offset: numberType()["int"]().nonnegative()["default"](0)
|
|
16721
16662
|
});
|
|
16722
16663
|
var categories = [ "protocols", "yields", "dex", "fees" ];
|
|
@@ -16746,7 +16687,7 @@ function _typeof(o) {
|
|
|
16746
16687
|
}
|
|
16747
16688
|
function _FIREFLY() {
|
|
16748
16689
|
_FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11() {
|
|
16749
|
-
var _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, apiKey, url,
|
|
16690
|
+
var _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, apiKey, url, response, _yield$response$json, _data, _args11 = arguments;
|
|
16750
16691
|
return _regeneratorRuntime().wrap((function _callee11$(_context11) {
|
|
16751
16692
|
while (1) switch (_context11.prev = _context11.next) {
|
|
16752
16693
|
case 0:
|
|
@@ -16777,39 +16718,35 @@ function _typeof(o) {
|
|
|
16777
16718
|
url.searchParams.set("type", fireFlyPlaformType[platform][contentType]);
|
|
16778
16719
|
url.searchParams.set("start", String(start));
|
|
16779
16720
|
url.searchParams.set("end", String(end));
|
|
16780
|
-
|
|
16781
|
-
|
|
16782
|
-
|
|
16783
|
-
|
|
16784
|
-
|
|
16785
|
-
_context11.next = 14;
|
|
16786
|
-
return fetch(finalUrl, {
|
|
16787
|
-
method: "GET",
|
|
16788
|
-
headers: HEADERS
|
|
16721
|
+
_context11.next = 13;
|
|
16722
|
+
return fetch(url.toString(), {
|
|
16723
|
+
headers: {
|
|
16724
|
+
"x-api-key": apiKey
|
|
16725
|
+
}
|
|
16789
16726
|
});
|
|
16790
16727
|
|
|
16791
|
-
case
|
|
16728
|
+
case 13:
|
|
16792
16729
|
response = _context11.sent;
|
|
16793
16730
|
if (response.ok) {
|
|
16794
|
-
_context11.next =
|
|
16731
|
+
_context11.next = 16;
|
|
16795
16732
|
break;
|
|
16796
16733
|
}
|
|
16797
16734
|
throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
|
|
16798
16735
|
|
|
16799
|
-
case
|
|
16800
|
-
_context11.next =
|
|
16736
|
+
case 16:
|
|
16737
|
+
_context11.next = 18;
|
|
16801
16738
|
return response.json();
|
|
16802
16739
|
|
|
16803
|
-
case
|
|
16740
|
+
case 18:
|
|
16804
16741
|
_yield$response$json = _context11.sent;
|
|
16805
16742
|
_data = _yield$response$json.data;
|
|
16806
16743
|
if (Array.isArray(_data)) {
|
|
16807
|
-
_context11.next =
|
|
16744
|
+
_context11.next = 22;
|
|
16808
16745
|
break;
|
|
16809
16746
|
}
|
|
16810
16747
|
return _context11.abrupt("return", []);
|
|
16811
16748
|
|
|
16812
|
-
case
|
|
16749
|
+
case 22:
|
|
16813
16750
|
return _context11.abrupt("return", _data.map((function(item) {
|
|
16814
16751
|
var flat = {};
|
|
16815
16752
|
for (var _i10 = 0, _Object$entries = Object.entries(item); _i10 < _Object$entries.length; _i10++) {
|
|
@@ -16822,16 +16759,16 @@ function _typeof(o) {
|
|
|
16822
16759
|
return flat;
|
|
16823
16760
|
})));
|
|
16824
16761
|
|
|
16825
|
-
case
|
|
16826
|
-
_context11.prev =
|
|
16762
|
+
case 25:
|
|
16763
|
+
_context11.prev = 25;
|
|
16827
16764
|
_context11.t0 = _context11["catch"](0);
|
|
16828
16765
|
return _context11.abrupt("return", errorMessageHandler(_context11.t0, "FIREFLY"));
|
|
16829
16766
|
|
|
16830
|
-
case
|
|
16767
|
+
case 28:
|
|
16831
16768
|
case "end":
|
|
16832
16769
|
return _context11.stop();
|
|
16833
16770
|
}
|
|
16834
|
-
}), _callee11, null, [ [ 0,
|
|
16771
|
+
}), _callee11, null, [ [ 0, 25 ] ]);
|
|
16835
16772
|
})));
|
|
16836
16773
|
return _FIREFLY.apply(this, arguments);
|
|
16837
16774
|
}
|
|
@@ -16840,7 +16777,7 @@ function _typeof(o) {
|
|
|
16840
16777
|
}
|
|
16841
16778
|
function _LENS() {
|
|
16842
16779
|
_LENS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12() {
|
|
16843
|
-
var _argsToArray5, _argsToArray6, contentType, identifier, _argsToArray6$, start, _argsToArray6$2, end, apiKey, url, typeMap,
|
|
16780
|
+
var _argsToArray5, _argsToArray6, contentType, identifier, _argsToArray6$, start, _argsToArray6$2, end, apiKey, url, typeMap, response, _yield$response$json2, _data2, _args12 = arguments;
|
|
16844
16781
|
return _regeneratorRuntime().wrap((function _callee12$(_context12) {
|
|
16845
16782
|
while (1) switch (_context12.prev = _context12.next) {
|
|
16846
16783
|
case 0:
|
|
@@ -16874,39 +16811,35 @@ function _typeof(o) {
|
|
|
16874
16811
|
url.searchParams.set("type", typeMap[contentType]);
|
|
16875
16812
|
url.searchParams.set("start", String(start));
|
|
16876
16813
|
url.searchParams.set("end", String(end));
|
|
16877
|
-
|
|
16878
|
-
|
|
16879
|
-
|
|
16880
|
-
|
|
16881
|
-
|
|
16882
|
-
_context12.next = 15;
|
|
16883
|
-
return fetch(finalUrl, {
|
|
16884
|
-
method: "GET",
|
|
16885
|
-
headers: HEADERS
|
|
16814
|
+
_context12.next = 14;
|
|
16815
|
+
return fetch(url.toString(), {
|
|
16816
|
+
headers: {
|
|
16817
|
+
"x-api-key": apiKey
|
|
16818
|
+
}
|
|
16886
16819
|
});
|
|
16887
16820
|
|
|
16888
|
-
case
|
|
16821
|
+
case 14:
|
|
16889
16822
|
response = _context12.sent;
|
|
16890
16823
|
if (response.ok) {
|
|
16891
|
-
_context12.next =
|
|
16824
|
+
_context12.next = 17;
|
|
16892
16825
|
break;
|
|
16893
16826
|
}
|
|
16894
16827
|
throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
|
|
16895
16828
|
|
|
16896
|
-
case
|
|
16897
|
-
_context12.next =
|
|
16829
|
+
case 17:
|
|
16830
|
+
_context12.next = 19;
|
|
16898
16831
|
return response.json();
|
|
16899
16832
|
|
|
16900
|
-
case
|
|
16833
|
+
case 19:
|
|
16901
16834
|
_yield$response$json2 = _context12.sent;
|
|
16902
16835
|
_data2 = _yield$response$json2.data;
|
|
16903
16836
|
if (Array.isArray(_data2)) {
|
|
16904
|
-
_context12.next =
|
|
16837
|
+
_context12.next = 23;
|
|
16905
16838
|
break;
|
|
16906
16839
|
}
|
|
16907
16840
|
return _context12.abrupt("return", []);
|
|
16908
16841
|
|
|
16909
|
-
case
|
|
16842
|
+
case 23:
|
|
16910
16843
|
return _context12.abrupt("return", _data2.map((function(item) {
|
|
16911
16844
|
var flat = {};
|
|
16912
16845
|
for (var _i11 = 0, _Object$entries2 = Object.entries(item); _i11 < _Object$entries2.length; _i11++) {
|
|
@@ -16919,16 +16852,16 @@ function _typeof(o) {
|
|
|
16919
16852
|
return flat;
|
|
16920
16853
|
})));
|
|
16921
16854
|
|
|
16922
|
-
case
|
|
16923
|
-
_context12.prev =
|
|
16855
|
+
case 26:
|
|
16856
|
+
_context12.prev = 26;
|
|
16924
16857
|
_context12.t0 = _context12["catch"](0);
|
|
16925
16858
|
return _context12.abrupt("return", errorMessageHandler(_context12.t0, "LENS"));
|
|
16926
16859
|
|
|
16927
|
-
case
|
|
16860
|
+
case 29:
|
|
16928
16861
|
case "end":
|
|
16929
16862
|
return _context12.stop();
|
|
16930
16863
|
}
|
|
16931
|
-
}), _callee12, null, [ [ 0,
|
|
16864
|
+
}), _callee12, null, [ [ 0, 26 ] ]);
|
|
16932
16865
|
})));
|
|
16933
16866
|
return _LENS.apply(this, arguments);
|
|
16934
16867
|
}
|
|
@@ -16937,7 +16870,7 @@ function _typeof(o) {
|
|
|
16937
16870
|
}
|
|
16938
16871
|
function _FARCASTER() {
|
|
16939
16872
|
_FARCASTER = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
|
|
16940
|
-
var _argsToArray7, _argsToArray8, contentType, identifier, _argsToArray8$, start, _argsToArray8$2, end, apiKey, url, typeMap,
|
|
16873
|
+
var _argsToArray7, _argsToArray8, contentType, identifier, _argsToArray8$, start, _argsToArray8$2, end, apiKey, url, typeMap, response, _yield$response$json3, _data3, _args13 = arguments;
|
|
16941
16874
|
return _regeneratorRuntime().wrap((function _callee13$(_context13) {
|
|
16942
16875
|
while (1) switch (_context13.prev = _context13.next) {
|
|
16943
16876
|
case 0:
|
|
@@ -16972,39 +16905,35 @@ function _typeof(o) {
|
|
|
16972
16905
|
url.searchParams.set("type", typeMap[contentType]);
|
|
16973
16906
|
url.searchParams.set("start", String(start));
|
|
16974
16907
|
url.searchParams.set("end", String(end));
|
|
16975
|
-
|
|
16976
|
-
|
|
16977
|
-
|
|
16978
|
-
|
|
16979
|
-
|
|
16980
|
-
_context13.next = 15;
|
|
16981
|
-
return fetch(finalUrl, {
|
|
16982
|
-
method: "GET",
|
|
16983
|
-
headers: HEADERS
|
|
16908
|
+
_context13.next = 14;
|
|
16909
|
+
return fetch(url.toString(), {
|
|
16910
|
+
headers: {
|
|
16911
|
+
"x-api-key": apiKey
|
|
16912
|
+
}
|
|
16984
16913
|
});
|
|
16985
16914
|
|
|
16986
|
-
case
|
|
16915
|
+
case 14:
|
|
16987
16916
|
response = _context13.sent;
|
|
16988
16917
|
if (response.ok) {
|
|
16989
|
-
_context13.next =
|
|
16918
|
+
_context13.next = 17;
|
|
16990
16919
|
break;
|
|
16991
16920
|
}
|
|
16992
16921
|
throw new NetworkError(SERVICES_API_KEY.Firefly, response.status);
|
|
16993
16922
|
|
|
16994
|
-
case
|
|
16995
|
-
_context13.next =
|
|
16923
|
+
case 17:
|
|
16924
|
+
_context13.next = 19;
|
|
16996
16925
|
return response.json();
|
|
16997
16926
|
|
|
16998
|
-
case
|
|
16927
|
+
case 19:
|
|
16999
16928
|
_yield$response$json3 = _context13.sent;
|
|
17000
16929
|
_data3 = _yield$response$json3.data;
|
|
17001
16930
|
if (Array.isArray(_data3)) {
|
|
17002
|
-
_context13.next =
|
|
16931
|
+
_context13.next = 23;
|
|
17003
16932
|
break;
|
|
17004
16933
|
}
|
|
17005
16934
|
return _context13.abrupt("return", []);
|
|
17006
16935
|
|
|
17007
|
-
case
|
|
16936
|
+
case 23:
|
|
17008
16937
|
return _context13.abrupt("return", _data3.map((function(item) {
|
|
17009
16938
|
var flat = {};
|
|
17010
16939
|
for (var _i12 = 0, _Object$entries3 = Object.entries(item); _i12 < _Object$entries3.length; _i12++) {
|
|
@@ -17017,16 +16946,16 @@ function _typeof(o) {
|
|
|
17017
16946
|
return flat;
|
|
17018
16947
|
})));
|
|
17019
16948
|
|
|
17020
|
-
case
|
|
17021
|
-
_context13.prev =
|
|
16949
|
+
case 26:
|
|
16950
|
+
_context13.prev = 26;
|
|
17022
16951
|
_context13.t0 = _context13["catch"](0);
|
|
17023
16952
|
return _context13.abrupt("return", errorMessageHandler(_context13.t0, "FARCASTER"));
|
|
17024
16953
|
|
|
17025
|
-
case
|
|
16954
|
+
case 29:
|
|
17026
16955
|
case "end":
|
|
17027
16956
|
return _context13.stop();
|
|
17028
16957
|
}
|
|
17029
|
-
}), _callee13, null, [ [ 0,
|
|
16958
|
+
}), _callee13, null, [ [ 0, 26 ] ]);
|
|
17030
16959
|
})));
|
|
17031
16960
|
return _FARCASTER.apply(this, arguments);
|
|
17032
16961
|
}
|
|
@@ -17142,7 +17071,7 @@ function _typeof(o) {
|
|
|
17142
17071
|
}
|
|
17143
17072
|
function _BASE() {
|
|
17144
17073
|
_BASE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15() {
|
|
17145
|
-
var _argsToArray1, _argsToArray10, type, address, startDate, endDate, page, limit,
|
|
17074
|
+
var _argsToArray1, _argsToArray10, type, address, startDate, endDate, page, limit, API_KEY, _args15 = arguments;
|
|
17146
17075
|
return _regeneratorRuntime().wrap((function _callee15$(_context15) {
|
|
17147
17076
|
while (1) switch (_context15.prev = _context15.next) {
|
|
17148
17077
|
case 0:
|
|
@@ -17158,8 +17087,8 @@ function _typeof(o) {
|
|
|
17158
17087
|
page: page,
|
|
17159
17088
|
limit: limit
|
|
17160
17089
|
});
|
|
17161
|
-
|
|
17162
|
-
if (
|
|
17090
|
+
API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Basescan);
|
|
17091
|
+
if (API_KEY) {
|
|
17163
17092
|
_context15.next = 6;
|
|
17164
17093
|
break;
|
|
17165
17094
|
}
|
|
@@ -17174,7 +17103,7 @@ function _typeof(o) {
|
|
|
17174
17103
|
endDate: endDate,
|
|
17175
17104
|
page: page,
|
|
17176
17105
|
offset: limit,
|
|
17177
|
-
apiKey:
|
|
17106
|
+
apiKey: API_KEY,
|
|
17178
17107
|
functionName: "BASE",
|
|
17179
17108
|
chainId: CHAIN_ID_MAP.base,
|
|
17180
17109
|
network: "base"
|
|
@@ -17261,7 +17190,7 @@ function _typeof(o) {
|
|
|
17261
17190
|
}
|
|
17262
17191
|
function _NEYNAR() {
|
|
17263
17192
|
_NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
|
|
17264
|
-
var neynarParamsSchema, _argsToArray13, _argsToArray14, username, apiKey, fid, url,
|
|
17193
|
+
var neynarParamsSchema, _argsToArray13, _argsToArray14, username, apiKey, fid, url, response, json, users, _args17 = arguments;
|
|
17265
17194
|
return _regeneratorRuntime().wrap((function _callee17$(_context17) {
|
|
17266
17195
|
while (1) switch (_context17.prev = _context17.next) {
|
|
17267
17196
|
case 0:
|
|
@@ -17295,47 +17224,39 @@ function _typeof(o) {
|
|
|
17295
17224
|
|
|
17296
17225
|
case 12:
|
|
17297
17226
|
url = "https://api.neynar.com/v2/farcaster/followers?fid=".concat(fid);
|
|
17298
|
-
|
|
17299
|
-
|
|
17300
|
-
serviceName: "Firefly",
|
|
17227
|
+
_context17.next = 15;
|
|
17228
|
+
return fetch(url, {
|
|
17301
17229
|
headers: {
|
|
17302
|
-
|
|
17303
|
-
|
|
17304
|
-
"x-neynar-experimental": "false"
|
|
17305
|
-
}
|
|
17230
|
+
"x-api-key": apiKey,
|
|
17231
|
+
"x-neynar-experimental": "false"
|
|
17306
17232
|
}
|
|
17307
|
-
}), finalUrl = _getUrlAndHeaders7.URL, HEADERS = _getUrlAndHeaders7.HEADERS;
|
|
17308
|
-
_context17.next = 16;
|
|
17309
|
-
return fetch(finalUrl, {
|
|
17310
|
-
method: "GET",
|
|
17311
|
-
headers: HEADERS
|
|
17312
17233
|
});
|
|
17313
17234
|
|
|
17314
|
-
case
|
|
17235
|
+
case 15:
|
|
17315
17236
|
response = _context17.sent;
|
|
17316
17237
|
if (response.ok) {
|
|
17317
|
-
_context17.next =
|
|
17238
|
+
_context17.next = 18;
|
|
17318
17239
|
break;
|
|
17319
17240
|
}
|
|
17320
17241
|
throw new NetworkError(SERVICES_API_KEY.Neynar, response.status);
|
|
17321
17242
|
|
|
17322
|
-
case
|
|
17323
|
-
_context17.next =
|
|
17243
|
+
case 18:
|
|
17244
|
+
_context17.next = 20;
|
|
17324
17245
|
return response.json();
|
|
17325
17246
|
|
|
17326
|
-
case
|
|
17247
|
+
case 20:
|
|
17327
17248
|
json = _context17.sent;
|
|
17328
17249
|
users = (json === null || json === void 0 ? void 0 : json.users) || [];
|
|
17329
17250
|
if (users.length) {
|
|
17330
|
-
_context17.next =
|
|
17251
|
+
_context17.next = 24;
|
|
17331
17252
|
break;
|
|
17332
17253
|
}
|
|
17333
17254
|
return _context17.abrupt("return", []);
|
|
17334
17255
|
|
|
17335
|
-
case
|
|
17336
|
-
return _context17.abrupt("return", users.map((function(
|
|
17256
|
+
case 24:
|
|
17257
|
+
return _context17.abrupt("return", users.map((function(_ref13) {
|
|
17337
17258
|
var _user$profile, _user$profile2;
|
|
17338
|
-
var user =
|
|
17259
|
+
var user = _ref13.user;
|
|
17339
17260
|
return {
|
|
17340
17261
|
username: user.username,
|
|
17341
17262
|
custody_address: user.custody_address,
|
|
@@ -17345,16 +17266,16 @@ function _typeof(o) {
|
|
|
17345
17266
|
};
|
|
17346
17267
|
})));
|
|
17347
17268
|
|
|
17348
|
-
case
|
|
17349
|
-
_context17.prev =
|
|
17269
|
+
case 27:
|
|
17270
|
+
_context17.prev = 27;
|
|
17350
17271
|
_context17.t0 = _context17["catch"](0);
|
|
17351
17272
|
return _context17.abrupt("return", errorMessageHandler(_context17.t0, "NEYNAR"));
|
|
17352
17273
|
|
|
17353
|
-
case
|
|
17274
|
+
case 30:
|
|
17354
17275
|
case "end":
|
|
17355
17276
|
return _context17.stop();
|
|
17356
17277
|
}
|
|
17357
|
-
}), _callee17, null, [ [ 0,
|
|
17278
|
+
}), _callee17, null, [ [ 0, 27 ] ]);
|
|
17358
17279
|
})));
|
|
17359
17280
|
return _NEYNAR.apply(this, arguments);
|
|
17360
17281
|
}
|
|
@@ -17433,7 +17354,7 @@ function _typeof(o) {
|
|
|
17433
17354
|
}
|
|
17434
17355
|
function _COINGECKO() {
|
|
17435
17356
|
_COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee19() {
|
|
17436
|
-
var _category$toLowerCase, _argsToArray17, _argsToArray18, category, param1, param2, apiKey,
|
|
17357
|
+
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;
|
|
17437
17358
|
return _regeneratorRuntime().wrap((function _callee19$(_context19) {
|
|
17438
17359
|
while (1) switch (_context19.prev = _context19.next) {
|
|
17439
17360
|
case 0:
|
|
@@ -17453,7 +17374,7 @@ function _typeof(o) {
|
|
|
17453
17374
|
throw new MissingApiKeyError(SERVICES_API_KEY.Coingecko);
|
|
17454
17375
|
|
|
17455
17376
|
case 6:
|
|
17456
|
-
|
|
17377
|
+
headers = {
|
|
17457
17378
|
accept: "application/json",
|
|
17458
17379
|
"x-cg-demo-api-key": apiKey
|
|
17459
17380
|
};
|
|
@@ -17497,7 +17418,7 @@ function _typeof(o) {
|
|
|
17497
17418
|
case 25:
|
|
17498
17419
|
_context19.next = 27;
|
|
17499
17420
|
return fetch(url, {
|
|
17500
|
-
headers:
|
|
17421
|
+
headers: headers
|
|
17501
17422
|
});
|
|
17502
17423
|
|
|
17503
17424
|
case 27:
|
|
@@ -17573,68 +17494,58 @@ function _typeof(o) {
|
|
|
17573
17494
|
return _regeneratorRuntime().wrap((function _callee21$(_context24) {
|
|
17574
17495
|
while (1) switch (_context24.prev = _context24.next) {
|
|
17575
17496
|
case 0:
|
|
17576
|
-
|
|
17577
|
-
_context24.prev = 1;
|
|
17497
|
+
_context24.prev = 0;
|
|
17578
17498
|
fetchJSON = function() {
|
|
17579
|
-
var
|
|
17580
|
-
var
|
|
17499
|
+
var _ref14 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee20(url) {
|
|
17500
|
+
var res, json;
|
|
17581
17501
|
return _regeneratorRuntime().wrap((function _callee20$(_context20) {
|
|
17582
17502
|
while (1) switch (_context20.prev = _context20.next) {
|
|
17583
17503
|
case 0:
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
serviceName: "Etherscan",
|
|
17587
|
-
headers: {}
|
|
17588
|
-
}), finalUrl = _getUrlAndHeaders8.URL, HEADERS = _getUrlAndHeaders8.HEADERS;
|
|
17589
|
-
console.log("finalUrl", finalUrl, HEADERS);
|
|
17590
|
-
_context20.next = 4;
|
|
17591
|
-
return fetch(finalUrl, {
|
|
17592
|
-
method: "GET",
|
|
17593
|
-
headers: HEADERS
|
|
17594
|
-
});
|
|
17504
|
+
_context20.next = 2;
|
|
17505
|
+
return fetch(url);
|
|
17595
17506
|
|
|
17596
|
-
case
|
|
17507
|
+
case 2:
|
|
17597
17508
|
res = _context20.sent;
|
|
17598
17509
|
if (res.ok) {
|
|
17599
|
-
_context20.next =
|
|
17510
|
+
_context20.next = 5;
|
|
17600
17511
|
break;
|
|
17601
17512
|
}
|
|
17602
17513
|
throw new NetworkError(SERVICES_API_KEY.Etherscan, res.status);
|
|
17603
17514
|
|
|
17604
|
-
case
|
|
17605
|
-
_context20.next =
|
|
17515
|
+
case 5:
|
|
17516
|
+
_context20.next = 7;
|
|
17606
17517
|
return res.json();
|
|
17607
17518
|
|
|
17608
|
-
case
|
|
17519
|
+
case 7:
|
|
17609
17520
|
json = _context20.sent;
|
|
17610
17521
|
if (!(typeof json.result === "string")) {
|
|
17611
|
-
_context20.next =
|
|
17522
|
+
_context20.next = 13;
|
|
17612
17523
|
break;
|
|
17613
17524
|
}
|
|
17614
17525
|
if (!json.result.includes("Invalid API Key")) {
|
|
17615
|
-
_context20.next =
|
|
17526
|
+
_context20.next = 11;
|
|
17616
17527
|
break;
|
|
17617
17528
|
}
|
|
17618
17529
|
throw new InvalidApiKeyError(SERVICES_API_KEY.Etherscan);
|
|
17619
17530
|
|
|
17620
|
-
case
|
|
17531
|
+
case 11:
|
|
17621
17532
|
if (!json.result.includes("Max rate limit reached")) {
|
|
17622
|
-
_context20.next =
|
|
17533
|
+
_context20.next = 13;
|
|
17623
17534
|
break;
|
|
17624
17535
|
}
|
|
17625
17536
|
throw new RateLimitError(SERVICES_API_KEY.Etherscan);
|
|
17626
17537
|
|
|
17627
|
-
case
|
|
17538
|
+
case 13:
|
|
17628
17539
|
return _context20.abrupt("return", json.result);
|
|
17629
17540
|
|
|
17630
|
-
case
|
|
17541
|
+
case 14:
|
|
17631
17542
|
case "end":
|
|
17632
17543
|
return _context20.stop();
|
|
17633
17544
|
}
|
|
17634
17545
|
}), _callee20);
|
|
17635
17546
|
})));
|
|
17636
17547
|
return function fetchJSON(_x17) {
|
|
17637
|
-
return
|
|
17548
|
+
return _ref14.apply(this, arguments);
|
|
17638
17549
|
};
|
|
17639
17550
|
}();
|
|
17640
17551
|
_argsToArray19 = argsToArray(_args24), _argsToArray20 = _slicedToArray(_argsToArray19, 7),
|
|
@@ -17652,14 +17563,13 @@ function _typeof(o) {
|
|
|
17652
17563
|
offset: offset
|
|
17653
17564
|
});
|
|
17654
17565
|
apiKey = window.localStorage.getItem(SERVICES_API_KEY.Etherscan);
|
|
17655
|
-
console.log("apiKey", apiKey);
|
|
17656
17566
|
if (apiKey) {
|
|
17657
|
-
_context24.next =
|
|
17567
|
+
_context24.next = 7;
|
|
17658
17568
|
break;
|
|
17659
17569
|
}
|
|
17660
17570
|
throw new MissingApiKeyError(SERVICES_API_KEY.Etherscan);
|
|
17661
17571
|
|
|
17662
|
-
case
|
|
17572
|
+
case 7:
|
|
17663
17573
|
INPUTS = addresses.split(",").map((function(s) {
|
|
17664
17574
|
return s.trim();
|
|
17665
17575
|
})).filter(Boolean);
|
|
@@ -17668,84 +17578,80 @@ function _typeof(o) {
|
|
|
17668
17578
|
})).filter(Boolean);
|
|
17669
17579
|
ADDRESS_MAP = {};
|
|
17670
17580
|
_iterator41 = _createForOfIteratorHelper(INPUTS);
|
|
17671
|
-
_context24.prev =
|
|
17581
|
+
_context24.prev = 11;
|
|
17672
17582
|
_iterator41.s();
|
|
17673
17583
|
|
|
17674
|
-
case
|
|
17584
|
+
case 13:
|
|
17675
17585
|
if ((_step41 = _iterator41.n()).done) {
|
|
17676
|
-
_context24.next =
|
|
17586
|
+
_context24.next = 28;
|
|
17677
17587
|
break;
|
|
17678
17588
|
}
|
|
17679
17589
|
inp = _step41.value;
|
|
17680
17590
|
if (!isAddress$1.isAddress(inp)) {
|
|
17681
|
-
_context24.next =
|
|
17591
|
+
_context24.next = 19;
|
|
17682
17592
|
break;
|
|
17683
17593
|
}
|
|
17684
17594
|
ADDRESS_MAP[inp.toLowerCase()] = null;
|
|
17685
|
-
_context24.next =
|
|
17595
|
+
_context24.next = 26;
|
|
17686
17596
|
break;
|
|
17687
17597
|
|
|
17688
|
-
case
|
|
17598
|
+
case 19:
|
|
17689
17599
|
ens = inp;
|
|
17690
|
-
_context24.next =
|
|
17600
|
+
_context24.next = 22;
|
|
17691
17601
|
return fromEnsNameToAddress$1.fromEnsNameToAddress(ens);
|
|
17692
17602
|
|
|
17693
|
-
case
|
|
17603
|
+
case 22:
|
|
17694
17604
|
resolved = _context24.sent;
|
|
17695
17605
|
if (resolved) {
|
|
17696
|
-
_context24.next =
|
|
17606
|
+
_context24.next = 25;
|
|
17697
17607
|
break;
|
|
17698
17608
|
}
|
|
17699
17609
|
throw new EnsError(ens);
|
|
17700
17610
|
|
|
17701
|
-
case
|
|
17611
|
+
case 25:
|
|
17702
17612
|
ADDRESS_MAP[resolved.toLowerCase()] = ens;
|
|
17703
17613
|
|
|
17704
|
-
case
|
|
17705
|
-
_context24.next =
|
|
17614
|
+
case 26:
|
|
17615
|
+
_context24.next = 13;
|
|
17706
17616
|
break;
|
|
17707
17617
|
|
|
17708
|
-
case
|
|
17709
|
-
_context24.next =
|
|
17618
|
+
case 28:
|
|
17619
|
+
_context24.next = 33;
|
|
17710
17620
|
break;
|
|
17711
17621
|
|
|
17712
|
-
case
|
|
17713
|
-
_context24.prev =
|
|
17714
|
-
_context24.t0 = _context24["catch"](
|
|
17622
|
+
case 30:
|
|
17623
|
+
_context24.prev = 30;
|
|
17624
|
+
_context24.t0 = _context24["catch"](11);
|
|
17715
17625
|
_iterator41.e(_context24.t0);
|
|
17716
17626
|
|
|
17717
|
-
case
|
|
17718
|
-
_context24.prev =
|
|
17627
|
+
case 33:
|
|
17628
|
+
_context24.prev = 33;
|
|
17719
17629
|
_iterator41.f();
|
|
17720
|
-
return _context24.finish(
|
|
17630
|
+
return _context24.finish(33);
|
|
17721
17631
|
|
|
17722
|
-
case
|
|
17632
|
+
case 36:
|
|
17723
17633
|
ADDRS = Object.keys(ADDRESS_MAP);
|
|
17724
|
-
console.log("ADDRS", ADDRS);
|
|
17725
17634
|
out = [];
|
|
17726
17635
|
_iterator42 = _createForOfIteratorHelper(CHAINS);
|
|
17727
|
-
_context24.prev =
|
|
17636
|
+
_context24.prev = 39;
|
|
17728
17637
|
_loop = _regeneratorRuntime().mark((function _loop() {
|
|
17729
17638
|
var chain, chainId, _loop2, _ret2, i, sb, eb, _loop3, _ret3, _i16, _ADDRS;
|
|
17730
17639
|
return _regeneratorRuntime().wrap((function _loop$(_context23) {
|
|
17731
17640
|
while (1) switch (_context23.prev = _context23.next) {
|
|
17732
17641
|
case 0:
|
|
17733
17642
|
chain = _step42.value;
|
|
17734
|
-
console.log("chain", chain);
|
|
17735
17643
|
chainId = CHAIN_ID_MAP[chain];
|
|
17736
17644
|
if (chainId) {
|
|
17737
|
-
_context23.next =
|
|
17645
|
+
_context23.next = 4;
|
|
17738
17646
|
break;
|
|
17739
17647
|
}
|
|
17740
17648
|
throw new ValidationError("Invalid chain: ".concat(chain));
|
|
17741
17649
|
|
|
17742
|
-
case
|
|
17743
|
-
console.log("chain", chain);
|
|
17650
|
+
case 4:
|
|
17744
17651
|
if (!(category === "balance")) {
|
|
17745
|
-
_context23.next =
|
|
17652
|
+
_context23.next = 17;
|
|
17746
17653
|
break;
|
|
17747
17654
|
}
|
|
17748
|
-
console.log("balance");
|
|
17749
17655
|
_loop2 = _regeneratorRuntime().mark((function _loop2(i) {
|
|
17750
17656
|
var slice, url, data;
|
|
17751
17657
|
return _regeneratorRuntime().wrap((function _loop2$(_context21) {
|
|
@@ -17785,57 +17691,55 @@ function _typeof(o) {
|
|
|
17785
17691
|
}));
|
|
17786
17692
|
i = 0;
|
|
17787
17693
|
|
|
17788
|
-
case
|
|
17694
|
+
case 7:
|
|
17789
17695
|
if (!(i < ADDRS.length)) {
|
|
17790
|
-
_context23.next =
|
|
17696
|
+
_context23.next = 15;
|
|
17791
17697
|
break;
|
|
17792
17698
|
}
|
|
17793
|
-
return _context23.delegateYield(_loop2(i), "t0",
|
|
17699
|
+
return _context23.delegateYield(_loop2(i), "t0", 9);
|
|
17794
17700
|
|
|
17795
|
-
case
|
|
17701
|
+
case 9:
|
|
17796
17702
|
_ret2 = _context23.t0;
|
|
17797
17703
|
if (!_ret2) {
|
|
17798
|
-
_context23.next =
|
|
17704
|
+
_context23.next = 12;
|
|
17799
17705
|
break;
|
|
17800
17706
|
}
|
|
17801
17707
|
return _context23.abrupt("return", _ret2.v);
|
|
17802
17708
|
|
|
17803
|
-
case
|
|
17709
|
+
case 12:
|
|
17804
17710
|
i += 20;
|
|
17805
|
-
_context23.next =
|
|
17711
|
+
_context23.next = 7;
|
|
17806
17712
|
break;
|
|
17807
17713
|
|
|
17808
|
-
case
|
|
17809
|
-
_context23.next =
|
|
17714
|
+
case 15:
|
|
17715
|
+
_context23.next = 37;
|
|
17810
17716
|
break;
|
|
17811
17717
|
|
|
17812
|
-
case
|
|
17813
|
-
|
|
17814
|
-
_context23.next = 23;
|
|
17718
|
+
case 17:
|
|
17719
|
+
_context23.next = 19;
|
|
17815
17720
|
return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startTime), chain, apiKey);
|
|
17816
17721
|
|
|
17817
|
-
case
|
|
17722
|
+
case 19:
|
|
17818
17723
|
sb = _context23.sent;
|
|
17819
|
-
_context23.next =
|
|
17724
|
+
_context23.next = 22;
|
|
17820
17725
|
return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endTime), chain, apiKey);
|
|
17821
17726
|
|
|
17822
|
-
case
|
|
17727
|
+
case 22:
|
|
17823
17728
|
eb = _context23.sent;
|
|
17824
|
-
console.log("sb", sb, "eb", eb);
|
|
17825
17729
|
if (sb) {
|
|
17826
|
-
_context23.next =
|
|
17730
|
+
_context23.next = 25;
|
|
17827
17731
|
break;
|
|
17828
17732
|
}
|
|
17829
17733
|
throw new ValidationError("Invalid startTime: ".concat(startTime));
|
|
17830
17734
|
|
|
17831
|
-
case
|
|
17735
|
+
case 25:
|
|
17832
17736
|
if (eb) {
|
|
17833
|
-
_context23.next =
|
|
17737
|
+
_context23.next = 27;
|
|
17834
17738
|
break;
|
|
17835
17739
|
}
|
|
17836
17740
|
throw new ValidationError("Invalid endTime: ".concat(endTime));
|
|
17837
17741
|
|
|
17838
|
-
case
|
|
17742
|
+
case 27:
|
|
17839
17743
|
_loop3 = _regeneratorRuntime().mark((function _loop3() {
|
|
17840
17744
|
var addr, url, data;
|
|
17841
17745
|
return _regeneratorRuntime().wrap((function _loop3$(_context22) {
|
|
@@ -17875,27 +17779,27 @@ function _typeof(o) {
|
|
|
17875
17779
|
}));
|
|
17876
17780
|
_i16 = 0, _ADDRS = ADDRS;
|
|
17877
17781
|
|
|
17878
|
-
case
|
|
17782
|
+
case 29:
|
|
17879
17783
|
if (!(_i16 < _ADDRS.length)) {
|
|
17880
|
-
_context23.next =
|
|
17784
|
+
_context23.next = 37;
|
|
17881
17785
|
break;
|
|
17882
17786
|
}
|
|
17883
|
-
return _context23.delegateYield(_loop3(), "t1",
|
|
17787
|
+
return _context23.delegateYield(_loop3(), "t1", 31);
|
|
17884
17788
|
|
|
17885
|
-
case
|
|
17789
|
+
case 31:
|
|
17886
17790
|
_ret3 = _context23.t1;
|
|
17887
17791
|
if (!_ret3) {
|
|
17888
|
-
_context23.next =
|
|
17792
|
+
_context23.next = 34;
|
|
17889
17793
|
break;
|
|
17890
17794
|
}
|
|
17891
17795
|
return _context23.abrupt("return", _ret3.v);
|
|
17892
17796
|
|
|
17893
|
-
case
|
|
17797
|
+
case 34:
|
|
17894
17798
|
_i16++;
|
|
17895
|
-
_context23.next =
|
|
17799
|
+
_context23.next = 29;
|
|
17896
17800
|
break;
|
|
17897
17801
|
|
|
17898
|
-
case
|
|
17802
|
+
case 37:
|
|
17899
17803
|
case "end":
|
|
17900
17804
|
return _context23.stop();
|
|
17901
17805
|
}
|
|
@@ -17903,52 +17807,52 @@ function _typeof(o) {
|
|
|
17903
17807
|
}));
|
|
17904
17808
|
_iterator42.s();
|
|
17905
17809
|
|
|
17906
|
-
case
|
|
17810
|
+
case 42:
|
|
17907
17811
|
if ((_step42 = _iterator42.n()).done) {
|
|
17908
|
-
_context24.next =
|
|
17812
|
+
_context24.next = 49;
|
|
17909
17813
|
break;
|
|
17910
17814
|
}
|
|
17911
|
-
return _context24.delegateYield(_loop(), "t1",
|
|
17815
|
+
return _context24.delegateYield(_loop(), "t1", 44);
|
|
17912
17816
|
|
|
17913
|
-
case
|
|
17817
|
+
case 44:
|
|
17914
17818
|
_ret = _context24.t1;
|
|
17915
17819
|
if (!_ret) {
|
|
17916
|
-
_context24.next =
|
|
17820
|
+
_context24.next = 47;
|
|
17917
17821
|
break;
|
|
17918
17822
|
}
|
|
17919
17823
|
return _context24.abrupt("return", _ret.v);
|
|
17920
17824
|
|
|
17921
|
-
case
|
|
17922
|
-
_context24.next =
|
|
17825
|
+
case 47:
|
|
17826
|
+
_context24.next = 42;
|
|
17923
17827
|
break;
|
|
17924
17828
|
|
|
17925
|
-
case
|
|
17926
|
-
_context24.next =
|
|
17829
|
+
case 49:
|
|
17830
|
+
_context24.next = 54;
|
|
17927
17831
|
break;
|
|
17928
17832
|
|
|
17929
|
-
case
|
|
17930
|
-
_context24.prev =
|
|
17931
|
-
_context24.t2 = _context24["catch"](
|
|
17833
|
+
case 51:
|
|
17834
|
+
_context24.prev = 51;
|
|
17835
|
+
_context24.t2 = _context24["catch"](39);
|
|
17932
17836
|
_iterator42.e(_context24.t2);
|
|
17933
17837
|
|
|
17934
|
-
case
|
|
17935
|
-
_context24.prev =
|
|
17838
|
+
case 54:
|
|
17839
|
+
_context24.prev = 54;
|
|
17936
17840
|
_iterator42.f();
|
|
17937
|
-
return _context24.finish(
|
|
17841
|
+
return _context24.finish(54);
|
|
17938
17842
|
|
|
17939
|
-
case
|
|
17843
|
+
case 57:
|
|
17940
17844
|
return _context24.abrupt("return", out);
|
|
17941
17845
|
|
|
17942
|
-
case
|
|
17943
|
-
_context24.prev =
|
|
17944
|
-
_context24.t3 = _context24["catch"](
|
|
17846
|
+
case 60:
|
|
17847
|
+
_context24.prev = 60;
|
|
17848
|
+
_context24.t3 = _context24["catch"](0);
|
|
17945
17849
|
return _context24.abrupt("return", errorMessageHandler(_context24.t3, "EOA"));
|
|
17946
17850
|
|
|
17947
|
-
case
|
|
17851
|
+
case 63:
|
|
17948
17852
|
case "end":
|
|
17949
17853
|
return _context24.stop();
|
|
17950
17854
|
}
|
|
17951
|
-
}), _callee21, null, [ [
|
|
17855
|
+
}), _callee21, null, [ [ 0, 60 ], [ 11, 30, 33, 36 ], [ 39, 51, 54, 57 ] ]);
|
|
17952
17856
|
})));
|
|
17953
17857
|
return _EOA.apply(this, arguments);
|
|
17954
17858
|
}
|
|
@@ -18060,8 +17964,8 @@ function _typeof(o) {
|
|
|
18060
17964
|
throw new ValidationError("Invalid API response");
|
|
18061
17965
|
|
|
18062
17966
|
case 28:
|
|
18063
|
-
return _context26.abrupt("return", json.results.map((function(
|
|
18064
|
-
var confirmations =
|
|
17967
|
+
return _context26.abrupt("return", json.results.map((function(_ref15) {
|
|
17968
|
+
var confirmations = _ref15.confirmations, dataDecoded = _ref15.dataDecoded, rest = _objectWithoutProperties(_ref15, _excluded);
|
|
18065
17969
|
return rest;
|
|
18066
17970
|
})));
|
|
18067
17971
|
|
|
@@ -18209,8 +18113,8 @@ function _typeof(o) {
|
|
|
18209
18113
|
}
|
|
18210
18114
|
return _context28.abrupt("return", json.map((function(item) {
|
|
18211
18115
|
var flat = {};
|
|
18212
|
-
Object.entries(item).forEach((function(
|
|
18213
|
-
var
|
|
18116
|
+
Object.entries(item).forEach((function(_ref16) {
|
|
18117
|
+
var _ref17 = _slicedToArray(_ref16, 2), k = _ref17[0], v = _ref17[1];
|
|
18214
18118
|
if (v === null || _typeof(v) !== "object") flat[k] = v;
|
|
18215
18119
|
}));
|
|
18216
18120
|
return flat;
|
|
@@ -18276,8 +18180,8 @@ function _typeof(o) {
|
|
|
18276
18180
|
}
|
|
18277
18181
|
return _context29.abrupt("return", json.map((function(item) {
|
|
18278
18182
|
var flat = {};
|
|
18279
|
-
Object.entries(item).forEach((function(
|
|
18280
|
-
var
|
|
18183
|
+
Object.entries(item).forEach((function(_ref18) {
|
|
18184
|
+
var _ref19 = _slicedToArray(_ref18, 2), k = _ref19[0], v = _ref19[1];
|
|
18281
18185
|
if (v === null || _typeof(v) !== "object") flat[k] = v;
|
|
18282
18186
|
}));
|
|
18283
18187
|
return flat;
|