damm-sdk 1.3.1 → 1.3.3

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.
@@ -0,0 +1,103 @@
1
+ declare const _default: readonly [{
2
+ readonly inputs: readonly [{
3
+ readonly internalType: "uint256";
4
+ readonly name: "assets";
5
+ readonly type: "uint256";
6
+ }, {
7
+ readonly internalType: "address";
8
+ readonly name: "receiver";
9
+ readonly type: "address";
10
+ }];
11
+ readonly name: "deposit";
12
+ readonly outputs: readonly [{
13
+ readonly internalType: "uint256";
14
+ readonly name: "shares";
15
+ readonly type: "uint256";
16
+ }];
17
+ readonly stateMutability: "nonpayable";
18
+ readonly type: "function";
19
+ }, {
20
+ readonly inputs: readonly [{
21
+ readonly internalType: "uint256";
22
+ readonly name: "assets";
23
+ readonly type: "uint256";
24
+ }, {
25
+ readonly internalType: "address";
26
+ readonly name: "receiver";
27
+ readonly type: "address";
28
+ }, {
29
+ readonly internalType: "address";
30
+ readonly name: "owner";
31
+ readonly type: "address";
32
+ }];
33
+ readonly name: "withdraw";
34
+ readonly outputs: readonly [{
35
+ readonly internalType: "uint256";
36
+ readonly name: "shares";
37
+ readonly type: "uint256";
38
+ }];
39
+ readonly stateMutability: "nonpayable";
40
+ readonly type: "function";
41
+ }, {
42
+ readonly inputs: readonly [{
43
+ readonly internalType: "uint256";
44
+ readonly name: "shares";
45
+ readonly type: "uint256";
46
+ }, {
47
+ readonly internalType: "address";
48
+ readonly name: "receiver";
49
+ readonly type: "address";
50
+ }, {
51
+ readonly internalType: "address";
52
+ readonly name: "owner";
53
+ readonly type: "address";
54
+ }];
55
+ readonly name: "redeem";
56
+ readonly outputs: readonly [{
57
+ readonly internalType: "uint256";
58
+ readonly name: "assets";
59
+ readonly type: "uint256";
60
+ }];
61
+ readonly stateMutability: "nonpayable";
62
+ readonly type: "function";
63
+ }, {
64
+ readonly inputs: readonly [];
65
+ readonly name: "asset";
66
+ readonly outputs: readonly [{
67
+ readonly internalType: "address";
68
+ readonly name: "";
69
+ readonly type: "address";
70
+ }];
71
+ readonly stateMutability: "view";
72
+ readonly type: "function";
73
+ }, {
74
+ readonly inputs: readonly [{
75
+ readonly internalType: "address";
76
+ readonly name: "account";
77
+ readonly type: "address";
78
+ }];
79
+ readonly name: "balanceOf";
80
+ readonly outputs: readonly [{
81
+ readonly internalType: "uint256";
82
+ readonly name: "";
83
+ readonly type: "uint256";
84
+ }];
85
+ readonly stateMutability: "view";
86
+ readonly type: "function";
87
+ }, {
88
+ readonly inputs: readonly [{
89
+ readonly internalType: "uint256";
90
+ readonly name: "shares";
91
+ readonly type: "uint256";
92
+ }];
93
+ readonly name: "convertToAssets";
94
+ readonly outputs: readonly [{
95
+ readonly internalType: "uint256";
96
+ readonly name: "assets";
97
+ readonly type: "uint256";
98
+ }];
99
+ readonly stateMutability: "view";
100
+ readonly type: "function";
101
+ }];
102
+ export default _default;
103
+ //# sourceMappingURL=gearbox.vault.abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gearbox.vault.abi.d.ts","sourceRoot":"","sources":["../../../src/integrations/gearbox/gearbox.vault.abi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAsDW"}
@@ -0,0 +1,32 @@
1
+ import type { Address } from "viem";
2
+ import type { HexString, Unwrapable, Call } from "../../types";
3
+ export type DepositGearboxVaultArgs = Readonly<{
4
+ assets: bigint;
5
+ receiver: Address;
6
+ }>;
7
+ export declare const DepositGearboxVaultCalldata: ({ assets, receiver }: DepositGearboxVaultArgs) => HexString;
8
+ export declare const depositGearboxVaultTrx: ({ args, vaultAddress, }: {
9
+ args: DepositGearboxVaultArgs;
10
+ vaultAddress: Address;
11
+ }) => Unwrapable<Call>;
12
+ export type WithdrawGearboxVaultArgs = Readonly<{
13
+ assets: bigint;
14
+ receiver: Address;
15
+ owner: Address;
16
+ }>;
17
+ export declare const WithdrawGearboxVaultCalldata: ({ assets, receiver, owner }: WithdrawGearboxVaultArgs) => HexString;
18
+ export declare const withdrawGearboxVaultTrx: ({ args, vaultAddress, }: {
19
+ args: WithdrawGearboxVaultArgs;
20
+ vaultAddress: Address;
21
+ }) => Unwrapable<Call>;
22
+ export type RedeemGearboxVaultArgs = Readonly<{
23
+ shares: bigint;
24
+ receiver: Address;
25
+ owner: Address;
26
+ }>;
27
+ export declare const RedeemGearboxVaultCalldata: ({ shares, receiver, owner }: RedeemGearboxVaultArgs) => HexString;
28
+ export declare const redeemGearboxVaultTrx: ({ args, vaultAddress, }: {
29
+ args: RedeemGearboxVaultArgs;
30
+ vaultAddress: Address;
31
+ }) => Unwrapable<Call>;
32
+ //# sourceMappingURL=gearbox.vault.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gearbox.vault.d.ts","sourceRoot":"","sources":["../../../src/integrations/gearbox/gearbox.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,uBAAuB,GAAG,QAAQ,CAAC;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH,eAAO,MAAM,2BAA2B,yBAA0B,uBAAuB,KAAG,SAE3F,CAAC;AAEF,eAAO,MAAM,sBAAsB;UAIzB,uBAAuB;kBACf,OAAO;MACrB,WAAW,IAAI,CAOlB,CAAC;AAMF,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH,eAAO,MAAM,4BAA4B,gCAAiC,wBAAwB,KAAG,SAEpG,CAAC;AAEF,eAAO,MAAM,uBAAuB;UAI1B,wBAAwB;kBAChB,OAAO;MACrB,WAAW,IAAI,CAOlB,CAAC;AAMF,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH,eAAO,MAAM,0BAA0B,gCAAiC,sBAAsB,KAAG,SAEhG,CAAC;AAEF,eAAO,MAAM,qBAAqB;UAIxB,sBAAsB;kBACd,OAAO;MACrB,WAAW,IAAI,CAOlB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./gearbox.vault";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/gearbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -17,4 +17,6 @@ export * from "./cctp";
17
17
  export * from "./erc721";
