@defillama/sdk 5.0.165 → 5.0.166

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.
package/build/abi/tron.js CHANGED
@@ -89,9 +89,12 @@ async function multiCall(functionABI, calls) {
89
89
  }
90
90
  exports.multiCall = multiCall;
91
91
  async function getBalance(params) {
92
- var _a, _b, _c;
92
+ var _a, _b, _c, _d, _e;
93
93
  const data = await limitRPCCalls(() => post({ address: params.target, visible: true, }, '/wallet/getaccount'));
94
- const balance = (((_a = data.balance) !== null && _a !== void 0 ? _a : 0) + ((_c = (_b = data.frozen) === null || _b === void 0 ? void 0 : _b.reduce((t, { frozen_balance }) => t + frozen_balance, 0)) !== null && _c !== void 0 ? _c : 0)).toString();
94
+ const frozenBalance = (_b = (_a = data.frozen) === null || _a === void 0 ? void 0 : _a.reduce((t, { frozen_balance }) => t + frozen_balance, 0)) !== null && _b !== void 0 ? _b : 0;
95
+ const frozenBalanceV2 = (_d = (_c = data.frozenV2) === null || _c === void 0 ? void 0 : _c.reduce((t, { amount = 0 }) => t + amount, 0)) !== null && _d !== void 0 ? _d : 0;
96
+ const freeBalance = (_e = data.balance) !== null && _e !== void 0 ? _e : 0;
97
+ const balance = (freeBalance + frozenBalance + frozenBalanceV2).toString();
95
98
  return {
96
99
  output: (0, general_1.handleDecimals)(balance, params.decimals),
97
100
  };