damm-sdk 1.4.34 → 1.4.36

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.
@@ -20,6 +20,7 @@ export * from "./erc721";
20
20
  export * from "./iporFusion";
21
21
  export * from "./originArm";
22
22
  export * from "./etherfi";
23
+ export * from "./lido";
23
24
  export * from "./syrup";
24
25
  export * from "./gearbox";
25
26
  export * from "./fluidLite";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./lido";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/lido/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,96 @@
1
+ export declare const LidoStEthAbi: readonly [{
2
+ readonly inputs: readonly [{
3
+ readonly internalType: "address";
4
+ readonly name: "_referral";
5
+ readonly type: "address";
6
+ }];
7
+ readonly name: "submit";
8
+ readonly outputs: readonly [{
9
+ readonly internalType: "uint256";
10
+ readonly name: "";
11
+ readonly type: "uint256";
12
+ }];
13
+ readonly stateMutability: "payable";
14
+ readonly type: "function";
15
+ }];
16
+ export declare const LidoWstEthAbi: readonly [{
17
+ readonly inputs: readonly [{
18
+ readonly internalType: "uint256";
19
+ readonly name: "_stETHAmount";
20
+ readonly type: "uint256";
21
+ }];
22
+ readonly name: "wrap";
23
+ readonly outputs: readonly [{
24
+ readonly internalType: "uint256";
25
+ readonly name: "";
26
+ readonly type: "uint256";
27
+ }];
28
+ readonly stateMutability: "nonpayable";
29
+ readonly type: "function";
30
+ }, {
31
+ readonly inputs: readonly [{
32
+ readonly internalType: "uint256";
33
+ readonly name: "_wstETHAmount";
34
+ readonly type: "uint256";
35
+ }];
36
+ readonly name: "unwrap";
37
+ readonly outputs: readonly [{
38
+ readonly internalType: "uint256";
39
+ readonly name: "";
40
+ readonly type: "uint256";
41
+ }];
42
+ readonly stateMutability: "nonpayable";
43
+ readonly type: "function";
44
+ }];
45
+ export declare const LidoWithdrawalQueueAbi: readonly [{
46
+ readonly inputs: readonly [{
47
+ readonly internalType: "uint256[]";
48
+ readonly name: "_amounts";
49
+ readonly type: "uint256[]";
50
+ }, {
51
+ readonly internalType: "address";
52
+ readonly name: "_owner";
53
+ readonly type: "address";
54
+ }];
55
+ readonly name: "requestWithdrawals";
56
+ readonly outputs: readonly [{
57
+ readonly internalType: "uint256[]";
58
+ readonly name: "requestIds";
59
+ readonly type: "uint256[]";
60
+ }];
61
+ readonly stateMutability: "nonpayable";
62
+ readonly type: "function";
63
+ }, {
64
+ readonly inputs: readonly [{
65
+ readonly internalType: "uint256[]";
66
+ readonly name: "_amounts";
67
+ readonly type: "uint256[]";
68
+ }, {
69
+ readonly internalType: "address";
70
+ readonly name: "_owner";
71
+ readonly type: "address";
72
+ }];
73
+ readonly name: "requestWithdrawalsWstETH";
74
+ readonly outputs: readonly [{
75
+ readonly internalType: "uint256[]";
76
+ readonly name: "requestIds";
77
+ readonly type: "uint256[]";
78
+ }];
79
+ readonly stateMutability: "nonpayable";
80
+ readonly type: "function";
81
+ }, {
82
+ readonly inputs: readonly [{
83
+ readonly internalType: "uint256[]";
84
+ readonly name: "_requestIds";
85
+ readonly type: "uint256[]";
86
+ }, {
87
+ readonly internalType: "uint256[]";
88
+ readonly name: "_hints";
89
+ readonly type: "uint256[]";
90
+ }];
91
+ readonly name: "claimWithdrawals";
92
+ readonly outputs: readonly [];
93
+ readonly stateMutability: "nonpayable";
94
+ readonly type: "function";
95
+ }];
96
+ //# sourceMappingURL=lido.abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lido.abi.d.ts","sourceRoot":"","sources":["../../../src/integrations/lido/lido.abi.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;EAQf,CAAC;AAGX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAehB,CAAC;AAKX,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BzB,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { Address } from "viem";
2
+ import type { HexString, Unwrapable, Call } from "../../types";
3
+ export type SubmitLidoArgs = Readonly<{
4
+ referral: Address;
5
+ }>;
6
+ export declare const SubmitLidoCalldata: ({ referral }: SubmitLidoArgs) => HexString;
7
+ export declare const submitLidoTrx: ({ args, stEthAddress, value, }: {
8
+ args: SubmitLidoArgs;
9
+ stEthAddress: Address;
10
+ value: bigint;
11
+ }) => Unwrapable<Call>;
12
+ export type WrapStEthLidoArgs = Readonly<{
13
+ stEthAmount: bigint;
14
+ }>;
15
+ export declare const WrapStEthLidoCalldata: ({ stEthAmount }: WrapStEthLidoArgs) => HexString;
16
+ export declare const wrapStEthLidoTrx: ({ args, wstEthAddress, }: {
17
+ args: WrapStEthLidoArgs;
18
+ wstEthAddress: Address;
19
+ }) => Unwrapable<Call>;
20
+ export type UnwrapWstEthLidoArgs = Readonly<{
21
+ wstEthAmount: bigint;
22
+ }>;
23
+ export declare const UnwrapWstEthLidoCalldata: ({ wstEthAmount }: UnwrapWstEthLidoArgs) => HexString;
24
+ export declare const unwrapWstEthLidoTrx: ({ args, wstEthAddress, }: {
25
+ args: UnwrapWstEthLidoArgs;
26
+ wstEthAddress: Address;
27
+ }) => Unwrapable<Call>;
28
+ export type RequestWithdrawalsLidoArgs = Readonly<{
29
+ amounts: readonly bigint[];
30
+ owner: Address;
31
+ }>;
32
+ export declare const RequestWithdrawalsLidoCalldata: ({ amounts, owner }: RequestWithdrawalsLidoArgs) => HexString;
33
+ export declare const requestWithdrawalsLidoTrx: ({ args, withdrawalQueueAddress, }: {
34
+ args: RequestWithdrawalsLidoArgs;
35
+ withdrawalQueueAddress: Address;
36
+ }) => Unwrapable<Call>;
37
+ export type RequestWithdrawalsWstEthLidoArgs = Readonly<{
38
+ amounts: readonly bigint[];
39
+ owner: Address;
40
+ }>;
41
+ export declare const RequestWithdrawalsWstEthLidoCalldata: ({ amounts, owner, }: RequestWithdrawalsWstEthLidoArgs) => HexString;
42
+ export declare const requestWithdrawalsWstEthLidoTrx: ({ args, withdrawalQueueAddress, }: {
43
+ args: RequestWithdrawalsWstEthLidoArgs;
44
+ withdrawalQueueAddress: Address;
45
+ }) => Unwrapable<Call>;
46
+ export type ClaimWithdrawalsLidoArgs = Readonly<{
47
+ requestIds: readonly bigint[];
48
+ hints: readonly bigint[];
49
+ }>;
50
+ export declare const ClaimWithdrawalsLidoCalldata: ({ requestIds, hints }: ClaimWithdrawalsLidoArgs) => HexString;
51
+ export declare const claimWithdrawalsLidoTrx: ({ args, withdrawalQueueAddress, }: {
52
+ args: ClaimWithdrawalsLidoArgs;
53
+ withdrawalQueueAddress: Address;
54
+ }) => Unwrapable<Call>;
55
+ //# sourceMappingURL=lido.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lido.d.ts","sourceRoot":"","sources":["../../../src/integrations/lido/lido.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAW/D,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IAClC,QAAQ,EAAE,OAAO,CA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AAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC5C,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B,CAAC,CAAC;AAEH,eAAO,MAAM,4BAA4B,0BAA2B,wBAAwB,KAAG,SAE9F,CAAC;AAEF,eAAO,MAAM,uBAAuB;UAI1B,wBAAwB;4BACN,OAAO;MAC/B,WAAW,IAAI,CAOlB,CAAC"}
@@ -68,4 +68,15 @@ export declare const withdrawMorphoVaultTrx: ({ args, morphoVaultAddress, }: {
68
68
  args: RedeemMorphoVaultArgs;
69
69
  morphoVaultAddress: Address;
70
70
  }) => Unwrapable<Call>;
