@curvefi/api 2.24.4 → 2.24.5

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/lib/router.js +10 -2
  2. package/package.json +1 -1
package/lib/router.js CHANGED
@@ -876,7 +876,7 @@ var swap = function (inputCoin, outputCoin, amount, slippage) {
876
876
  };
877
877
  exports.swap = swap;
878
878
  var getSwappedAmount = function (tx, outputCoin) { return __awaiter(void 0, void 0, void 0, function () {
879
- var outputCoinAddress, outputCoinDecimals, txInfo, res;
879
+ var outputCoinAddress, outputCoinDecimals, txInfo, res, i;
880
880
  return __generator(this, function (_a) {
881
881
  switch (_a.label) {
882
882
  case 0:
@@ -885,7 +885,15 @@ var getSwappedAmount = function (tx, outputCoin) { return __awaiter(void 0, void
885
885
  return [4 /*yield*/, tx.wait()];
886
886
  case 1:
887
887
  txInfo = _a.sent();
888
- res = ethers_1.ethers.utils.defaultAbiCoder.decode(['address[9]', 'uint256[3][4]', 'address[4]', 'uint256', 'uint256'], ethers_1.ethers.utils.hexDataSlice(txInfo.logs[txInfo.logs.length - 1].data, 0));
888
+ for (i = 1; i <= txInfo.logs.length; i++) {
889
+ try {
890
+ res = ethers_1.ethers.utils.defaultAbiCoder.decode(['address[9]', 'uint256[3][4]', 'address[4]', 'uint256', 'uint256'], ethers_1.ethers.utils.hexDataSlice(txInfo.logs[txInfo.logs.length - i].data, 0));
891
+ break;
892
+ }
893
+ catch (err) { }
894
+ }
895
+ if (res === undefined)
896
+ return [2 /*return*/, '0'];
889
897
  return [2 /*return*/, ethers_1.ethers.utils.formatUnits(res[res.length - 1], outputCoinDecimals)];
890
898
  }
891
899
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.24.4",
3
+ "version": "2.24.5",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",