@morpho-org/bundler-sdk-viem 2.0.0-next.33 → 2.0.0-next.35
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.
- package/lib/BundlerAction.d.ts +2 -1
- package/lib/BundlerAction.js +6 -6
- package/lib/actions.js +1 -2
- package/lib/types/actions.d.ts +1 -2
- package/package.json +12 -12
package/lib/BundlerAction.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { InputMarketParams } from "@morpho-org/blue-sdk";
|
|
1
2
|
import { type Address, type Hex } from "viem";
|
|
2
|
-
import type { Action, Authorization,
|
|
3
|
+
import type { Action, Authorization, InputReallocation, Permit2PermitSingle } from "./types/index.js";
|
|
3
4
|
export type BundlerCall = Hex;
|
|
4
5
|
/**
|
|
5
6
|
* Namespace to easily encode calls to the Bundler contract, using ethers.
|
package/lib/BundlerAction.js
CHANGED
|
@@ -28,20 +28,20 @@ export var BundlerAction;
|
|
|
28
28
|
/* Permit */
|
|
29
29
|
case "permit": {
|
|
30
30
|
const [asset, amount, deadline, signature, skipRevert = true] = args;
|
|
31
|
-
if (signature
|
|
31
|
+
if (signature == null)
|
|
32
32
|
throw new BundlerErrors.MissingSignature();
|
|
33
33
|
return BundlerAction.permit(asset, amount, deadline, signature, skipRevert);
|
|
34
34
|
}
|
|
35
35
|
case "permitDai": {
|
|
36
36
|
const [nonce, expiry, allowed, signature, skipRevert = true] = args;
|
|
37
|
-
if (signature
|
|
37
|
+
if (signature == null)
|
|
38
38
|
throw new BundlerErrors.MissingSignature();
|
|
39
39
|
return BundlerAction.permitDai(nonce, expiry, allowed, signature, skipRevert);
|
|
40
40
|
}
|
|
41
41
|
/* Permit2 */
|
|
42
42
|
case "approve2": {
|
|
43
43
|
const [permitSingle, signature, skipRevert = true] = args;
|
|
44
|
-
if (signature
|
|
44
|
+
if (signature == null)
|
|
45
45
|
throw new BundlerErrors.MissingSignature();
|
|
46
46
|
return BundlerAction.approve2(permitSingle, signature, skipRevert);
|
|
47
47
|
}
|
|
@@ -64,7 +64,7 @@ export var BundlerAction;
|
|
|
64
64
|
/* Morpho */
|
|
65
65
|
case "morphoSetAuthorizationWithSig": {
|
|
66
66
|
const [authorization, signature, skipRevert = true] = args;
|
|
67
|
-
if (signature
|
|
67
|
+
if (signature == null)
|
|
68
68
|
throw new BundlerErrors.MissingSignature();
|
|
69
69
|
return BundlerAction.morphoSetAuthorizationWithSig(authorization, signature, skipRevert);
|
|
70
70
|
}
|
|
@@ -149,7 +149,7 @@ export var BundlerAction;
|
|
|
149
149
|
}
|
|
150
150
|
case "aaveV3OptimizerApproveManagerWithSig": {
|
|
151
151
|
const [isApproved, nonce, deadline, signature, skipRevert = true] = args;
|
|
152
|
-
if (signature
|
|
152
|
+
if (signature == null)
|
|
153
153
|
throw new BundlerErrors.MissingSignature();
|
|
154
154
|
return BundlerAction.aaveV3OptimizerApproveManagerWithSig(isApproved, nonce, deadline, signature, skipRevert);
|
|
155
155
|
}
|
|
@@ -169,7 +169,7 @@ export var BundlerAction;
|
|
|
169
169
|
}
|
|
170
170
|
case "compoundV3AllowBySig": {
|
|
171
171
|
const [instance, isAllowed, nonce, expiry, signature, skipRevert = true,] = args;
|
|
172
|
-
if (signature
|
|
172
|
+
if (signature == null)
|
|
173
173
|
throw new BundlerErrors.MissingSignature();
|
|
174
174
|
return BundlerAction.compoundV3AllowBySig(instance, isAllowed, nonce, expiry, signature, skipRevert);
|
|
175
175
|
}
|
package/lib/actions.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ChainId, MathLib, NATIVE_ADDRESS, convexWrapperTokens, erc20WrapperToke
|
|
|
3
3
|
import { Time, getValue } from "@morpho-org/morpho-ts";
|
|
4
4
|
import { simulateOperation, } from "@morpho-org/simulation-sdk";
|
|
5
5
|
import { blueAbi, getAuthorizationTypedData, getDaiPermitTypedData, getPermit2PermitTypedData, getPermitTypedData, } from "@morpho-org/blue-sdk-viem";
|
|
6
|
-
import {
|
|
6
|
+
import { signTypedData } from "viem/actions";
|
|
7
7
|
import BundlerAction from "./BundlerAction.js";
|
|
8
8
|
import { baseBundlerAbi } from "./abis.js";
|
|
9
9
|
export const APPROVE_ONLY_ONCE_TOKENS = {
|
|
@@ -615,7 +615,6 @@ export function encodeBundle(operations, startData, supportsSignature = true) {
|
|
|
615
615
|
requirements.signatures.push(...bundle.requirements.signatures);
|
|
616
616
|
requirements.txs.push(...bundle.requirements.txs);
|
|
617
617
|
}
|
|
618
|
-
sendTransaction;
|
|
619
618
|
return {
|
|
620
619
|
steps,
|
|
621
620
|
actions,
|
package/lib/types/actions.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Account, Chain, Client, Hex, SendTransactionRequest, Transport } from "viem";
|
|
2
|
-
import type { Address,
|
|
2
|
+
import type { Address, InputMarketParams } from "@morpho-org/blue-sdk";
|
|
3
3
|
import type { SimulationResult } from "@morpho-org/simulation-sdk";
|
|
4
|
-
export type InputMarketParams = Pick<MarketParams, "loanToken" | "collateralToken" | "oracle" | "irm" | "lltv">;
|
|
5
4
|
export interface Authorization {
|
|
6
5
|
authorizer: Address;
|
|
7
6
|
authorized: Address;
|
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": "2.0.0-next.
|
|
4
|
+
"version": "2.0.0-next.35",
|
|
5
5
|
"author": "Morpho Association <contact@morpho.org>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Rubilmax <rmilon@gmail.com>"
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
],
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"viem": "^2.0.0",
|
|
23
|
-
"@morpho-org/blue-sdk": "^2.0.0-next.
|
|
24
|
-
"@morpho-org/blue-sdk
|
|
25
|
-
"@morpho-org/
|
|
26
|
-
"@morpho-org/
|
|
23
|
+
"@morpho-org/blue-sdk-viem": "^2.0.0-next.33",
|
|
24
|
+
"@morpho-org/blue-sdk": "^2.0.0-next.33",
|
|
25
|
+
"@morpho-org/morpho-ts": "^2.0.0-next.16",
|
|
26
|
+
"@morpho-org/simulation-sdk": "^2.0.0-next.31"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@tanstack/query-core": "^5.60.5",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"typescript": "^5.7.2",
|
|
36
36
|
"viem": "^2.21.54",
|
|
37
37
|
"vitest": "^2.1.8",
|
|
38
|
-
"@morpho-org/blue-sdk": "^2.0.0-next.
|
|
39
|
-
"@morpho-org/blue-sdk-viem": "^2.0.0-next.
|
|
40
|
-
"@morpho-org/morpho-test": "^2.0.0-next.
|
|
38
|
+
"@morpho-org/blue-sdk": "^2.0.0-next.33",
|
|
39
|
+
"@morpho-org/blue-sdk-viem": "^2.0.0-next.33",
|
|
40
|
+
"@morpho-org/morpho-test": "^2.0.0-next.23",
|
|
41
41
|
"@morpho-org/morpho-ts": "^2.0.0-next.16",
|
|
42
|
-
"@morpho-org/simulation-sdk": "^2.0.0-next.
|
|
43
|
-
"@morpho-org/simulation-sdk-wagmi": "^2.0.0-next.
|
|
44
|
-
"@morpho-org/test": "^2.0.0-next.
|
|
45
|
-
"@morpho-org/test
|
|
42
|
+
"@morpho-org/simulation-sdk": "^2.0.0-next.31",
|
|
43
|
+
"@morpho-org/simulation-sdk-wagmi": "^2.0.0-next.26",
|
|
44
|
+
"@morpho-org/test-wagmi": "^2.0.0-next.25",
|
|
45
|
+
"@morpho-org/test": "^2.0.0-next.28"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"prepublish": "$npm_execpath build",
|