18
18
  export * from "./iporFusion";
19
19
  export * from "./originArm";
20
+ export * from "./syrup";
21
+ export * from "./gearbox";
20
22
  //# sourceMappingURL=index.d.ts.map
@@ -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,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,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,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./syrup.vault";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/syrup/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -0,0 +1,39 @@
1
+ declare const _default: readonly [{
2
+ readonly inputs: readonly [{
3
+ readonly internalType: "uint256";
4
+ readonly name: "assets";
5
+ readonly type: "uint256";
6
+ }, {
7
+ readonly internalType: "address";
8
+ readonly name: "receiver";
9
+ readonly type: "address";
10
+ }];
11
+ readonly name: "deposit";
12
+ readonly outputs: readonly [{
13
+ readonly internalType: "uint256";
14
+ readonly name: "shares";
15
+ readonly type: "uint256";
16
+ }];
17
+ readonly stateMutability: "nonpayable";
18
+ readonly type: "function";
19
+ }, {
20
+ readonly inputs: readonly [{
21
+ readonly internalType: "uint256";
22
+ readonly name: "shares";
23
+ readonly type: "uint256";
24
+ }, {
25
+ readonly internalType: "address";
26
+ readonly name: "owner";
27
+ readonly type: "address";
28
+ }];
29
+ readonly name: "requestRedeem";
30
+ readonly outputs: readonly [{
31
+ readonly internalType: "uint256";
32
+ readonly name: "escrowedShares";
33
+ readonly type: "uint256";
34
+ }];
35
+ readonly stateMutability: "nonpayable";
36
+ readonly type: "function";
37
+ }];
38
+ export default _default;
39
+ //# sourceMappingURL=syrup.vault.abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syrup.vault.abi.d.ts","sourceRoot":"","sources":["../../../src/integrations/syrup/syrup.vault.abi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAqBW"}
@@ -0,0 +1,21 @@
1
+ import type { Address } from "viem";
2
+ import type { HexString, Unwrapable, Call } from "../../types";
3
+ export type DepositSyrupVaultArgs = Readonly<{
4
+ assets: bigint;
5
+ receiver: Address;
6
+ }>;
7
+ export declare const DepositSyrupVaultCalldata: ({ assets, receiver }: DepositSyrupVaultArgs) => HexString;
8
+ export declare const depositSyrupVaultTrx: ({ args, syrupVaultAddress, }: {
9
+ args: DepositSyrupVaultArgs;
10
+ syrupVaultAddress: Address;
11
+ }) => Unwrapable<Call>;
12
+ export type RequestRedeemSyrupVaultArgs = Readonly<{
13
+ shares: bigint;
14
+ owner: Address;
15
+ }>;
16
+ export declare const RequestRedeemSyrupVaultCalldata: ({ shares, owner }: RequestRedeemSyrupVaultArgs) => HexString;
17
+ export declare const requestRedeemSyrupVaultTrx: ({ args, syrupVaultAddress, }: {
18
+ args: RequestRedeemSyrupVaultArgs;
19
+ syrupVaultAddress: Address;
20
+ }) => Unwrapable<Call>;
21
+ //# sourceMappingURL=syrup.vault.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syrup.vault.d.ts","sourceRoot":"","sources":["../../../src/integrations/syrup/syrup.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,qBAAqB,GAAG,QAAQ,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH,eAAO,MAAM,yBAAyB,yBAA0B,qBAAqB,KAAG,SAEvF,CAAC;AAEF,eAAO,MAAM,oBAAoB;UAIvB,qBAAqB;uBACR,OAAO;MAC1B,WAAW,IAAI,CAOlB,CAAC;AAMF,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH,eAAO,MAAM,+BAA+B,sBAAuB,2BAA2B,KAAG,SAEhG,CAAC;AAEF,eAAO,MAAM,0BAA0B;UAI7B,2BAA2B;uBACd,OAAO;MAC1B,WAAW,IAAI,CAOlB,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.3.1",
7
+ "version": "1.3.3",
8
8
  "files": [
9
9
  "dist",
10
10
  "src",
@@ -0,0 +1,55 @@
1
+ export default [
2
+ {
3
+ inputs: [
4
+ { internalType: "uint256", name: "assets", type: "uint256" },
5
+ { internalType: "address", name: "receiver", type: "address" },
6
+ ],
7
+ name: "deposit",
8
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
9
+ stateMutability: "nonpayable",
10
+ type: "function",
11
+ },
12
+ {
13
+ inputs: [
14
+ { internalType: "uint256", name: "assets", type: "uint256" },
15
+ { internalType: "address", name: "receiver", type: "address" },
16
+ { internalType: "address", name: "owner", type: "address" },
17
+ ],
18
+ name: "withdraw",
19
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
20
+ stateMutability: "nonpayable",
21
+ type: "function",
22
+ },
23
+ {
24
+ inputs: [
25
+ { internalType: "uint256", name: "shares", type: "uint256" },
26
+ { internalType: "address", name: "receiver", type: "address" },
27
+ { internalType: "address", name: "owner", type: "address" },
28
+ ],
29
+ name: "redeem",
30
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
31
+ stateMutability: "nonpayable",
32
+ type: "function",
33
+ },
34
+ {
35
+ inputs: [],
36
+ name: "asset",
37
+ outputs: [{ internalType: "address", name: "", type: "address" }],
38
+ stateMutability: "view",
39
+ type: "function",
40
+ },
41
+ {
42
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
43
+ name: "balanceOf",
44
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
45
+ stateMutability: "view",
46
+ type: "function",
47
+ },
48
+ {
49
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
50
+ name: "convertToAssets",
51
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
52
+ stateMutability: "view",
53
+ type: "function",
54
+ },
55
+ ] as const;
@@ -0,0 +1,93 @@
1
+ import { ethers } from "ethers";
2
+ import GearboxVaultAbi from "./gearbox.vault.abi";
3
+ import type { Address } from "viem";
4
+ import type { HexString, Unwrapable, Call } from "../../types";
5
+ import { createCall } from "../../types";
6
+
7
+ const gearboxVaultInterface = new ethers.utils.Interface(GearboxVaultAbi);
8
+
9
+ // ============================================================================
10
+ // Deposit (ERC4626)
11
+ // ============================================================================
12
+
13
+ export type DepositGearboxVaultArgs = Readonly<{
14
+ assets: bigint;
15
+ receiver: Address;
16
+ }>;
17
+
18
+ export const DepositGearboxVaultCalldata = ({ assets, receiver }: DepositGearboxVaultArgs): HexString => {
19
+ return gearboxVaultInterface.encodeFunctionData("deposit", [assets, receiver]) as HexString;
20
+ };
21
+
22
+ export const depositGearboxVaultTrx = ({
23
+ args,
24
+ vaultAddress,
25
+ }: {
26
+ args: DepositGearboxVaultArgs;
27
+ vaultAddress: Address;
28
+ }): Unwrapable<Call> => {
29
+ return createCall({
30
+ operation: 0,
31
+ to: vaultAddress,
32
+ value: 0n,
33
+ data: DepositGearboxVaultCalldata(args),
34
+ });
35
+ };
36
+
37
+ // ============================================================================
38
+ // Withdraw (ERC4626) - Assets-based withdrawal
39
+ // ============================================================================
40
+
41
+ export type WithdrawGearboxVaultArgs = Readonly<{
42
+ assets: bigint;
43
+ receiver: Address;
44
+ owner: Address;
45
+ }>;
46
+
47
+ export const WithdrawGearboxVaultCalldata = ({ assets, receiver, owner }: WithdrawGearboxVaultArgs): HexString => {
48
+ return gearboxVaultInterface.encodeFunctionData("withdraw", [assets, receiver, owner]) as HexString;
49
+ };
50
+
51
+ export const withdrawGearboxVaultTrx = ({
52
+ args,
53
+ vaultAddress,
54
+ }: {
55
+ args: WithdrawGearboxVaultArgs;
56
+ vaultAddress: Address;
57
+ }): Unwrapable<Call> => {
58
+ return createCall({
59
+ operation: 0,
60
+ to: vaultAddress,
61
+ value: 0n,
62
+ data: WithdrawGearboxVaultCalldata(args),
63
+ });
64
+ };
65
+
66
+ // ============================================================================
67
+ // Redeem (ERC4626) - Shares-based withdrawal
68
+ // ============================================================================
69
+
70
+ export type RedeemGearboxVaultArgs = Readonly<{
71
+ shares: bigint;
72
+ receiver: Address;
73
+ owner: Address;
74
+ }>;
75
+
76
+ export const RedeemGearboxVaultCalldata = ({ shares, receiver, owner }: RedeemGearboxVaultArgs): HexString => {
77
+ return gearboxVaultInterface.encodeFunctionData("redeem", [shares, receiver, owner]) as HexString;
78
+ };
79
+
80
+ export const redeemGearboxVaultTrx = ({
81
+ args,
82
+ vaultAddress,
83
+ }: {
84
+ args: RedeemGearboxVaultArgs;
85
+ vaultAddress: Address;
86
+ }): Unwrapable<Call> => {
87
+ return createCall({
88
+ operation: 0,
89
+ to: vaultAddress,
90
+ value: 0n,
91
+ data: RedeemGearboxVaultCalldata(args),
92
+ });
93
+ };
@@ -0,0 +1 @@
1
+ export * from "./gearbox.vault";
@@ -17,3 +17,5 @@ export * from "./cctp";
17
17
  export * from "./erc721";
18
18
  export * from "./iporFusion";
19
19
  export * from "./originArm";
20
+ export * from "./syrup";
21
+ export * from "./gearbox";
@@ -0,0 +1 @@
1
+ export * from "./syrup.vault";
@@ -0,0 +1,22 @@
1
+ export default [
2
+ {
3
+ inputs: [
4
+ { internalType: "uint256", name: "assets", type: "uint256" },
5
+ { internalType: "address", name: "receiver", type: "address" },
6
+ ],
7
+ name: "deposit",
8
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
9
+ stateMutability: "nonpayable",
10
+ type: "function",
11
+ },
12
+ {
13
+ inputs: [
14
+ { internalType: "uint256", name: "shares", type: "uint256" },
15
+ { internalType: "address", name: "owner", type: "address" },
16
+ ],
17
+ name: "requestRedeem",
18
+ outputs: [{ internalType: "uint256", name: "escrowedShares", type: "uint256" }],
19
+ stateMutability: "nonpayable",
20
+ type: "function",
21
+ },
22
+ ] as const;
@@ -0,0 +1,63 @@
1
+ import { ethers } from "ethers";
2
+ import SyrupVaultAbi from "./syrup.vault.abi";
3
+ import type { Address } from "viem";
4
+ import type { HexString, Unwrapable, Call } from "../../types";
5
+ import { createCall } from "../../types";
6
+
7
+ const syrupVaultInterface = new ethers.utils.Interface(SyrupVaultAbi);
8
+
9
+ // ============================================================================
10
+ // Deposit (ERC4626)
11
+ // ============================================================================
12
+
13
+ export type DepositSyrupVaultArgs = Readonly<{
14
+ assets: bigint;
15
+ receiver: Address;
16
+ }>;
17
+
18
+ export const DepositSyrupVaultCalldata = ({ assets, receiver }: DepositSyrupVaultArgs): HexString => {
19
+ return syrupVaultInterface.encodeFunctionData("deposit", [assets, receiver]) as HexString;
20
+ };
21
+
22
+ export const depositSyrupVaultTrx = ({
23
+ args,
24
+ syrupVaultAddress,
25
+ }: {
26
+ args: DepositSyrupVaultArgs;
27
+ syrupVaultAddress: Address;
28
+ }): Unwrapable<Call> => {
29
+ return createCall({
30
+ operation: 0,
31
+ to: syrupVaultAddress,
32
+ value: 0n,
33
+ data: DepositSyrupVaultCalldata(args),
34
+ });
35
+ };
36
+
37
+ // ============================================================================
38
+ // Request Redeem (async withdrawal — ERC-7540 pattern)
39
+ // ============================================================================
40
+
41
+ export type RequestRedeemSyrupVaultArgs = Readonly<{
42
+ shares: bigint;
43
+ owner: Address;
44
+ }>;
45
+
46
+ export const RequestRedeemSyrupVaultCalldata = ({ shares, owner }: RequestRedeemSyrupVaultArgs): HexString => {
47
+ return syrupVaultInterface.encodeFunctionData("requestRedeem", [shares, owner]) as HexString;
48
+ };
49
+
50
+ export const requestRedeemSyrupVaultTrx = ({
51
+ args,
52
+ syrupVaultAddress,
53
+ }: {
54
+ args: RequestRedeemSyrupVaultArgs;
55
+ syrupVaultAddress: Address;
56
+ }): Unwrapable<Call> => {
57
+ return createCall({
58
+ operation: 0,
59
+ to: syrupVaultAddress,
60
+ value: 0n,
61
+ data: RequestRedeemSyrupVaultCalldata(args),
62
+ });
63
+ };