@morpho-org/bundler-sdk-viem 4.0.0 → 4.0.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 +3 -4
  2. package/package.json +8 -8
package/lib/actions.js CHANGED
@@ -135,8 +135,8 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
135
135
  // the signature can be used independently.
136
136
  if (spender !== generalAdapter1)
137
137
  throw new errors_js_1.BundlerErrors.UnexpectedSignature(spender);
138
+ const isDai = dai != null && operation.address === dai;
138
139
  if (supportsSignature) {
139
- const isDai = dai != null && operation.address === dai;
140
140
  const action = isDai
141
141
  ? {
142
142
  type: "permitDai",
@@ -211,10 +211,9 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
211
211
  break;
212
212
  }
213
213
  // Simple permit is not supported, fallback to standard approval.
214
- // Ignore zero permits used to reset allowances at the end of a bundle
214
+ // Ignore DAI-specific zero permits used to reset allowances at the end of a bundle
215
215
  // when the signer does not support signatures, as they cannot be bundled.
216
- // Currently only used by DAI-specific permit which does not support specific amounts.
217
- if (amount > 0n)
216
+ if (amount > 0n || !isDai)
218
217
  requirements.txs.push(...encodeErc20Approval(operation.address, spender, amount, dataBefore));
219
218
  break;
220
219
  }
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.0.0",
4
+ "version": "4.0.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": "^5.2.0",
22
23
  "@morpho-org/blue-sdk-viem": "^4.0.0",
23
- "@morpho-org/simulation-sdk": "^3.1.3",
24
- "@morpho-org/blue-sdk": "^5.0.0",
25
- "@morpho-org/morpho-ts": "^2.4.3"
24
+ "@morpho-org/morpho-ts": "^2.4.3",
25
+ "@morpho-org/simulation-sdk": "^3.1.3"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@tanstack/query-core": "^5.62.16",
@@ -34,14 +34,14 @@
34
34
  "typescript": "^5.7.2",
35
35
  "viem": "^2.23.0",
36
36
  "vitest": "^3.0.5",
37
- "@morpho-org/blue-sdk": "^5.0.0",
38
- "@morpho-org/blue-sdk-viem": "^4.0.0",
39
37
  "@morpho-org/morpho-test": "^2.4.0",
38
+ "@morpho-org/blue-sdk": "^5.2.0",
39
+ "@morpho-org/blue-sdk-viem": "^4.0.0",
40
40
  "@morpho-org/morpho-ts": "^2.4.3",
41
41
  "@morpho-org/simulation-sdk": "^3.1.3",
42
42
  "@morpho-org/simulation-sdk-wagmi": "^3.0.3",
43
- "@morpho-org/test": "^2.6.0",
44
- "@morpho-org/test-wagmi": "^2.0.4"
43
+ "@morpho-org/test-wagmi": "^2.0.4",
44
+ "@morpho-org/test": "^2.6.0"
45
45
  },
46
46
  "scripts": {
47
47
  "prepublish": "$npm_execpath build",