@morpho-org/bundler-sdk-viem 3.0.0-next.12 → 3.0.0-next.13

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/actions.js +6 -6
  2. package/package.json +4 -4
package/lib/actions.js CHANGED
@@ -413,7 +413,7 @@ export const encodeOperation = (operation, dataBefore, supportsSignature = true,
413
413
  }
414
414
  case "Blue_Supply": {
415
415
  const { id, assets = 0n, shares = 0n, onBehalf, slippage = DEFAULT_SLIPPAGE_TOLERANCE, } = operation.args;
416
- const market = dataBefore.getMarket(id);
416
+ const market = dataAfter.getMarket(id);
417
417
  const maxSharePrice = market.toSupplyAssets(MathLib.wToRay(MathLib.WAD + slippage));
418
418
  actions.push({
419
419
  type: "morphoSupply",
@@ -431,7 +431,7 @@ export const encodeOperation = (operation, dataBefore, supportsSignature = true,
431
431
  }
432
432
  case "Blue_Withdraw": {
433
433
  const { id, assets = 0n, shares = 0n, receiver, slippage = DEFAULT_SLIPPAGE_TOLERANCE, } = operation.args;
434
- const market = dataBefore.getMarket(id);
434
+ const market = dataAfter.getMarket(id);
435
435
  const minSharePrice = market.toSupplyAssets(MathLib.wToRay(MathLib.WAD - slippage));
436
436
  actions.push({
437
437
  type: "morphoWithdraw",
@@ -448,7 +448,7 @@ export const encodeOperation = (operation, dataBefore, supportsSignature = true,
448
448
  }
449
449
  case "Blue_Borrow": {
450
450
  const { id, assets = 0n, shares = 0n, receiver, slippage = DEFAULT_SLIPPAGE_TOLERANCE, } = operation.args;
451
- const market = dataBefore.getMarket(id);
451
+ const market = dataAfter.getMarket(id);
452
452
  const minSharePrice = market.toBorrowAssets(MathLib.wToRay(MathLib.WAD - slippage));
453
453
  actions.push({
454
454
  type: "morphoBorrow",
@@ -465,7 +465,7 @@ export const encodeOperation = (operation, dataBefore, supportsSignature = true,
465
465
  }
466
466
  case "Blue_Repay": {
467
467
  const { id, assets = 0n, shares = 0n, onBehalf, slippage = DEFAULT_SLIPPAGE_TOLERANCE, } = operation.args;
468
- const market = dataBefore.getMarket(id);
468
+ const market = dataAfter.getMarket(id);
469
469
  const maxSharePrice = market.toBorrowAssets(MathLib.wToRay(MathLib.WAD + slippage));
470
470
  actions.push({
471
471
  type: "morphoRepay",
@@ -522,7 +522,7 @@ export const encodeOperation = (operation, dataBefore, supportsSignature = true,
522
522
  }
523
523
  case "MetaMorpho_Deposit": {
524
524
  const { assets = 0n, shares = 0n, owner, slippage = DEFAULT_SLIPPAGE_TOLERANCE, } = operation.args;
525
- const vault = dataBefore.getVault(address);
525
+ const vault = dataAfter.getVault(address);
526
526
  const maxSharePrice = vault.toAssets(MathLib.wToRay(MathLib.WAD + slippage));
527
527
  if (shares === 0n)
528
528
  actions.push({
@@ -538,7 +538,7 @@ export const encodeOperation = (operation, dataBefore, supportsSignature = true,
538
538
  }
539
539
  case "MetaMorpho_Withdraw": {
540
540
  const { assets = 0n, shares = 0n, owner, receiver, slippage = DEFAULT_SLIPPAGE_TOLERANCE, } = operation.args;
541
- const vault = dataBefore.getVault(address);
541
+ const vault = dataAfter.getVault(address);
542
542
  const minSharePrice = vault.toAssets(MathLib.wToRay(MathLib.WAD - slippage));
543
543
  if (assets > 0n)
544
544
  actions.push({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morpho-org/bundler-sdk-viem",
3
3
  "description": "Viem-based extension of `@morpho-org/simulation-sdk` that exports utilities to transform simple interactions on Morpho (such as `Blue_Borrow`) and Morpho Vaults (such as `MetaMorpho_Deposit`) into the required bundles (with ERC20 approvals, transfers, etc) to submit to the bundler onchain.",
4
- "version": "3.0.0-next.12",
4
+ "version": "3.0.0-next.13",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "contributors": [
7
7
  "Rubilmax <rmilon@gmail.com>"
@@ -38,11 +38,11 @@
38
38
  "@morpho-org/blue-sdk": "^2.3.2",
39
39
  "@morpho-org/blue-sdk-viem": "^2.2.2",
40
40
  "@morpho-org/morpho-ts": "^2.2.0",
41
- "@morpho-org/morpho-test": "^2.2.1",
42
41
  "@morpho-org/simulation-sdk": "^2.1.4",
43
- "@morpho-org/simulation-sdk-wagmi": "^2.0.5",
42
+ "@morpho-org/morpho-test": "^2.2.1",
44
43
  "@morpho-org/test": "^2.1.0",
45
- "@morpho-org/test-wagmi": "^2.0.4"
44
+ "@morpho-org/test-wagmi": "^2.0.4",
45
+ "@morpho-org/simulation-sdk-wagmi": "^2.0.5"
46
46
  },
47
47
  "scripts": {
48
48
  "prepublish": "$npm_execpath build",