@fileverse-dev/formulajs 4.4.11-mod-68-patch-4 → 4.4.11-mod-68-patch-5
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 +40 -35
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +6 -0
- package/lib/esm/index.mjs +6 -0
- package/package.json +1 -1
package/lib/browser/formula.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @fileverse-dev/formulajs v4.4.11-mod-68-patch-
|
|
1
|
+
/* @fileverse-dev/formulajs v4.4.11-mod-68-patch-5 */
|
|
2
2
|
var _excluded = [ "confirmations", "dataDecoded" ];
|
|
3
3
|
|
|
4
4
|
function _objectWithoutProperties(e, t) {
|
|
@@ -11150,13 +11150,14 @@ function _typeof(o) {
|
|
|
11150
11150
|
return _regeneratorRuntime().wrap((function _callee$(_context) {
|
|
11151
11151
|
while (1) switch (_context.prev = _context.next) {
|
|
11152
11152
|
case 0:
|
|
11153
|
+
console.log("fromTimeStampToBlock", timestamp, chain, apiKey);
|
|
11153
11154
|
if (!(!timestamp || !chain || !apiKey)) {
|
|
11154
|
-
_context.next =
|
|
11155
|
+
_context.next = 3;
|
|
11155
11156
|
break;
|
|
11156
11157
|
}
|
|
11157
11158
|
return _context.abrupt("return");
|
|
11158
11159
|
|
|
11159
|
-
case
|
|
11160
|
+
case 3:
|
|
11160
11161
|
chainId = CHAIN_ID_MAP[chain];
|
|
11161
11162
|
url = "https://api.etherscan.io/v2/api?module=block&action=getblocknobytime×tamp=".concat(timestamp, "&closest=before&apikey=").concat(apiKey, "&chainId=").concat(chainId);
|
|
11162
11163
|
_getUrlAndHeaders = getUrlAndHeaders({
|
|
@@ -11164,22 +11165,23 @@ function _typeof(o) {
|
|
|
11164
11165
|
serviceName: "Etherscan",
|
|
11165
11166
|
headers: {}
|
|
11166
11167
|
}), finalUrl = _getUrlAndHeaders.URL, HEADERS = _getUrlAndHeaders.HEADERS;
|
|
11167
|
-
_context.next =
|
|
11168
|
+
_context.next = 8;
|
|
11168
11169
|
return fetch(finalUrl, {
|
|
11169
11170
|
method: "GET",
|
|
11170
11171
|
headers: HEADERS
|
|
11171
11172
|
});
|
|
11172
11173
|
|
|
11173
|
-
case
|
|
11174
|
+
case 8:
|
|
11174
11175
|
res = _context.sent;
|
|
11175
|
-
|
|
11176
|
+
console.log("res", res, finalUrl, HEADERS);
|
|
11177
|
+
_context.next = 12;
|
|
11176
11178
|
return res.json();
|
|
11177
11179
|
|
|
11178
|
-
case
|
|
11180
|
+
case 12:
|
|
11179
11181
|
json = _context.sent;
|
|
11180
11182
|
return _context.abrupt("return", parseInt(json.result));
|
|
11181
11183
|
|
|
11182
|
-
case
|
|
11184
|
+
case 14:
|
|
11183
11185
|
case "end":
|
|
11184
11186
|
return _context.stop();
|
|
11185
11187
|
}
|
|
@@ -17735,10 +17737,12 @@ function _typeof(o) {
|
|
|
17735
17737
|
throw new ValidationError("Invalid chain: ".concat(chain));
|
|
17736
17738
|
|
|
17737
17739
|
case 5:
|
|
17740
|
+
console.log("chain", chain);
|
|
17738
17741
|
if (!(category === "balance")) {
|
|
17739
|
-
_context23.next =
|
|
17742
|
+
_context23.next = 20;
|
|
17740
17743
|
break;
|
|
17741
17744
|
}
|
|
17745
|
+
console.log("balance");
|
|
17742
17746
|
_loop2 = _regeneratorRuntime().mark((function _loop2(i) {
|
|
17743
17747
|
var slice, url, data;
|
|
17744
17748
|
return _regeneratorRuntime().wrap((function _loop2$(_context21) {
|
|
@@ -17778,56 +17782,57 @@ function _typeof(o) {
|
|
|
17778
17782
|
}));
|
|
17779
17783
|
i = 0;
|
|
17780
17784
|
|
|
17781
|
-
case
|
|
17785
|
+
case 10:
|
|
17782
17786
|
if (!(i < ADDRS.length)) {
|
|
17783
|
-
_context23.next =
|
|
17787
|
+
_context23.next = 18;
|
|
17784
17788
|
break;
|
|
17785
17789
|
}
|
|
17786
|
-
return _context23.delegateYield(_loop2(i), "t0",
|
|
17790
|
+
return _context23.delegateYield(_loop2(i), "t0", 12);
|
|
17787
17791
|
|
|
17788
|
-
case
|
|
17792
|
+
case 12:
|
|
17789
17793
|
_ret2 = _context23.t0;
|
|
17790
17794
|
if (!_ret2) {
|
|
17791
|
-
_context23.next =
|
|
17795
|
+
_context23.next = 15;
|
|
17792
17796
|
break;
|
|
17793
17797
|
}
|
|
17794
17798
|
return _context23.abrupt("return", _ret2.v);
|
|
17795
17799
|
|
|
17796
|
-
case
|
|
17800
|
+
case 15:
|
|
17797
17801
|
i += 20;
|
|
17798
|
-
_context23.next =
|
|
17802
|
+
_context23.next = 10;
|
|
17799
17803
|
break;
|
|
17800
17804
|
|
|
17801
|
-
case
|
|
17802
|
-
_context23.next =
|
|
17805
|
+
case 18:
|
|
17806
|
+
_context23.next = 42;
|
|
17803
17807
|
break;
|
|
17804
17808
|
|
|
17805
|
-
case
|
|
17806
|
-
|
|
17809
|
+
case 20:
|
|
17810
|
+
console.log("startTime", startTime, "endTime", endTime, chain, apiKey);
|
|
17811
|
+
_context23.next = 23;
|
|
17807
17812
|
return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startTime), chain, apiKey);
|
|
17808
17813
|
|
|
17809
|
-
case
|
|
17814
|
+
case 23:
|
|
17810
17815
|
sb = _context23.sent;
|
|
17811
|
-
_context23.next =
|
|
17816
|
+
_context23.next = 26;
|
|
17812
17817
|
return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endTime), chain, apiKey);
|
|
17813
17818
|
|
|
17814
|
-
case
|
|
17819
|
+
case 26:
|
|
17815
17820
|
eb = _context23.sent;
|
|
17816
17821
|
console.log("sb", sb, "eb", eb);
|
|
17817
17822
|
if (sb) {
|
|
17818
|
-
_context23.next =
|
|
17823
|
+
_context23.next = 30;
|
|
17819
17824
|
break;
|
|
17820
17825
|
}
|
|
17821
17826
|
throw new ValidationError("Invalid startTime: ".concat(startTime));
|
|
17822
17827
|
|
|
17823
|
-
case
|
|
17828
|
+
case 30:
|
|
17824
17829
|
if (eb) {
|
|
17825
|
-
_context23.next =
|
|
17830
|
+
_context23.next = 32;
|
|
17826
17831
|
break;
|
|
17827
17832
|
}
|
|
17828
17833
|
throw new ValidationError("Invalid endTime: ".concat(endTime));
|
|
17829
17834
|
|
|
17830
|
-
case
|
|
17835
|
+
case 32:
|
|
17831
17836
|
_loop3 = _regeneratorRuntime().mark((function _loop3() {
|
|
17832
17837
|
var addr, url, data;
|
|
17833
17838
|
return _regeneratorRuntime().wrap((function _loop3$(_context22) {
|
|
@@ -17867,27 +17872,27 @@ function _typeof(o) {
|
|
|
17867
17872
|
}));
|
|
17868
17873
|
_i16 = 0, _ADDRS = ADDRS;
|
|
17869
17874
|
|
|
17870
|
-
case
|
|
17875
|
+
case 34:
|
|
17871
17876
|
if (!(_i16 < _ADDRS.length)) {
|
|
17872
|
-
_context23.next =
|
|
17877
|
+
_context23.next = 42;
|
|
17873
17878
|
break;
|
|
17874
17879
|
}
|
|
17875
|
-
return _context23.delegateYield(_loop3(), "t1",
|
|
17880
|
+
return _context23.delegateYield(_loop3(), "t1", 36);
|
|
17876
17881
|
|
|
17877
|
-
case
|
|
17882
|
+
case 36:
|
|
17878
17883
|
_ret3 = _context23.t1;
|
|
17879
17884
|
if (!_ret3) {
|
|
17880
|
-
_context23.next =
|
|
17885
|
+
_context23.next = 39;
|
|
17881
17886
|
break;
|
|
17882
17887
|
}
|
|
17883
17888
|
return _context23.abrupt("return", _ret3.v);
|
|
17884
17889
|
|
|
17885
|
-
case
|
|
17890
|
+
case 39:
|
|
17886
17891
|
_i16++;
|
|
17887
|
-
_context23.next =
|
|
17892
|
+
_context23.next = 34;
|
|
17888
17893
|
break;
|
|
17889
17894
|
|
|
17890
|
-
case
|
|
17895
|
+
case 42:
|
|
17891
17896
|
case "end":
|
|
17892
17897
|
return _context23.stop();
|
|
17893
17898
|
}
|