@morpho-org/bundler-sdk-viem 4.1.0 → 4.1.1

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 +29 -8
  2. package/package.json +12 -12
package/lib/actions.js CHANGED
@@ -413,7 +413,9 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
413
413
  actions.push({
414
414
  type: "morphoSupply",
415
415
  args: [
416
- market.params,
416
+ // Avoid passing the reference of a revokable proxy that would fail
417
+ // accessing its underlying value after revocation.
418
+ (0, simulation_sdk_1.getCurrent)(market.params),
417
419
  assets,
418
420
  shares,
419
421
  maxSharePrice,
@@ -435,7 +437,9 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
435
437
  actions.push({
436
438
  type: "morphoWithdraw",
437
439
  args: [
438
- market.params,
440
+ // Avoid passing the reference of a revokable proxy that would fail
441
+ // accessing its underlying value after revocation.
442
+ (0, simulation_sdk_1.getCurrent)(market.params),
439
443
  assets,
440
444
  shares,
441
445
  minSharePrice,
@@ -456,7 +460,9 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
456
460
  actions.push({
457
461
  type: "morphoBorrow",
458
462
  args: [
459
- market.params,
463
+ // Avoid passing the reference of a revokable proxy that would fail
464
+ // accessing its underlying value after revocation.
465
+ (0, simulation_sdk_1.getCurrent)(market.params),
460
466
  assets,
461
467
  shares,
462
468
  minSharePrice,
@@ -477,7 +483,9 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
477
483
  actions.push({
478
484
  type: "morphoRepay",
479
485
  args: [
480
- market.params,
486
+ // Avoid passing the reference of a revokable proxy that would fail
487
+ // accessing its underlying value after revocation.
488
+ (0, simulation_sdk_1.getCurrent)(market.params),
481
489
  assets,
482
490
  shares,
483
491
  maxSharePrice,
@@ -509,7 +517,9 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
509
517
  actions.push({
510
518
  type: "morphoSupplyCollateral",
511
519
  args: [
512
- params,
520
+ // Avoid passing the reference of a revokable proxy that would fail
521
+ // accessing its underlying value after revocation.
522
+ (0, simulation_sdk_1.getCurrent)(params),
513
523
  assets,
514
524
  onBehalf,
515
525
  callbackBundle?.actions ?? [],
@@ -523,7 +533,14 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
523
533
  const { params } = dataBefore.getMarket(id);
524
534
  actions.push({
525
535
  type: "morphoWithdrawCollateral",
526
- args: [params, assets, receiver, operation.skipRevert],
536
+ args: [
537
+ // Avoid passing the reference of a revokable proxy that would fail
538
+ // accessing its underlying value after revocation.
539
+ (0, simulation_sdk_1.getCurrent)(params),
540
+ assets,
541
+ receiver,
542
+ operation.skipRevert,
543
+ ],
527
544
  });
528
545
  break;
529
546
  }
@@ -608,10 +625,14 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
608
625
  operation.address,
609
626
  fee,
610
627
  withdrawals.map(({ id, assets }) => ({
611
- marketParams: dataBefore.getMarket(id).params,
628
+ // Avoid passing the reference of a revokable proxy that would fail
629
+ // accessing its underlying value after revocation.
630
+ marketParams: (0, simulation_sdk_1.getCurrent)(dataBefore.getMarket(id).params),
612
631
  amount: assets,
613
632
  })),
614
- dataBefore.getMarket(supplyMarketId).params,
633
+ // Avoid passing the reference of a revokable proxy that would fail
634
+ // accessing its underlying value after revocation.
635
+ (0, simulation_sdk_1.getCurrent)(dataBefore.getMarket(supplyMarketId).params),
615
636
  operation.skipRevert,
616
637
  ],
617
638
  });
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": "4.1.0",
4
+ "version": "4.1.1",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "contributors": [
7
7
  "Rubilmax <rmilon@gmail.com>"
@@ -19,10 +19,10 @@
19
19
  ],
20
20
  "peerDependencies": {
21
21
  "viem": "^2.0.0",
22
- "@morpho-org/blue-sdk-viem": "^4.1.0",
23
- "@morpho-org/simulation-sdk": "^3.2.0",
22
+ "@morpho-org/blue-sdk": "^5.6.1",
23
+ "@morpho-org/simulation-sdk": "^3.2.1",
24
24
  "@morpho-org/morpho-ts": "^2.4.5",
25
- "@morpho-org/blue-sdk": "^5.6.0"
25
+ "@morpho-org/blue-sdk-viem": "^4.1.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@tanstack/query-core": "^5.62.16",
@@ -32,16 +32,16 @@
32
32
  "@types/lodash": "^4.17.12",
33
33
  "lodash": "^4.17.21",
34
34
  "typescript": "^5.7.2",
35
- "viem": "^2.33.3",
35
+ "viem": "^2.39.0",
36
36
  "vitest": "^3.0.5",
37
- "@morpho-org/blue-sdk": "^5.6.0",
38
- "@morpho-org/blue-sdk-viem": "^4.1.0",
37
+ "@morpho-org/blue-sdk-viem": "^4.1.1",
38
+ "@morpho-org/blue-sdk": "^5.6.1",
39
+ "@morpho-org/morpho-test": "^2.4.2",
39
40
  "@morpho-org/morpho-ts": "^2.4.5",
40
- "@morpho-org/morpho-test": "^2.4.1",
41
- "@morpho-org/simulation-sdk": "^3.2.0",
42
- "@morpho-org/simulation-sdk-wagmi": "^3.1.0",
43
- "@morpho-org/test": "^2.6.1",
44
- "@morpho-org/test-wagmi": "^2.0.5"
41
+ "@morpho-org/simulation-sdk": "^3.2.1",
42
+ "@morpho-org/simulation-sdk-wagmi": "^3.1.1",
43
+ "@morpho-org/test": "^2.6.2",
44
+ "@morpho-org/test-wagmi": "^2.0.6"
45
45
  },
46
46
  "scripts": {
47
47
  "prepublish": "$npm_execpath build",