@morpho-org/bundler-sdk-viem 3.0.0-next.8 → 3.0.0-next.9
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/actions.js +5 -5
- package/lib/operations.js +2 -1
- package/lib/types/operations.d.ts +1 -1
- package/lib/types/operations.js +1 -0
- package/package.json +8 -8
package/lib/actions.js
CHANGED
|
@@ -91,13 +91,13 @@ export const encodeOperation = (operation, dataBefore, supportsSignature = true,
|
|
|
91
91
|
const { sender, address } = operation;
|
|
92
92
|
switch (operation.type) {
|
|
93
93
|
case "Blue_SetAuthorization": {
|
|
94
|
-
const { owner } = operation.args;
|
|
94
|
+
const { owner, isAuthorized, authorized } = operation.args;
|
|
95
95
|
if (supportsSignature) {
|
|
96
96
|
const ownerData = dataBefore.getUser(owner);
|
|
97
97
|
const authorization = {
|
|
98
98
|
authorizer: owner,
|
|
99
|
-
authorized
|
|
100
|
-
isAuthorized
|
|
99
|
+
authorized,
|
|
100
|
+
isAuthorized,
|
|
101
101
|
deadline,
|
|
102
102
|
nonce: ownerData.morphoNonce,
|
|
103
103
|
};
|
|
@@ -130,13 +130,13 @@ export const encodeOperation = (operation, dataBefore, supportsSignature = true,
|
|
|
130
130
|
// Signatures are not supported, fallback to standard approval.
|
|
131
131
|
requirements.txs.push({
|
|
132
132
|
type: "morphoSetAuthorization",
|
|
133
|
-
args: [
|
|
133
|
+
args: [authorized, isAuthorized],
|
|
134
134
|
tx: {
|
|
135
135
|
to: morpho,
|
|
136
136
|
data: encodeFunctionData({
|
|
137
137
|
abi: blueAbi,
|
|
138
138
|
functionName: "setAuthorization",
|
|
139
|
-
args: [
|
|
139
|
+
args: [authorized, isAuthorized],
|
|
140
140
|
}),
|
|
141
141
|
},
|
|
142
142
|
});
|
package/lib/operations.js
CHANGED
|
@@ -179,7 +179,8 @@ export const populateSubBundle = (inputOperation, data, options = {}) => {
|
|
|
179
179
|
address: morpho,
|
|
180
180
|
args: {
|
|
181
181
|
owner: sender,
|
|
182
|
-
|
|
182
|
+
isAuthorized: true,
|
|
183
|
+
authorized: generalAdapter1,
|
|
183
184
|
},
|
|
184
185
|
});
|
|
185
186
|
// Reallocate liquidity if necessary.
|
|
@@ -21,7 +21,7 @@ export type CallbackBundlerOperations = {
|
|
|
21
21
|
[OperationType in CallbackBundlerOperationType]: WithOperationArgs<OperationType, BundlerOperationArgs>;
|
|
22
22
|
};
|
|
23
23
|
export type CallbackBundlerOperation = CallbackBundlerOperations[CallbackBundlerOperationType];
|
|
24
|
-
export declare const BLUE_INPUT_OPERATIONS: readonly ["Blue_Borrow", "Blue_Repay", "Blue_Supply", "Blue_SupplyCollateral", "Blue_Withdraw", "Blue_WithdrawCollateral"];
|
|
24
|
+
export declare const BLUE_INPUT_OPERATIONS: readonly ["Blue_Borrow", "Blue_Repay", "Blue_Supply", "Blue_SupplyCollateral", "Blue_Withdraw", "Blue_WithdrawCollateral", "Blue_SetAuthorization"];
|
|
25
25
|
export type BlueInputBundlerOperationType = (typeof BLUE_INPUT_OPERATIONS)[number];
|
|
26
26
|
export interface BlueInputBundlerOperationArgs extends Omit<OperationArgs, (typeof CALLBACK_OPERATIONS)[number]> {
|
|
27
27
|
Blue_SupplyCollateral: Omit<BlueOperationArgs["Blue_SupplyCollateral"], "callback"> & {
|
package/lib/types/operations.js
CHANGED
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.
|
|
4
|
+
"version": "3.0.0-next.9",
|
|
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": "^
|
|
24
|
-
"@morpho-org/
|
|
23
|
+
"@morpho-org/blue-sdk": "^3.0.0-next.13",
|
|
24
|
+
"@morpho-org/simulation-sdk": "^3.0.0-next.4",
|
|
25
25
|
"@morpho-org/morpho-ts": "^2.2.0",
|
|
26
|
-
"@morpho-org/
|
|
26
|
+
"@morpho-org/blue-sdk-viem": "^2.2.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@tanstack/query-core": "^5.62.16",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"typescript": "^5.7.2",
|
|
36
36
|
"viem": "^2.23.0",
|
|
37
37
|
"vitest": "^3.0.5",
|
|
38
|
-
"@morpho-org/blue-sdk": "^
|
|
38
|
+
"@morpho-org/blue-sdk": "^3.0.0-next.13",
|
|
39
39
|
"@morpho-org/blue-sdk-viem": "^2.2.2",
|
|
40
40
|
"@morpho-org/morpho-ts": "^2.2.0",
|
|
41
|
+
"@morpho-org/simulation-sdk": "^3.0.0-next.4",
|
|
41
42
|
"@morpho-org/morpho-test": "^2.2.1",
|
|
42
|
-
"@morpho-org/
|
|
43
|
+
"@morpho-org/test": "^2.0.6",
|
|
43
44
|
"@morpho-org/simulation-sdk-wagmi": "^2.0.5",
|
|
44
|
-
"@morpho-org/test-wagmi": "^2.0.4"
|
|
45
|
-
"@morpho-org/test": "^2.0.6"
|
|
45
|
+
"@morpho-org/test-wagmi": "^2.0.4"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"prepublish": "$npm_execpath build",
|