@fileverse-dev/formulajs 4.4.44 → 4.4.45

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.44 */
1
+ /* @fileverse-dev/formulajs v4.4.45 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -16481,7 +16481,6 @@ function _typeof(o) {
16481
16481
  graphType: enumType([ "v2", "v2-raw" ]),
16482
16482
  category: enumType([ "tokens", "markets" ]),
16483
16483
  param1: stringType().nonempty(),
16484
- param2: stringType().optional(),
16485
16484
  columnName: stringType().optional()
16486
16485
  });
16487
16486
  function AAVE() {
@@ -16489,23 +16488,22 @@ function _typeof(o) {
16489
16488
  }
16490
16489
  function _AAVE() {
16491
16490
  _AAVE = _asyncToGenerator(_regenerator().m(function _callee42() {
16492
- var _argsToArray3, _argsToArray4, graphType, category, param1, param2, columnName, baseUrl, url, res, _json, filterColumnName, _args43 = arguments, _t1;
16491
+ var _argsToArray3, _argsToArray4, graphType, category, param1, columnName, baseUrl, url, res, _json, filterColumnName, _data5, _args43 = arguments, _t1;
16493
16492
  return _regenerator().w(function(_context43) {
16494
16493
  while (1) switch (_context43.p = _context43.n) {
16495
16494
  case 0:
16496
16495
  _context43.p = 0;
16497
- _argsToArray3 = argsToArray(_args43), _argsToArray4 = _slicedToArray(_argsToArray3, 5),
16496
+ _argsToArray3 = argsToArray(_args43), _argsToArray4 = _slicedToArray(_argsToArray3, 4),
16498
16497
  graphType = _argsToArray4[0], category = _argsToArray4[1], param1 = _argsToArray4[2],
16499
- param2 = _argsToArray4[3], columnName = _argsToArray4[4];
16498
+ columnName = _argsToArray4[3];
16500
16499
  validateParams(aaveParamsSchema, {
16501
16500
  graphType: graphType,
16502
16501
  category: category,
16503
16502
  param1: param1,
16504
- param2: param2,
16505
16503
  columnName: columnName
16506
16504
  });
16507
16505
  baseUrl = "https://onchain-proxy.fileverse.io/third-party";
16508
- url = "".concat(baseUrl) + "?service=aave" + "&graphType=".concat(encodeURIComponent(graphType)) + "&category=".concat(encodeURIComponent(category)) + "&input1=".concat(encodeURIComponent(param1)) + (param2 ? "&input2=".concat(encodeURIComponent(param2)) : "");
16506
+ url = "".concat(baseUrl) + "?service=aave" + "&graphType=".concat(encodeURIComponent(graphType)) + "&category=".concat(encodeURIComponent(category)) + "&input1=".concat(encodeURIComponent(param1));
16509
16507
  _context43.n = 1;
16510
16508
  return fetch(url);
16511
16509
 
@@ -16534,24 +16532,31 @@ function _typeof(o) {
16534
16532
  var flat = {};
16535
16533
  Object.entries(item).forEach(function(_ref29) {
16536
16534
  var _ref30 = _slicedToArray(_ref29, 2), k = _ref30[0], v = _ref30[1];
16537
- if (columnName) {
16538
- if (filterColumnName.includes(k) && (v === null || _typeof(v) !== "object")) flat[k] = v;
16539
- } else {
16540
- if (v === null || _typeof(v) !== "object") flat[k] = v;
16541
- }
16535
+ if (columnName && filterColumnName.includes(k) && (v === null || _typeof(v) !== "object")) flat[k] = v;
16542
16536
  });
16543
16537
  return flat;
16544
16538
  }));
16545
16539
 
16546
16540
  case 4:
16547
- return _context43.a(2, _json);
16541
+ if (!(columnName && _typeof(_json) === "object")) {
16542
+ _context43.n = 5;
16543
+ break;
16544
+ }
16545
+ _data5 = {};
16546
+ filterColumnName.forEach(function(k) {
16547
+ _data5[k] = _json[k];
16548
+ });
16549
+ return _context43.a(2, _data5);
16548
16550
 
16549
16551
  case 5:
16550
- _context43.p = 5;
16552
+ return _context43.a(2, _json);
16553
+
16554
+ case 6:
16555
+ _context43.p = 6;
16551
16556
  _t1 = _context43.v;
16552
16557
  return _context43.a(2, errorMessageHandler(_t1, "AAVE"));
16553
16558
  }
16554
- }, _callee42, null, [ [ 0, 5 ] ]);
16559
+ }, _callee42, null, [ [ 0, 6 ] ]);
16555
16560
  }));
16556
16561
  return _AAVE.apply(this, arguments);
16557
16562
  }
@@ -17555,7 +17560,7 @@ function _typeof(o) {
17555
17560
  }
17556
17561
  function _COINGECKO() {
17557
17562
  _COINGECKO = _asyncToGenerator(_regenerator().m(function _callee49() {
17558
- var _category$toLowerCase, _argsToArray1, _argsToArray10, category, param1, param2, columnName, apiKey, headers, url, vs, map, _category, trend, _category2, _trend, _getUrlAndHeaders5, finalUrl, HEADERS, res, _json3, _json3$status, msg, out, _i34, _Object$entries, _Object$entries$_i, token, prices, _i35, _Object$entries2, _Object$entries2$_i, cur, val, _data5, _args53 = arguments, _t17, _t18;
17563
+ var _category$toLowerCase, _argsToArray1, _argsToArray10, category, param1, param2, columnName, apiKey, headers, url, vs, map, _category, trend, _category2, _trend, _getUrlAndHeaders5, finalUrl, HEADERS, res, _json3, _json3$status, msg, out, _i34, _Object$entries, _Object$entries$_i, token, prices, _i35, _Object$entries2, _Object$entries2$_i, cur, val, _data6, _args53 = arguments, _t17, _t18;
17559
17564
  return _regenerator().w(function(_context53) {
17560
17565
  while (1) switch (_context53.p = _context53.n) {
17561
17566
  case 0:
@@ -17661,8 +17666,8 @@ function _typeof(o) {
17661
17666
  return _context53.a(2, [ out ]);
17662
17667
 
17663
17668
  case 10:
17664
- _data5 = Array.isArray(_json3) ? _json3 : [ _json3 ];
17665
- return _context53.a(2, _data5.map(function(item) {
17669
+ _data6 = Array.isArray(_json3) ? _json3 : [ _json3 ];
17670
+ return _context53.a(2, _data6.map(function(item) {
17666
17671
  var flat = {};
17667
17672
  for (var _i36 = 0, _Object$entries3 = Object.entries(item); _i36 < _Object$entries3.length; _i36++) {
17668
17673
  var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i36], 2), key = _Object$entries3$_i[0], _value22 = _Object$entries3$_i[1];
@@ -17898,7 +17903,7 @@ function _typeof(o) {
17898
17903
  }
17899
17904
  function _FARCASTER() {
17900
17905
  _FARCASTER = _asyncToGenerator(_regenerator().m(function _callee52() {
17901
- var _argsToArray15, _argsToArray16, contentType, identifier, _argsToArray16$, start, _argsToArray16$2, end, apiKey, url, typeMap, _getUrlAndHeaders6, finalUrl, HEADERS, response, _yield$response$json, _data6, _args56 = arguments, _t22;
17906
+ var _argsToArray15, _argsToArray16, contentType, identifier, _argsToArray16$, start, _argsToArray16$2, end, apiKey, url, typeMap, _getUrlAndHeaders6, finalUrl, HEADERS, response, _yield$response$json, _data7, _args56 = arguments, _t22;
17902
17907
  return _regenerator().w(function(_context56) {
17903
17908
  while (1) switch (_context56.p = _context56.n) {
17904
17909
  case 0:
@@ -17953,15 +17958,15 @@ function _typeof(o) {
17953
17958
 
17954
17959
  case 3:
17955
17960
  _yield$response$json = _context56.v;
17956
- _data6 = _yield$response$json.data;
17957
- if (Array.isArray(_data6)) {
17961
+ _data7 = _yield$response$json.data;
17962
+ if (Array.isArray(_data7)) {
17958
17963
  _context56.n = 4;
17959
17964
  break;
17960
17965
  }
17961
17966
  return _context56.a(2, []);
17962
17967
 
17963
17968
  case 4:
17964
- return _context56.a(2, _data6.map(function(item) {
17969
+ return _context56.a(2, _data7.map(function(item) {
17965
17970
  var flat = {};
17966
17971
  for (var _i38 = 0, _Object$entries5 = Object.entries(item); _i38 < _Object$entries5.length; _i38++) {
17967
17972
  var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i38], 2), k = _Object$entries5$_i[0], v = _Object$entries5$_i[1];
@@ -18017,7 +18022,7 @@ function _typeof(o) {
18017
18022
  }
18018
18023
  function _FIREFLY() {
18019
18024
  _FIREFLY = _asyncToGenerator(_regenerator().m(function _callee53() {
18020
- var _argsToArray17, _argsToArray18, platform, contentType, identifier, _argsToArray18$, start, _argsToArray18$2, end, apiKey, url, _getUrlAndHeaders7, finalUrl, HEADERS, response, _yield$response$json2, _data7, _args57 = arguments, _t23;
18025
+ var _argsToArray17, _argsToArray18, platform, contentType, identifier, _argsToArray18$, start, _argsToArray18$2, end, apiKey, url, _getUrlAndHeaders7, finalUrl, HEADERS, response, _yield$response$json2, _data8, _args57 = arguments, _t23;
18021
18026
  return _regenerator().w(function(_context57) {
18022
18027
  while (1) switch (_context57.p = _context57.n) {
18023
18028
  case 0:
@@ -18068,15 +18073,15 @@ function _typeof(o) {
18068
18073
 
18069
18074
  case 3:
18070
18075
  _yield$response$json2 = _context57.v;
18071
- _data7 = _yield$response$json2.data;
18072
- if (Array.isArray(_data7)) {
18076
+ _data8 = _yield$response$json2.data;
18077
+ if (Array.isArray(_data8)) {
18073
18078
  _context57.n = 4;
18074
18079
  break;
18075
18080
  }
18076
18081
  return _context57.a(2, []);
18077
18082
 
18078
18083
  case 4:
18079
- return _context57.a(2, _data7.map(function(item) {
18084
+ return _context57.a(2, _data8.map(function(item) {
18080
18085
  var flat = {};
18081
18086
  for (var _i39 = 0, _Object$entries6 = Object.entries(item); _i39 < _Object$entries6.length; _i39++) {
18082
18087
  var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i39], 2), key = _Object$entries6$_i[0], _value23 = _Object$entries6$_i[1];
@@ -18159,7 +18164,7 @@ function _typeof(o) {
18159
18164
  }
18160
18165
  function _LENS() {
18161
18166
  _LENS = _asyncToGenerator(_regenerator().m(function _callee55() {
18162
- var _argsToArray21, _argsToArray22, contentType, identifier, _argsToArray22$, start, _argsToArray22$2, end, apiKey, url, typeMap, _getUrlAndHeaders8, finalUrl, HEADERS, response, _yield$response$json3, _data8, _args59 = arguments, _t25;
18167
+ var _argsToArray21, _argsToArray22, contentType, identifier, _argsToArray22$, start, _argsToArray22$2, end, apiKey, url, typeMap, _getUrlAndHeaders8, finalUrl, HEADERS, response, _yield$response$json3, _data9, _args59 = arguments, _t25;
18163
18168
  return _regenerator().w(function(_context59) {
18164
18169
  while (1) switch (_context59.p = _context59.n) {
18165
18170
  case 0:
@@ -18213,15 +18218,15 @@ function _typeof(o) {
18213
18218
 
18214
18219
  case 3:
18215
18220
  _yield$response$json3 = _context59.v;
18216
- _data8 = _yield$response$json3.data;
18217
- if (Array.isArray(_data8)) {
18221
+ _data9 = _yield$response$json3.data;
18222
+ if (Array.isArray(_data9)) {
18218
18223
  _context59.n = 4;
18219
18224
  break;
18220
18225
  }
18221
18226
  return _context59.a(2, []);
18222
18227
 
18223
18228
  case 4:
18224
- return _context59.a(2, _data8.map(function(item) {
18229
+ return _context59.a(2, _data9.map(function(item) {
18225
18230
  var flat = {};
18226
18231
  for (var _i40 = 0, _Object$entries7 = Object.entries(item); _i40 < _Object$entries7.length; _i40++) {
18227
18232
  var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i40], 2), key = _Object$entries7$_i[0], _value24 = _Object$entries7$_i[1];
@@ -18485,7 +18490,7 @@ function _typeof(o) {
18485
18490
  }
18486
18491
  function _UNISWAP() {
18487
18492
  _UNISWAP = _asyncToGenerator(_regenerator().m(function _callee58() {
18488
- var _argsToArray27, _argsToArray28, graphType, category, param1, param2, columnName, baseUrl, url, res, _json7, filterColumnName, _data9, _args62 = arguments, _t28;
18493
+ var _argsToArray27, _argsToArray28, graphType, category, param1, param2, columnName, baseUrl, url, res, _json7, filterColumnName, _data0, _args62 = arguments, _t28;
18489
18494
  return _regenerator().w(function(_context62) {
18490
18495
  while (1) switch (_context62.p = _context62.n) {
18491
18496
  case 0:
@@ -18541,11 +18546,11 @@ function _typeof(o) {
18541
18546
  _context62.n = 5;
18542
18547
  break;
18543
18548
  }
18544
- _data9 = {};
18549
+ _data0 = {};
18545
18550
  filterColumnName.forEach(function(k) {
18546
- _data9[k] = _json7[k];
18551
+ _data0[k] = _json7[k];
18547
18552
  });
18548
- return _context62.a(2, _data9);
18553
+ return _context62.a(2, _data0);
18549
18554
 
18550
18555
  case 5:
18551
18556
  return _context62.a(2, _json7);
@@ -18596,7 +18601,7 @@ function _typeof(o) {
18596
18601
  }
18597
18602
  function _TALLY() {
18598
18603
  _TALLY = _asyncToGenerator(_regenerator().m(function _callee60() {
18599
- var _argsToArray29, _argsToArray30, query, slug, baseUrl, url, res, _data0, _args64 = arguments, _t30;
18604
+ var _argsToArray29, _argsToArray30, query, slug, baseUrl, url, res, _data1, _args64 = arguments, _t30;
18600
18605
  return _regenerator().w(function(_context64) {
18601
18606
  while (1) switch (_context64.p = _context64.n) {
18602
18607
  case 0:
@@ -18625,8 +18630,8 @@ function _typeof(o) {
18625
18630
  return res.json();
18626
18631
 
18627
18632
  case 3:
18628
- _data0 = _context64.v;
18629
- return _context64.a(2, _data0);
18633
+ _data1 = _context64.v;
18634
+ return _context64.a(2, _data1);
18630
18635
 
18631
18636
  case 4:
18632
18637
  _context64.p = 4;
@@ -18771,7 +18776,7 @@ function _typeof(o) {
18771
18776
  }
18772
18777
  function _DUNE() {
18773
18778
  _DUNE = _asyncToGenerator(_regenerator().m(function _callee62() {
18774
- var _ref40, _json8$activity, _ref41, _json8$holders, _ref42, _json8$tokens, _argsToArray31, _argsToArray32, type, input1, input2, input3, input4, route, buildQuery, address, qs, chain, _qs, tokenAddress, _qs2, _chain, apiKey, url, _getUrlAndHeaders1, finalUrl, HEADERS, res, _data1, _json8, _data10, result, _final, globalDecimals, _iterator57, _step57, _loop5, _args67 = arguments, _t33, _t34;
18779
+ var _ref40, _json8$activity, _ref41, _json8$holders, _ref42, _json8$tokens, _argsToArray31, _argsToArray32, type, input1, input2, input3, input4, route, buildQuery, address, qs, chain, _qs, tokenAddress, _qs2, _chain, apiKey, url, _getUrlAndHeaders1, finalUrl, HEADERS, res, _data10, _json8, _data11, result, _final, globalDecimals, _iterator57, _step57, _loop5, _args67 = arguments, _t33, _t34;
18775
18780
  return _regenerator().w(function(_context67) {
18776
18781
  while (1) switch (_context67.p = _context67.n) {
18777
18782
  case 0:
@@ -18850,8 +18855,8 @@ function _typeof(o) {
18850
18855
  return res.json();
18851
18856
 
18852
18857
  case 4:
18853
- _data1 = _context67.v;
18854
- throw new ValidationError(_data1.message);
18858
+ _data10 = _context67.v;
18859
+ throw new ValidationError(_data10.message);
18855
18860
 
18856
18861
  case 5:
18857
18862
  throw new NetworkError(SERVICES_API_KEY.DuneSim, res.status);
@@ -18862,8 +18867,8 @@ function _typeof(o) {
18862
18867
 
18863
18868
  case 7:
18864
18869
  _json8 = _context67.v;
18865
- _data10 = type === "activity" ? (_ref40 = (_json8$activity = _json8 === null || _json8 === void 0 ? void 0 : _json8.activity) !== null && _json8$activity !== void 0 ? _json8$activity : _json8) !== null && _ref40 !== void 0 ? _ref40 : [] : type === "token-holders" ? (_ref41 = (_json8$holders = _json8 === null || _json8 === void 0 ? void 0 : _json8.holders) !== null && _json8$holders !== void 0 ? _json8$holders : _json8) !== null && _ref41 !== void 0 ? _ref41 : [] : type === "price" ? (_ref42 = (_json8$tokens = _json8 === null || _json8 === void 0 ? void 0 : _json8.tokens) !== null && _json8$tokens !== void 0 ? _json8$tokens : _json8) !== null && _ref42 !== void 0 ? _ref42 : [] : _json8 !== null && _json8 !== void 0 ? _json8 : [];
18866
- result = Array.isArray(_data10) ? _data10 : [ _data10 ];
18870
+ _data11 = type === "activity" ? (_ref40 = (_json8$activity = _json8 === null || _json8 === void 0 ? void 0 : _json8.activity) !== null && _json8$activity !== void 0 ? _json8$activity : _json8) !== null && _ref40 !== void 0 ? _ref40 : [] : type === "token-holders" ? (_ref41 = (_json8$holders = _json8 === null || _json8 === void 0 ? void 0 : _json8.holders) !== null && _json8$holders !== void 0 ? _json8$holders : _json8) !== null && _ref41 !== void 0 ? _ref41 : [] : type === "price" ? (_ref42 = (_json8$tokens = _json8 === null || _json8 === void 0 ? void 0 : _json8.tokens) !== null && _json8$tokens !== void 0 ? _json8$tokens : _json8) !== null && _ref42 !== void 0 ? _ref42 : [] : _json8 !== null && _json8 !== void 0 ? _json8 : [];
18871
+ result = Array.isArray(_data11) ? _data11 : [ _data11 ];
18867
18872
  _final = [];
18868
18873
  _iterator57 = _createForOfIteratorHelper(result);
18869
18874
  _context67.p = 8;
@@ -19043,7 +19048,7 @@ function _typeof(o) {
19043
19048
  }
19044
19049
  function _PRICE() {
19045
19050
  _PRICE = _asyncToGenerator(_regenerator().m(function _callee63() {
19046
- var _input, _input2, _input3, _argsToArray33, _argsToArray34, input1, input2, input3, baseUrl, url, returnSingleValue, tokenAddress, coin, res, errorData, _data11, _args68 = arguments, _t35;
19051
+ var _input, _input2, _input3, _argsToArray33, _argsToArray34, input1, input2, input3, baseUrl, url, returnSingleValue, tokenAddress, coin, res, errorData, _data12, _args68 = arguments, _t35;
19047
19052
  return _regenerator().w(function(_context68) {
19048
19053
  while (1) switch (_context68.p = _context68.n) {
19049
19054
  case 0:
@@ -19104,15 +19109,15 @@ function _typeof(o) {
19104
19109
  return res.json();
19105
19110
 
19106
19111
  case 5:
19107
- _data11 = _context68.v;
19112
+ _data12 = _context68.v;
19108
19113
  if (!returnSingleValue) {
19109
19114
  _context68.n = 6;
19110
19115
  break;
19111
19116
  }
19112
- return _context68.a(2, _data11[0].price);
19117
+ return _context68.a(2, _data12[0].price);
19113
19118
 
19114
19119
  case 6:
19115
- return _context68.a(2, _data11);
19120
+ return _context68.a(2, _data12);
19116
19121
 
19117
19122
  case 7:
19118
19123
  _context68.p = 7;
@@ -29180,7 +29185,7 @@ function _typeof(o) {
29180
29185
  }
29181
29186
  function _CIRCLES() {
29182
29187
  _CIRCLES = _asyncToGenerator(_regenerator().m(function _callee68() {
29183
- var _argsToArray39, _argsToArray40, functionName, address, entries, columnName, resolved, dataClient, limit, runOnePage, dataTrust, filterColumnName, _data12, _filterColumnName, res, balance, _args73 = arguments, _t39, _t40;
29188
+ var _argsToArray39, _argsToArray40, functionName, address, entries, columnName, resolved, dataClient, limit, runOnePage, dataTrust, filterColumnName, _data13, _filterColumnName, res, balance, _args73 = arguments, _t39, _t40;
29184
29189
  return _regenerator().w(function(_context73) {
29185
29190
  while (1) switch (_context73.p = _context73.n) {
29186
29191
  case 0:
@@ -29265,7 +29270,7 @@ function _typeof(o) {
29265
29270
  return runOnePage(dataClient.getTransactionHistory(resolved, limit));
29266
29271
 
29267
29272
  case 6:
29268
- _data12 = _context73.v;
29273
+ _data13 = _context73.v;
29269
29274
  if (!columnName) {
29270
29275
  _context73.n = 7;
29271
29276
  break;
@@ -29273,7 +29278,7 @@ function _typeof(o) {
29273
29278
  _filterColumnName = columnName.split(",").map(function(s) {
29274
29279
  return s.trim();
29275
29280
  });
29276
- return _context73.a(2, _data12.map(function(obj) {
29281
+ return _context73.a(2, _data13.map(function(obj) {
29277
29282
  return Object.fromEntries(_filterColumnName.filter(function(key) {
29278
29283
  return key in obj;
29279
29284
  }).map(function(key) {
@@ -29282,7 +29287,7 @@ function _typeof(o) {
29282
29287
  }));
29283
29288
 
29284
29289
  case 7:
29285
- return _context73.a(2, _data12);
29290
+ return _context73.a(2, _data13);
29286
29291
 
29287
29292
  case 8:
29288
29293
  _context73.n = 9;