@fileverse-dev/formulajs 4.4.11-mod-68-patch-4 → 4.4.11-mod-68-patch-6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /* @fileverse-dev/formulajs v4.4.11-mod-68-patch-4 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-68-patch-6 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -11150,36 +11150,41 @@ 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 = 2;
11155
+ _context.next = 3;
11155
11156
  break;
11156
11157
  }
11157
11158
  return _context.abrupt("return");
11158
11159
 
11159
- case 2:
11160
+ case 3:
11160
11161
  chainId = CHAIN_ID_MAP[chain];
11162
+ console.log("chainId", chainId);
11161
11163
  url = "https://api.etherscan.io/v2/api?module=block&action=getblocknobytime&timestamp=".concat(timestamp, "&closest=before&apikey=").concat(apiKey, "&chainId=").concat(chainId);
11164
+ console.log("url", url, getUrlAndHeaders);
11162
11165
  _getUrlAndHeaders = getUrlAndHeaders({
11163
11166
  url: url,
11164
11167
  serviceName: "Etherscan",
11165
11168
  headers: {}
11166
11169
  }), finalUrl = _getUrlAndHeaders.URL, HEADERS = _getUrlAndHeaders.HEADERS;
11167
- _context.next = 7;
11170
+ console.log("finalUrl", finalUrl, HEADERS);
11171
+ _context.next = 11;
11168
11172
  return fetch(finalUrl, {
11169
11173
  method: "GET",
11170
11174
  headers: HEADERS
11171
11175
  });
11172
11176
 
11173
- case 7:
11177
+ case 11:
11174
11178
  res = _context.sent;
11175
- _context.next = 10;
11179
+ console.log("res", res, finalUrl, HEADERS);
11180
+ _context.next = 15;
11176
11181
  return res.json();
11177
11182
 
11178
- case 10:
11183
+ case 15:
11179
11184
  json = _context.sent;
11180
11185
  return _context.abrupt("return", parseInt(json.result));
11181
11186
 
11182
- case 12:
11187
+ case 17:
11183
11188
  case "end":
11184
11189
  return _context.stop();
11185
11190
  }
@@ -17735,10 +17740,12 @@ function _typeof(o) {
17735
17740
  throw new ValidationError("Invalid chain: ".concat(chain));
17736
17741
 
17737
17742
  case 5:
17743
+ console.log("chain", chain);
17738
17744
  if (!(category === "balance")) {
17739
- _context23.next = 18;
17745
+ _context23.next = 20;
17740
17746
  break;
17741
17747
  }
17748
+ console.log("balance");
17742
17749
  _loop2 = _regeneratorRuntime().mark((function _loop2(i) {
17743
17750
  var slice, url, data;
17744
17751
  return _regeneratorRuntime().wrap((function _loop2$(_context21) {
@@ -17778,56 +17785,57 @@ function _typeof(o) {
17778
17785
  }));
17779
17786
  i = 0;
17780
17787
 
17781
- case 8:
17788
+ case 10:
17782
17789
  if (!(i < ADDRS.length)) {
17783
- _context23.next = 16;
17790
+ _context23.next = 18;
17784
17791
  break;
17785
17792
  }
17786
- return _context23.delegateYield(_loop2(i), "t0", 10);
17793
+ return _context23.delegateYield(_loop2(i), "t0", 12);
17787
17794
 
17788
- case 10:
17795
+ case 12:
17789
17796
  _ret2 = _context23.t0;
17790
17797
  if (!_ret2) {
17791
- _context23.next = 13;
17798
+ _context23.next = 15;
17792
17799
  break;
17793
17800
  }
17794
17801
  return _context23.abrupt("return", _ret2.v);
17795
17802
 
17796
- case 13:
17803
+ case 15:
17797
17804
  i += 20;
17798
- _context23.next = 8;
17805
+ _context23.next = 10;
17799
17806
  break;
17800
17807
 
17801
- case 16:
17802
- _context23.next = 39;
17808
+ case 18:
17809
+ _context23.next = 42;
17803
17810
  break;
17804
17811
 
17805
- case 18:
17806
- _context23.next = 20;
17812
+ case 20:
17813
+ console.log("startTime", startTime, "endTime", endTime, chain, apiKey);
17814
+ _context23.next = 23;
17807
17815
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startTime), chain, apiKey);
17808
17816
 
17809
- case 20:
17817
+ case 23:
17810
17818
  sb = _context23.sent;
17811
- _context23.next = 23;
17819
+ _context23.next = 26;
17812
17820
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endTime), chain, apiKey);
17813
17821
 
17814
- case 23:
17822
+ case 26:
17815
17823
  eb = _context23.sent;
17816
17824
  console.log("sb", sb, "eb", eb);
17817
17825
  if (sb) {
17818
- _context23.next = 27;
17826
+ _context23.next = 30;
17819
17827
  break;
17820
17828
  }
17821
17829
  throw new ValidationError("Invalid startTime: ".concat(startTime));
17822
17830
 
17823
- case 27:
17831
+ case 30:
17824
17832
  if (eb) {
17825
- _context23.next = 29;
17833
+ _context23.next = 32;
17826
17834
  break;
17827
17835
  }
17828
17836
  throw new ValidationError("Invalid endTime: ".concat(endTime));
17829
17837
 
17830
- case 29:
17838
+ case 32:
17831
17839
  _loop3 = _regeneratorRuntime().mark((function _loop3() {
17832
17840
  var addr, url, data;
17833
17841
  return _regeneratorRuntime().wrap((function _loop3$(_context22) {
@@ -17867,27 +17875,27 @@ function _typeof(o) {
17867
17875
  }));
17868
17876
  _i16 = 0, _ADDRS = ADDRS;
17869
17877
 
17870
- case 31:
17878
+ case 34:
17871
17879
  if (!(_i16 < _ADDRS.length)) {
17872
- _context23.next = 39;
17880
+ _context23.next = 42;
17873
17881
  break;
17874
17882
  }
17875
- return _context23.delegateYield(_loop3(), "t1", 33);
17883
+ return _context23.delegateYield(_loop3(), "t1", 36);
17876
17884
 
17877
- case 33:
17885
+ case 36:
17878
17886
  _ret3 = _context23.t1;
17879
17887
  if (!_ret3) {
17880
- _context23.next = 36;
17888
+ _context23.next = 39;
17881
17889
  break;
17882
17890
  }
17883
17891
  return _context23.abrupt("return", _ret3.v);
17884
17892
 
17885
- case 36:
17893
+ case 39:
17886
17894
  _i16++;
17887
- _context23.next = 31;
17895
+ _context23.next = 34;
17888
17896
  break;
17889
17897
 
17890
- case 39:
17898
+ case 42:
17891
17899
  case "end":
17892
17900
  return _context23.stop();
17893
17901
  }