@fileverse-dev/formulajs 4.4.15 → 4.4.16

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.15 */
1
+ /* @fileverse-dev/formulajs v4.4.16 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -17360,7 +17360,7 @@ function _typeof(o) {
17360
17360
  for (_i12 = 0, _Object$entries2 = Object.entries(prices); _i12 < _Object$entries2.length; _i12++) {
17361
17361
  _Object$entries2$_i = _slicedToArray(_Object$entries2[_i12], 2), cur = _Object$entries2$_i[0],
17362
17362
  val = _Object$entries2$_i[1];
17363
- out["".concat(token.charAt(0).toUpperCase() + token.slice(1), "_").concat(cur.toUpperCase())] = val;
17363
+ out["".concat(token.toUpperCase(), "_").concat(cur.toUpperCase())] = val;
17364
17364
  }
17365
17365
  }
17366
17366
  return _context20.abrupt("return", [ out ]);
@@ -18469,7 +18469,7 @@ function _typeof(o) {
18469
18469
  }
18470
18470
  function _DUNE() {
18471
18471
  _DUNE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee30() {
18472
- var _ref26, _json$activity, _ref27, _json$holders, _ref28, _json$tokens, _argsToArray31, _argsToArray32, type, input1, input2, input3, input4, route, buildQuery, address, qs, chain, _qs, tokenAddress, _qs2, _chain, apiKey, url, _getUrlAndHeaders1, finalUrl, HEADERS, res, json, _data6, result, _final, globalDecimals, _iterator43, _step43, _loop4, _args34 = arguments;
18472
+ var _ref26, _json$activity, _ref27, _json$holders, _ref28, _json$tokens, _argsToArray31, _argsToArray32, type, input1, input2, input3, input4, route, buildQuery, address, qs, chain, _qs, tokenAddress, _qs2, _chain, apiKey, url, _getUrlAndHeaders1, finalUrl, HEADERS, res, _data6, json, _data7, result, _final, globalDecimals, _iterator43, _step43, _loop4, _args34 = arguments;
18473
18473
  return _regeneratorRuntime().wrap((function _callee30$(_context34) {
18474
18474
  while (1) switch (_context34.prev = _context34.next) {
18475
18475
  case 0:
@@ -18537,22 +18537,34 @@ function _typeof(o) {
18537
18537
  case 18:
18538
18538
  res = _context34.sent;
18539
18539
  if (res.ok) {
18540
- _context34.next = 21;
18540
+ _context34.next = 26;
18541
+ break;
18542
+ }
18543
+ if (!(res.status === 400)) {
18544
+ _context34.next = 25;
18541
18545
  break;
18542
18546
  }
18543
- throw new NetworkError(SERVICES_API_KEY.DuneSim, res.status);
18544
-
18545
- case 21:
18546
18547
  _context34.next = 23;
18547
18548
  return res.json();
18548
18549
 
18549
18550
  case 23:
18551
+ _data6 = _context34.sent;
18552
+ throw new ValidationError(_data6.message);
18553
+
18554
+ case 25:
18555
+ throw new NetworkError(SERVICES_API_KEY.DuneSim, res.status);
18556
+
18557
+ case 26:
18558
+ _context34.next = 28;
18559
+ return res.json();
18560
+
18561
+ case 28:
18550
18562
  json = _context34.sent;
18551
- _data6 = type === "activity" ? (_ref26 = (_json$activity = json === null || json === void 0 ? void 0 : json.activity) !== null && _json$activity !== void 0 ? _json$activity : json) !== null && _ref26 !== void 0 ? _ref26 : [] : type === "token-holders" ? (_ref27 = (_json$holders = json === null || json === void 0 ? void 0 : json.holders) !== null && _json$holders !== void 0 ? _json$holders : json) !== null && _ref27 !== void 0 ? _ref27 : [] : type === "price" ? (_ref28 = (_json$tokens = json === null || json === void 0 ? void 0 : json.tokens) !== null && _json$tokens !== void 0 ? _json$tokens : json) !== null && _ref28 !== void 0 ? _ref28 : [] : json !== null && json !== void 0 ? json : [];
18552
- result = Array.isArray(_data6) ? _data6 : [ _data6 ];
18563
+ _data7 = type === "activity" ? (_ref26 = (_json$activity = json === null || json === void 0 ? void 0 : json.activity) !== null && _json$activity !== void 0 ? _json$activity : json) !== null && _ref26 !== void 0 ? _ref26 : [] : type === "token-holders" ? (_ref27 = (_json$holders = json === null || json === void 0 ? void 0 : json.holders) !== null && _json$holders !== void 0 ? _json$holders : json) !== null && _ref27 !== void 0 ? _ref27 : [] : type === "price" ? (_ref28 = (_json$tokens = json === null || json === void 0 ? void 0 : json.tokens) !== null && _json$tokens !== void 0 ? _json$tokens : json) !== null && _ref28 !== void 0 ? _ref28 : [] : json !== null && json !== void 0 ? json : [];
18564
+ result = Array.isArray(_data7) ? _data7 : [ _data7 ];
18553
18565
  _final = [];
18554
18566
  _iterator43 = _createForOfIteratorHelper(result);
18555
- _context34.prev = 28;
18567
+ _context34.prev = 33;
18556
18568
  _loop4 = _regeneratorRuntime().mark((function _loop4() {
18557
18569
  var item, prices, _resData$tokens$, _chain2, _url, _getUrlAndHeaders10, _finalUrl, _HEADERS, _res, resData, decimals;
18558
18570
  return _regeneratorRuntime().wrap((function _loop4$(_context33) {
@@ -18659,44 +18671,44 @@ function _typeof(o) {
18659
18671
  }));
18660
18672
  _iterator43.s();
18661
18673
 
18662
- case 31:
18674
+ case 36:
18663
18675
  if ((_step43 = _iterator43.n()).done) {
18664
- _context34.next = 35;
18676
+ _context34.next = 40;
18665
18677
  break;
18666
18678
  }
18667
- return _context34.delegateYield(_loop4(), "t0", 33);
18679
+ return _context34.delegateYield(_loop4(), "t0", 38);
18668
18680
 
18669
- case 33:
18670
- _context34.next = 31;
18681
+ case 38:
18682
+ _context34.next = 36;
18671
18683
  break;
18672
18684
 
18673
- case 35:
18674
- _context34.next = 40;
18685
+ case 40:
18686
+ _context34.next = 45;
18675
18687
  break;
18676
18688
 
18677
- case 37:
18678
- _context34.prev = 37;
18679
- _context34.t1 = _context34["catch"](28);
18689
+ case 42:
18690
+ _context34.prev = 42;
18691
+ _context34.t1 = _context34["catch"](33);
18680
18692
  _iterator43.e(_context34.t1);
18681
18693
 
18682
- case 40:
18683
- _context34.prev = 40;
18694
+ case 45:
18695
+ _context34.prev = 45;
18684
18696
  _iterator43.f();
18685
- return _context34.finish(40);
18697
+ return _context34.finish(45);
18686
18698
 
18687
- case 43:
18699
+ case 48:
18688
18700
  return _context34.abrupt("return", _final);
18689
18701
 
18690
- case 46:
18691
- _context34.prev = 46;
18702
+ case 51:
18703
+ _context34.prev = 51;
18692
18704
  _context34.t2 = _context34["catch"](0);
18693
18705
  return _context34.abrupt("return", errorMessageHandler(_context34.t2, "DUNE"));
18694
18706
 
18695
- case 49:
18707
+ case 54:
18696
18708
  case "end":
18697
18709
  return _context34.stop();
18698
18710
  }
18699
- }), _callee30, null, [ [ 0, 46 ], [ 28, 37, 40, 43 ] ]);
18711
+ }), _callee30, null, [ [ 0, 51 ], [ 33, 42, 45, 48 ] ]);
18700
18712
  })));
18701
18713
  return _DUNE.apply(this, arguments);
18702
18714
  }