@defillama/sdk 4.0.23 → 4.0.25

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.
Files changed (2) hide show
  1. package/build/abi/tron.js +18 -8
  2. package/package.json +1 -1
package/build/abi/tron.js CHANGED
@@ -117,13 +117,25 @@ function call(options) {
117
117
  }
118
118
  exports.call = call;
119
119
  function multiCall(functionABI, calls) {
120
+ var _a;
120
121
  return __awaiter(this, void 0, void 0, function () {
121
- var returnValues;
122
- return __generator(this, function (_a) {
123
- switch (_a.label) {
124
- case 0: return [4 /*yield*/, executeCalls(functionABI, calls)];
122
+ var inputs_1, returnValues;
123
+ return __generator(this, function (_b) {
124
+ switch (_b.label) {
125
+ case 0:
126
+ if ((_a = functionABI.inputs) === null || _a === void 0 ? void 0 : _a.length) {
127
+ inputs_1 = functionABI.inputs;
128
+ calls.forEach(function (call) {
129
+ var _a;
130
+ (_a = call.params) === null || _a === void 0 ? void 0 : _a.forEach(function (v, i) {
131
+ if (inputs_1[i].type === 'address')
132
+ call.params[i] = hexifyTarget(v);
133
+ });
134
+ });
135
+ }
136
+ return [4 /*yield*/, executeCalls(functionABI, calls)];
125
137
  case 1:
126
- returnValues = _a.sent();
138
+ returnValues = _b.sent();
127
139
  return [2 /*return*/, returnValues.map(function (output, index) {
128
140
  return {
129
141
  input: {
@@ -210,9 +222,7 @@ function executeCalls(functionABI, calls) {
210
222
  if (outputName && outputName.length)
211
223
  output[outputName] = v;
212
224
  });
213
- if (output.length === 1)
214
- output = output[0];
215
- return output;
225
+ return (0, convertResults_1.default)(output);
216
226
  })];
217
227
  case 3:
218
228
  e_1 = _b.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defillama/sdk",
3
- "version": "4.0.23",
3
+ "version": "4.0.25",
4
4
  "description": "SDK for calculating TVL",
5
5
  "main": "build/index.js",
6
6
  "scripts": {