@fileverse-dev/formulajs 4.4.31-circles-patch-2 → 4.4.31-circles-patch-3

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.31-circles-patch-2 */
1
+ /* @fileverse-dev/formulajs v4.4.31-circles-patch-3 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -28989,7 +28989,7 @@ function _typeof(o) {
28989
28989
  }
28990
28990
  function _CIRCLES() {
28991
28991
  _CIRCLES = _asyncToGenerator(_regenerator().m(function _callee68() {
28992
- var _argsToArray39, _argsToArray40, address, functionName, entries, resolved, dataClient, runOnePage, _args73 = arguments, _t39, _t40;
28992
+ var _argsToArray39, _argsToArray40, address, functionName, entries, resolved, dataClient, limit, runOnePage, res, flat, balance, _args73 = arguments, _t39, _t40;
28993
28993
  return _regenerator().w(function(_context73) {
28994
28994
  while (1) switch (_context73.p = _context73.n) {
28995
28995
  case 0:
@@ -29007,6 +29007,7 @@ function _typeof(o) {
29007
29007
  case 1:
29008
29008
  resolved = _context73.v;
29009
29009
  dataClient = new CirclesData("https://rpc.aboutcircles.com");
29010
+ limit = Number.isFinite(Number(entries)) && Number(entries) > 0 ? Number(entries) : 10;
29010
29011
  runOnePage = function() {
29011
29012
  var _ref44 = _asyncToGenerator(_regenerator().m(function _callee67(maybeQuery) {
29012
29013
  var q, _q$currentPage$result, _q$currentPage, has;
@@ -29039,45 +29040,58 @@ function _typeof(o) {
29039
29040
  };
29040
29041
  }();
29041
29042
  _t39 = functionName;
29042
- _context73.n = _t39 === "trust" ? 2 : _t39 === "transactions" ? 4 : _t39 === "profile" ? 6 : _t39 === "balances" ? 7 : 8;
29043
+ _context73.n = _t39 === "trust" ? 2 : _t39 === "transactions" ? 4 : _t39 === "profile" ? 6 : _t39 === "balances" ? 8 : 10;
29043
29044
  break;
29044
29045
 
29045
29046
  case 2:
29046
29047
  _context73.n = 3;
29047
- return runOnePage(dataClient.getTrustRelations(resolved, entries));
29048
+ return runOnePage(dataClient.getTrustRelations(resolved, limit));
29048
29049
 
29049
29050
  case 3:
29050
29051
  return _context73.a(2, _context73.v);
29051
29052
 
29052
29053
  case 4:
29053
29054
  _context73.n = 5;
29054
- return runOnePage(dataClient.getTransactionHistory(resolved, entries));
29055
+ return runOnePage(dataClient.getTransactionHistory(resolved, limit));
29055
29056
 
29056
29057
  case 5:
29057
29058
  return _context73.a(2, _context73.v);
29058
29059
 
29059
29060
  case 6:
29060
- return _context73.a(2, dataClient.getAvatarInfo(resolved));
29061
+ _context73.n = 7;
29062
+ return dataClient.getAvatarInfo(resolved);
29061
29063
 
29062
29064
  case 7:
29063
- return _context73.a(2, dataClient.getTotalBalanceV2(resolved));
29065
+ res = _context73.v;
29066
+ flat = flattenObject(res);
29067
+ return _context73.a(2, flat);
29064
29068
 
29065
29069
  case 8:
29066
- throw new ValidationError("Unsupported functionName");
29070
+ _context73.n = 9;
29071
+ return dataClient.getTotalBalanceV2(resolved);
29067
29072
 
29068
29073
  case 9:
29069
- _context73.n = 11;
29070
- break;
29074
+ balance = _context73.v;
29075
+ return _context73.a(2, [ {
29076
+ "CRC Balance": balance
29077
+ } ]);
29071
29078
 
29072
29079
  case 10:
29073
- _context73.p = 10;
29080
+ throw new ValidationError("Unsupported functionName");
29081
+
29082
+ case 11:
29083
+ _context73.n = 13;
29084
+ break;
29085
+
29086
+ case 12:
29087
+ _context73.p = 12;
29074
29088
  _t40 = _context73.v;
29075
29089
  return _context73.a(2, errorMessageHandler(_t40, "CIRCLES"));
29076
29090
 
29077
- case 11:
29091
+ case 13:
29078
29092
  return _context73.a(2);
29079
29093
  }
29080
- }, _callee68, null, [ [ 0, 10 ] ]);
29094
+ }, _callee68, null, [ [ 0, 12 ] ]);
29081
29095
  }));
29082
29096
  return _CIRCLES.apply(this, arguments);
29083
29097
  }