71
+ export type ForceDeallocateMorphoVaultArgs = Readonly<{
72
+ adapter: Address;
73
+ data: HexString;
74
+ assets: bigint;
75
+ onBehalf: Address;
76
+ }>;
77
+ export declare const ForceDeallocateMorphoVaultCalldata: ({ adapter, data, assets, onBehalf, }: ForceDeallocateMorphoVaultArgs) => HexString;
78
+ export declare const forceDeallocateMorphoVaultTrx: ({ args, morphoVaultAddress, }: {
79
+ args: ForceDeallocateMorphoVaultArgs;
80
+ morphoVaultAddress: Address;
81
+ }) => Unwrapable<Call>;
71
82
  //# sourceMappingURL=morpho.vault.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"morpho.vault.d.ts","sourceRoot":"","sources":["../../../src/integrations/morphoVault/morpho.vault.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAS/D,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH,eAAO,MAAM,0BAA0B,yBAA0B,sBAAsB,KAAG,SAEzF,CAAC;AAEF,eAA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AM,8BAA8B,GAAG,QAAQ,CAAC;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH,eAAO,MAAM,kCAAkC,yCAK5C,8BAA8B,KAAG,SAEnC,CAAC;AAEF,eAAO,MAAM,6BAA6B;UAIhC,8BAA8B;wBAChB,OAAO;MAC3B,WAAW,IAAI,CAOlB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Morpho Vault V2-only ABI fragments. These are not present on V1 vaults.
