impermax-sdk 2.1.542 → 2.1.544

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.
@@ -27,6 +27,8 @@ class OnchainInteractionsNftlp {
27
27
  * Utilities
28
28
  */
29
29
  encodeActions(actions = []) {
30
+ console.log("actions");
31
+ console.log(actions);
30
32
  return ethers_1.ethers.utils.defaultAbiCoder.encode(['tuple(uint256 actionType, bytes actionData, bytes nextAction)[]'], [actions]);
31
33
  }
32
34
  }
@@ -72,7 +72,8 @@ class OnchainInteractionsNftlpGenericCL extends onchainInteractionsNftlp_1.defau
72
72
  // TODO understand when to flashallocate, and how much
73
73
  const ethVault = this.getNftlp().getLendingPool().getImpermaxFactory().getOnchain().getLendingVault("0x0988cc53b8ddd625c20e382f1af2f9c385e4f9a3");
74
74
  const availableLiquidity = await ethVault.getAvailableLiquidity();
75
- actions.push(await actionsGetter.methods.getFlashAllocateAction(0, "0x0988cc53b8ddd625c20e382f1af2f9c385e4f9a3", await borrowableA.toBigNumber(availableLiquidity)));
75
+ console.log("getFlashAllocateAction", "0", "0x0988cc53b8ddd625c20e382f1af2f9c385e4f9a3", await borrowableA.toBigNumber(availableLiquidity));
76
+ actions.push(await actionsGetter.methods.getFlashAllocateAction("0", "0x0988cc53b8ddd625c20e382f1af2f9c385e4f9a3", await borrowableA.toBigNumber(availableLiquidity)));
76
77
  // Borrow and mint
77
78
  if ((borrowADelta > 0 && depositADelta > 0) || (borrowBDelta > 0 && depositBDelta > 0)) {
78
79
  // slightly increase borrowDelta in order to avoid amountUser to be dust
@@ -40,7 +40,7 @@ class BorrowableEntity {
40
40
  return this.initialTotalSupply - this.initialTotalBorrows + 1e9;
41
41
  }
42
42
  getAvailableToBorrow() {
43
- return this.totalSupply - this.totalBorrows;
43
+ return this.totalSupply - this.totalBorrows + 1e9;
44
44
  }
45
45
  getInitialAvailableToWithdraw() {
46
46
  return this.initialTotalSupply - this.initialTotalBorrows;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impermax-sdk",
3
- "version": "2.1.542",
3
+ "version": "2.1.544",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",