@fileverse-dev/formulajs 4.4.11-mod-68-patch-3 → 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.
@@ -1,4 +1,4 @@
1
- /* @fileverse-dev/formulajs v4.4.11-mod-68-patch-3 */
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 = 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];
11161
11162
  url = "https://api.etherscan.io/v2/api?module=block&action=getblocknobytime&timestamp=".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 = 7;
11168
+ _context.next = 8;
11168
11169
  return fetch(finalUrl, {
11169
11170
  method: "GET",
11170
11171
  headers: HEADERS
11171
11172
  });
11172
11173
 
11173
- case 7:
11174
+ case 8:
11174
11175
  res = _context.sent;
11175
- _context.next = 10;
11176
+ console.log("res", res, finalUrl, HEADERS);
11177
+ _context.next = 12;
11176
11178
  return res.json();
11177
11179
 
11178
- case 10:
11180
+ case 12:
11179
11181
  json = _context.sent;
11180
11182
  return _context.abrupt("return", parseInt(json.result));
11181
11183
 
11182
- case 12:
11184
+ case 14:
11183
11185
  case "end":
11184
11186
  return _context.stop();
11185
11187
  }
@@ -17726,18 +17728,21 @@ function _typeof(o) {
17726
17728
  while (1) switch (_context23.prev = _context23.next) {
17727
17729
  case 0:
17728
17730
  chain = _step42.value;
17731
+ console.log("chain", chain);
17729
17732
  chainId = CHAIN_ID_MAP[chain];
17730
17733
  if (chainId) {
17731
- _context23.next = 4;
17734
+ _context23.next = 5;
17732
17735
  break;
17733
17736
  }
17734
17737
  throw new ValidationError("Invalid chain: ".concat(chain));
17735
17738
 
17736
- case 4:
17739
+ case 5:
17740
+ console.log("chain", chain);
17737
17741
  if (!(category === "balance")) {
17738
- _context23.next = 17;
17742
+ _context23.next = 20;
17739
17743
  break;
17740
17744
  }
17745
+ console.log("balance");
17741
17746
  _loop2 = _regeneratorRuntime().mark((function _loop2(i) {
17742
17747
  var slice, url, data;
17743
17748
  return _regeneratorRuntime().wrap((function _loop2$(_context21) {
@@ -17777,55 +17782,57 @@ function _typeof(o) {
17777
17782
  }));
17778
17783
  i = 0;
17779
17784
 
17780
- case 7:
17785
+ case 10:
17781
17786
  if (!(i < ADDRS.length)) {
17782
- _context23.next = 15;
17787
+ _context23.next = 18;
17783
17788
  break;
17784
17789
  }
17785
- return _context23.delegateYield(_loop2(i), "t0", 9);
17790
+ return _context23.delegateYield(_loop2(i), "t0", 12);
17786
17791
 
17787
- case 9:
17792
+ case 12:
17788
17793
  _ret2 = _context23.t0;
17789
17794
  if (!_ret2) {
17790
- _context23.next = 12;
17795
+ _context23.next = 15;
17791
17796
  break;
17792
17797
  }
17793
17798
  return _context23.abrupt("return", _ret2.v);
17794
17799
 
17795
- case 12:
17800
+ case 15:
17796
17801
  i += 20;
17797
- _context23.next = 7;
17802
+ _context23.next = 10;
17798
17803
  break;
17799
17804
 
17800
- case 15:
17801
- _context23.next = 37;
17805
+ case 18:
17806
+ _context23.next = 42;
17802
17807
  break;
17803
17808
 
17804
- case 17:
17805
- _context23.next = 19;
17809
+ case 20:
17810
+ console.log("startTime", startTime, "endTime", endTime, chain, apiKey);
17811
+ _context23.next = 23;
17806
17812
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startTime), chain, apiKey);
17807
17813
 
17808
- case 19:
17814
+ case 23:
17809
17815
  sb = _context23.sent;
17810
- _context23.next = 22;
17816
+ _context23.next = 26;
17811
17817
  return fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endTime), chain, apiKey);
17812
17818
 
17813
- case 22:
17819
+ case 26:
17814
17820
  eb = _context23.sent;
17821
+ console.log("sb", sb, "eb", eb);
17815
17822
  if (sb) {
17816
- _context23.next = 25;
17823
+ _context23.next = 30;
17817
17824
  break;
17818
17825
  }
17819
17826
  throw new ValidationError("Invalid startTime: ".concat(startTime));
17820
17827
 
17821
- case 25:
17828
+ case 30:
17822
17829
  if (eb) {
17823
- _context23.next = 27;
17830
+ _context23.next = 32;
17824
17831
  break;
17825
17832
  }
17826
17833
  throw new ValidationError("Invalid endTime: ".concat(endTime));
17827
17834
 
17828
- case 27:
17835
+ case 32:
17829
17836
  _loop3 = _regeneratorRuntime().mark((function _loop3() {
17830
17837
  var addr, url, data;
17831
17838
  return _regeneratorRuntime().wrap((function _loop3$(_context22) {
@@ -17865,27 +17872,27 @@ function _typeof(o) {
17865
17872
  }));
17866
17873
  _i16 = 0, _ADDRS = ADDRS;
17867
17874
 
17868
- case 29:
17875
+ case 34:
17869
17876
  if (!(_i16 < _ADDRS.length)) {
17870
- _context23.next = 37;
17877
+ _context23.next = 42;
17871
17878
  break;
17872
17879
  }
17873
- return _context23.delegateYield(_loop3(), "t1", 31);
17880
+ return _context23.delegateYield(_loop3(), "t1", 36);
17874
17881
 
17875
- case 31:
17882
+ case 36:
17876
17883
  _ret3 = _context23.t1;
17877
17884
  if (!_ret3) {
17878
- _context23.next = 34;
17885
+ _context23.next = 39;
17879
17886
  break;
17880
17887
  }
17881
17888
  return _context23.abrupt("return", _ret3.v);
17882
17889
 
17883
- case 34:
17890
+ case 39:
17884
17891
  _i16++;
17885
- _context23.next = 29;
17892
+ _context23.next = 34;
17886
17893
  break;
17887
17894
 
17888
- case 37:
17895
+ case 42:
17889
17896
  case "end":
17890
17897
  return _context23.stop();
17891
17898
  }