3
+ *
4
+ * `forceDeallocate(adapter, data, assets, onBehalf)` is the LP escape hatch
5
+ * — it pays the curator-set `forceDeallocatePenalty(adapter)` and pulls
6
+ * `assets` worth of underlying out of the named adapter back to vault idle.
7
+ * V2 vaults expose this so a depositor can force liquidity from a single
8
+ * adapter without waiting for the curator's reallocation.
9
+ */
10
+ export declare const MorphoVaultV2Abi: readonly [{
11
+ readonly inputs: readonly [{
12
+ readonly internalType: "address";
13
+ readonly name: "adapter";
14
+ readonly type: "address";
15
+ }, {
16
+ readonly internalType: "bytes";
17
+ readonly name: "data";
18
+ readonly type: "bytes";
19
+ }, {
20
+ readonly internalType: "uint256";
21
+ readonly name: "assets";
22
+ readonly type: "uint256";
23
+ }, {
24
+ readonly internalType: "address";
25
+ readonly name: "onBehalf";
26
+ readonly type: "address";
27
+ }];
28
+ readonly name: "forceDeallocate";
29
+ readonly outputs: readonly [{
30
+ readonly internalType: "uint256";
31
+ readonly name: "";
32
+ readonly type: "uint256";
33
+ }];
34
+ readonly stateMutability: "nonpayable";
35
+ readonly type: "function";
36
+ }];
37
+ //# sourceMappingURL=morpho.vault.v2.abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"morpho.vault.v2.abi.d.ts","sourceRoot":"","sources":["../../../src/integrations/morphoVault/morpho.vault.v2.abi.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;EAanB,CAAC"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "./dist/index.cjs",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
7
- "version": "1.4.34",
7
+ "version": "1.4.36",
8
8
  "files": [
9
9
  "dist",
10
10
  "src",
@@ -20,6 +20,7 @@ export * from "./erc721";
20
20
  export * from "./iporFusion";
21
21
  export * from "./originArm";
22
22
  export * from "./etherfi";
23
+ export * from "./lido";
23
24
  export * from "./syrup";
24
25
  export * from "./gearbox";
25
26
  export * from "./fluidLite";
@@ -0,0 +1 @@
1
+ export * from "./lido";
@@ -0,0 +1,64 @@
1
+ // Lido stETH (Lido staking pool — `submit` mints stETH 1:1 on ETH).
2
+ export const LidoStEthAbi = [
3
+ {
4
+ inputs: [{ internalType: "address", name: "_referral", type: "address" }],
5
+ name: "submit",
6
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
7
+ stateMutability: "payable",
8
+ type: "function",
9
+ },
10
+ ] as const;
11
+
12
+ // Lido wstETH wrapper — wraps rebasing stETH into non-rebasing wstETH.
13
+ export const LidoWstEthAbi = [
14
+ {
15
+ inputs: [{ internalType: "uint256", name: "_stETHAmount", type: "uint256" }],
16
+ name: "wrap",
17
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
18
+ stateMutability: "nonpayable",
19
+ type: "function",
20
+ },
21
+ {
22
+ inputs: [{ internalType: "uint256", name: "_wstETHAmount", type: "uint256" }],
23
+ name: "unwrap",
24
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
25
+ stateMutability: "nonpayable",
26
+ type: "function",
27
+ },
28
+ ] as const;
29
+
30
+ // Lido WithdrawalQueue — async unstake. requestWithdrawals burns stETH and mints
31
+ // an NFT per amount; claimWithdrawals redeems the NFT for ETH after the
32
+ // network-level oracle finalizes the request.
33
+ export const LidoWithdrawalQueueAbi = [
34
+ {
35
+ inputs: [
36
+ { internalType: "uint256[]", name: "_amounts", type: "uint256[]" },
37
+ { internalType: "address", name: "_owner", type: "address" },
38
+ ],
39
+ name: "requestWithdrawals",
40
+ outputs: [{ internalType: "uint256[]", name: "requestIds", type: "uint256[]" }],
41
+ stateMutability: "nonpayable",
42
+ type: "function",
43
+ },
44
+ {
45
+ inputs: [
46
+ { internalType: "uint256[]", name: "_amounts", type: "uint256[]" },
47
+ { internalType: "address", name: "_owner", type: "address" },
48
+ ],
49
+ name: "requestWithdrawalsWstETH",
50
+ outputs: [{ internalType: "uint256[]", name: "requestIds", type: "uint256[]" }],
51
+ stateMutability: "nonpayable",
52
+ type: "function",
53
+ },
54
+ {
55
+ inputs: [
56
+ { internalType: "uint256[]", name: "_requestIds", type: "uint256[]" },
57
+ { internalType: "uint256[]", name: "_hints", type: "uint256[]" },
58
+ ],
59
+ name: "claimWithdrawals",
60
+ outputs: [],
61
+ stateMutability: "nonpayable",
62
+ type: "function",
63
+ },
64
+ ] as const;
@@ -0,0 +1,186 @@
1
+ import { ethers } from "ethers";
2
+ import { LidoStEthAbi, LidoWstEthAbi, LidoWithdrawalQueueAbi } from "./lido.abi";
3
+ import type { Address } from "viem";
4
+ import type { HexString, Unwrapable, Call } from "../../types";
5
+ import { createCall } from "../../types";
6
+
7
+ const stEthInterface = new ethers.utils.Interface(LidoStEthAbi);
8
+ const wstEthInterface = new ethers.utils.Interface(LidoWstEthAbi);
9
+ const withdrawalQueueInterface = new ethers.utils.Interface(LidoWithdrawalQueueAbi);
10
+
11
+ // ============================================================================
12
+ // Submit (stake ETH for stETH, payable)
13
+ // ============================================================================
14
+
15
+ export type SubmitLidoArgs = Readonly<{
16
+ referral: Address;
17
+ }>;
18
+
19
+ export const SubmitLidoCalldata = ({ referral }: SubmitLidoArgs): HexString => {
20
+ return stEthInterface.encodeFunctionData("submit", [referral]) as HexString;
21
+ };
22
+
23
+ export const submitLidoTrx = ({
24
+ args,
25
+ stEthAddress,
26
+ value,
27
+ }: {
28
+ args: SubmitLidoArgs;
29
+ stEthAddress: Address;
30
+ value: bigint;
31
+ }): Unwrapable<Call> => {
32
+ return createCall({
33
+ operation: 0,
34
+ to: stEthAddress,
35
+ value,
36
+ data: SubmitLidoCalldata(args),
37
+ });
38
+ };
39
+
40
+ // ============================================================================
41
+ // Wrap stETH → wstETH
42
+ // ============================================================================
43
+
44
+ export type WrapStEthLidoArgs = Readonly<{
45
+ stEthAmount: bigint;
46
+ }>;
47
+
48
+ export const WrapStEthLidoCalldata = ({ stEthAmount }: WrapStEthLidoArgs): HexString => {
49
+ return wstEthInterface.encodeFunctionData("wrap", [stEthAmount]) as HexString;
50
+ };
51
+
52
+ export const wrapStEthLidoTrx = ({
53
+ args,
54
+ wstEthAddress,
55
+ }: {
56
+ args: WrapStEthLidoArgs;
57
+ wstEthAddress: Address;
58
+ }): Unwrapable<Call> => {
59
+ return createCall({
60
+ operation: 0,
61
+ to: wstEthAddress,
62
+ value: 0n,
63
+ data: WrapStEthLidoCalldata(args),
64
+ });
65
+ };
66
+
67
+ // ============================================================================
68
+ // Unwrap wstETH → stETH
69
+ // ============================================================================
70
+
71
+ export type UnwrapWstEthLidoArgs = Readonly<{
72
+ wstEthAmount: bigint;
73
+ }>;
74
+
75
+ export const UnwrapWstEthLidoCalldata = ({ wstEthAmount }: UnwrapWstEthLidoArgs): HexString => {
76
+ return wstEthInterface.encodeFunctionData("unwrap", [wstEthAmount]) as HexString;
77
+ };
78
+
79
+ export const unwrapWstEthLidoTrx = ({
80
+ args,
81
+ wstEthAddress,
82
+ }: {
83
+ args: UnwrapWstEthLidoArgs;
84
+ wstEthAddress: Address;
85
+ }): Unwrapable<Call> => {
86
+ return createCall({
87
+ operation: 0,
88
+ to: wstEthAddress,
89
+ value: 0n,
90
+ data: UnwrapWstEthLidoCalldata(args),
91
+ });
92
+ };
93
+
94
+ // ============================================================================
95
+ // Request Withdrawals (stETH → batched NFTs)
96
+ //
97
+ // Owner is set to the avatar safe. The contract enforces a per-request max
98
+ // (currently 1000 stETH); larger withdrawals must be split across `amounts`.
99
+ // ============================================================================
100
+
101
+ export type RequestWithdrawalsLidoArgs = Readonly<{
102
+ amounts: readonly bigint[];
103
+ owner: Address;
104
+ }>;
105
+
106
+ export const RequestWithdrawalsLidoCalldata = ({ amounts, owner }: RequestWithdrawalsLidoArgs): HexString => {
107
+ return withdrawalQueueInterface.encodeFunctionData("requestWithdrawals", [amounts, owner]) as HexString;
108
+ };
109
+
110
+ export const requestWithdrawalsLidoTrx = ({
111
+ args,
112
+ withdrawalQueueAddress,
113
+ }: {
114
+ args: RequestWithdrawalsLidoArgs;
115
+ withdrawalQueueAddress: Address;
116
+ }): Unwrapable<Call> => {
117
+ return createCall({
118
+ operation: 0,
119
+ to: withdrawalQueueAddress,
120
+ value: 0n,
121
+ data: RequestWithdrawalsLidoCalldata(args),
122
+ });
123
+ };
124
+
125
+ // ============================================================================
126
+ // Request Withdrawals from wstETH (wstETH-denominated input)
127
+ // ============================================================================
128
+
129
+ export type RequestWithdrawalsWstEthLidoArgs = Readonly<{
130
+ amounts: readonly bigint[];
131
+ owner: Address;
132
+ }>;
133
+
134
+ export const RequestWithdrawalsWstEthLidoCalldata = ({
135
+ amounts,
136
+ owner,
137
+ }: RequestWithdrawalsWstEthLidoArgs): HexString => {
138
+ return withdrawalQueueInterface.encodeFunctionData("requestWithdrawalsWstETH", [amounts, owner]) as HexString;
139
+ };
140
+
141
+ export const requestWithdrawalsWstEthLidoTrx = ({
142
+ args,
143
+ withdrawalQueueAddress,
144
+ }: {
145
+ args: RequestWithdrawalsWstEthLidoArgs;
146
+ withdrawalQueueAddress: Address;
147
+ }): Unwrapable<Call> => {
148
+ return createCall({
149
+ operation: 0,
150
+ to: withdrawalQueueAddress,
151
+ value: 0n,
152
+ data: RequestWithdrawalsWstEthLidoCalldata(args),
153
+ });
154
+ };
155
+
156
+ // ============================================================================
157
+ // Claim Withdrawals
158
+ //
159
+ // `requestIds` and `hints` must be the same length. Hints come from the
160
+ // off-chain `findCheckpointHints` call (or 0 to fall back to a slow on-chain
161
+ // scan). Operator passes them in directly.
162
+ // ============================================================================
163
+
164
+ export type ClaimWithdrawalsLidoArgs = Readonly<{
165
+ requestIds: readonly bigint[];
166
+ hints: readonly bigint[];
167
+ }>;
168
+
169
+ export const ClaimWithdrawalsLidoCalldata = ({ requestIds, hints }: ClaimWithdrawalsLidoArgs): HexString => {
170
+ return withdrawalQueueInterface.encodeFunctionData("claimWithdrawals", [requestIds, hints]) as HexString;
171
+ };
172
+
173
+ export const claimWithdrawalsLidoTrx = ({
174
+ args,
175
+ withdrawalQueueAddress,
176
+ }: {
177
+ args: ClaimWithdrawalsLidoArgs;
178
+ withdrawalQueueAddress: Address;
179
+ }): Unwrapable<Call> => {
180
+ return createCall({
181
+ operation: 0,
182
+ to: withdrawalQueueAddress,
183
+ value: 0n,
184
+ data: ClaimWithdrawalsLidoCalldata(args),
185
+ });
186
+ };
@@ -1,10 +1,12 @@
1
1
  import { ethers } from "ethers";
2
2
  import MorphoVaultAbi from "./morpho.vault.abi";
3
+ import { MorphoVaultV2Abi } from "./morpho.vault.v2.abi";
3
4
  import type { Address } from "viem";
4
5
  import type { HexString, Unwrapable, Call } from "../../types";
5
6
  import { createCall } from "../../types";
6
7
 
7
8
  const morphoVaultInterface = new ethers.utils.Interface(MorphoVaultAbi);
9
+ const morphoVaultV2Interface = new ethers.utils.Interface(MorphoVaultV2Abi);
8
10
 
9
11
  // ============================================================================
10
12
  // Deposit (ERC4626)
@@ -138,3 +140,46 @@ export const WithdrawMorphoVaultCalldata = RedeemMorphoVaultCalldata;
138
140
  * is the correct ERC4626 method for shares-based withdrawals.
139
141
  */
140
142
  export const withdrawMorphoVaultTrx = redeemMorphoVaultTrx;
143
+
144
+ // ============================================================================
145
+ // Force Deallocate (Morpho Vault V2 only)
146
+ //
147
+ // `forceDeallocate(adapter, data, assets, onBehalf)` pays the curator-set
148
+ // `forceDeallocatePenalty(adapter)` and pulls `assets` worth of underlying
149
+ // from the named adapter back to vault idle. Caller-supplied `data` is
150
+ // adapter-specific (often empty bytes `0x`); `onBehalf` is typically the
151
+ // avatar safe (the LP whose position absorbs the penalty).
152
+ //
153
+ // V2-only — calling this against a V1 vault reverts (function not present).
154
+ // ============================================================================
155
+
156
+ export type ForceDeallocateMorphoVaultArgs = Readonly<{
157
+ adapter: Address;
158
+ data: HexString;
159
+ assets: bigint;
160
+ onBehalf: Address;
161
+ }>;
162
+
163
+ export const ForceDeallocateMorphoVaultCalldata = ({
164
+ adapter,
165
+ data,
166
+ assets,
167
+ onBehalf,
168
+ }: ForceDeallocateMorphoVaultArgs): HexString => {
169
+ return morphoVaultV2Interface.encodeFunctionData("forceDeallocate", [adapter, data, assets, onBehalf]) as HexString;
170
+ };
171
+
172
+ export const forceDeallocateMorphoVaultTrx = ({
173
+ args,
174
+ morphoVaultAddress,
175
+ }: {
176
+ args: ForceDeallocateMorphoVaultArgs;
177
+ morphoVaultAddress: Address;
178
+ }): Unwrapable<Call> => {
179
+ return createCall({
180
+ operation: 0,
181
+ to: morphoVaultAddress,
182
+ value: 0n,
183
+ data: ForceDeallocateMorphoVaultCalldata(args),
184
+ });
185
+ };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Morpho Vault V2-only ABI fragments. These are not present on V1 vaults.
3
+ *
4
+ * `forceDeallocate(adapter, data, assets, onBehalf)` is the LP escape hatch
5
+ * — it pays the curator-set `forceDeallocatePenalty(adapter)` and pulls
6
+ * `assets` worth of underlying out of the named adapter back to vault idle.
7
+ * V2 vaults expose this so a depositor can force liquidity from a single
8
+ * adapter without waiting for the curator's reallocation.
9
+ */
10
+ export const MorphoVaultV2Abi = [
11
+ {
12
+ inputs: [
13
+ { internalType: "address", name: "adapter", type: "address" },
14
+ { internalType: "bytes", name: "data", type: "bytes" },
15
+ { internalType: "uint256", name: "assets", type: "uint256" },
16
+ { internalType: "address", name: "onBehalf", type: "address" },
17
+ ],
18
+ name: "forceDeallocate",
19
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
20
+ stateMutability: "nonpayable",
21
+ type: "function",
22
+ },
23
+ ] as const;