@fileverse-dev/formulajs 4.4.14 → 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.14 */
1
+ /* @fileverse-dev/formulajs v4.4.16 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -17323,7 +17323,7 @@ function _typeof(o) {
17323
17323
  headers: headers
17324
17324
  }), finalUrl = _getUrlAndHeaders5.URL, HEADERS = _getUrlAndHeaders5.HEADERS;
17325
17325
  _context20.next = 26;
17326
- return fetch(finalUrl, {
17326
+ return fetch(finalUrl + "?refresh=true", {
17327
17327
  headers: HEADERS
17328
17328
  });
17329
17329
 
@@ -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) {
@@ -18563,6 +18575,9 @@ function _typeof(o) {
18563
18575
  if (item !== null && item !== void 0 && item.total_supply) {
18564
18576
  item.total_supply = formatNumber(item === null || item === void 0 ? void 0 : item.total_supply, item.decimals);
18565
18577
  }
18578
+ if (item !== null && item !== void 0 && item.fully_diluted_value) {
18579
+ item.fully_diluted_value = formatNumber(item === null || item === void 0 ? void 0 : item.fully_diluted_value, item.decimals);
18580
+ }
18566
18581
  }
18567
18582
  if (item !== null && item !== void 0 && item.first_acquired) {
18568
18583
  item.first_acquired = new Intl.DateTimeFormat("en-US", {
@@ -18656,44 +18671,44 @@ function _typeof(o) {
18656
18671
  }));
18657
18672
  _iterator43.s();
18658
18673
 
18659
- case 31:
18674
+ case 36:
18660
18675
  if ((_step43 = _iterator43.n()).done) {
18661
- _context34.next = 35;
18676
+ _context34.next = 40;
18662
18677
  break;
18663
18678
  }
18664
- return _context34.delegateYield(_loop4(), "t0", 33);
18679
+ return _context34.delegateYield(_loop4(), "t0", 38);
18665
18680
 
18666
- case 33:
18667
- _context34.next = 31;
18681
+ case 38:
18682
+ _context34.next = 36;
18668
18683
  break;
18669
18684
 
18670
- case 35:
18671
- _context34.next = 40;
18685
+ case 40:
18686
+ _context34.next = 45;
18672
18687
  break;
18673
18688
 
18674
- case 37:
18675
- _context34.prev = 37;
18676
- _context34.t1 = _context34["catch"](28);
18689
+ case 42:
18690
+ _context34.prev = 42;
18691
+ _context34.t1 = _context34["catch"](33);
18677
18692
  _iterator43.e(_context34.t1);
18678
18693
 
18679
- case 40:
18680
- _context34.prev = 40;
18694
+ case 45:
18695
+ _context34.prev = 45;
18681
18696
  _iterator43.f();
18682
- return _context34.finish(40);
18697
+ return _context34.finish(45);
18683
18698
 
18684
- case 43:
18699
+ case 48:
18685
18700
  return _context34.abrupt("return", _final);
18686
18701
 
18687
- case 46:
18688
- _context34.prev = 46;
18702
+ case 51:
18703
+ _context34.prev = 51;
18689
18704
  _context34.t2 = _context34["catch"](0);
18690
18705
  return _context34.abrupt("return", errorMessageHandler(_context34.t2, "DUNE"));
18691
18706
 
18692
- case 49:
18707
+ case 54:
18693
18708
  case "end":
18694
18709
  return _context34.stop();
18695
18710
  }
18696
- }), _callee30, null, [ [ 0, 46 ], [ 28, 37, 40, 43 ] ]);
18711
+ }), _callee30, null, [ [ 0, 51 ], [ 33, 42, 45, 48 ] ]);
18697
18712
  })));
18698
18713
  return _DUNE.apply(this, arguments);
18699
18714
  }