impermax-sdk 2.1.89 → 2.1.92

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.
@@ -59,7 +59,7 @@ class OnchainInteractionsNftlpUniswapV3 extends onchainInteractionsNftlp_1.defau
59
59
  let approveB = 0;
60
60
  let withCollateralTransfer = tokenId != -1 && (borrowADelta > 0 || borrowBDelta > 0 || depositADelta < 0 || depositBDelta < 0);
61
61
  let doWithdrawEth = false;
62
- const actions = [];
62
+ let actions = [];
63
63
  if (depositADelta > 0 && depositBDelta < 0 || depositBDelta > 0 && depositADelta < 0)
64
64
  throw new Error("Opposite depositADelta and depositBDelta signs");
65
65
  const router = this.getUniswapV3Router();
@@ -117,7 +117,7 @@ class OnchainInteractionsNftlpUniswapV3 extends onchainInteractionsNftlp_1.defau
117
117
  // Mint
118
118
  if (depositADelta > 0 || depositBDelta > 0) {
119
119
  console.log("depositADelta, depositBDelta", depositADelta, depositBDelta);
120
- console.log((_a = (yield borrowableA.toBigNumber(depositADelta))) === null || _a === void 0 ? void 0 : _a.toNumber(), (_b = (yield borrowableA.toBigNumber(depositBDelta))) === null || _b === void 0 ? void 0 : _b.toNumber(), (_c = (yield borrowableA.toBigNumber(depositADelta / this.getUiMargin()))) === null || _c === void 0 ? void 0 : _c.toNumber(), (_d = (yield borrowableA.toBigNumber(depositBDelta / this.getUiMargin()))) === null || _d === void 0 ? void 0 : _d.toNumber());
120
+ console.log((_a = (yield borrowableA.toBigNumber(depositADelta))) === null || _a === void 0 ? void 0 : _a.toString(), (_b = (yield borrowableA.toBigNumber(depositBDelta))) === null || _b === void 0 ? void 0 : _b.toString(), (_c = (yield borrowableA.toBigNumber(depositADelta / this.getUiMargin()))) === null || _c === void 0 ? void 0 : _c.toString(), (_d = (yield borrowableA.toBigNumber(depositBDelta / this.getUiMargin()))) === null || _d === void 0 ? void 0 : _d.toString());
121
121
  actions.push(yield actionsGetter.methods.getMintUniV3Action(yield borrowableA.toBigNumber(depositADelta), yield borrowableB.toBigNumber(depositBDelta), yield borrowableA.toBigNumber(depositADelta / this.getUiMargin()), yield borrowableB.toBigNumber(depositBDelta / this.getUiMargin())).call());
122
122
  if (isEthA) {
123
123
  ethValue += depositADelta;
@@ -207,6 +207,7 @@ class OnchainInteractionsNftlpUniswapV3 extends onchainInteractionsNftlp_1.defau
207
207
  if (ethValue > 0 || doWithdrawEth) {
208
208
  actions.push(yield actionsGetter.methods.getWithdrawEthAction(this.getAccountAddress()).call());
209
209
  }
210
+ actions = [];
210
211
  return {
211
212
  actions,
212
213
  ethValue,
@@ -220,11 +221,12 @@ class OnchainInteractionsNftlpUniswapV3 extends onchainInteractionsNftlp_1.defau
220
221
  return __awaiter(this, void 0, void 0, function* () {
221
222
  const router = this.getUniswapV3Router();
222
223
  console.log("router", router._address);
224
+ console.log("getNftlpAddress", yield this.getNftlp().getNftlpAddress());
223
225
  console.log("tokenId", tokenId);
224
226
  console.log("actions", actions);
225
227
  console.log("permits", permits);
226
228
  console.log("withCollateralTransfer", withCollateralTransfer);
227
- console.log("ethValue", ethValue.toNumber());
229
+ console.log("ethValue", ethValue.toString());
228
230
  return this.getLendingPool().send(router.methods.execute(yield this.getNftlp().getNftlpAddress(), tokenId == -1 ? general_1.MAX_UINT : tokenId.toString(), this.encodeActions(actions), this.encodePermits(permits), withCollateralTransfer), onTransactionHash, ethValue);
229
231
  });
230
232
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.89",
3
+ "version": "2.1.92",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",