damm-sdk 1.3.0 → 1.3.2

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 (36) hide show
  1. package/dist/index.cjs +19383 -16277
  2. package/dist/index.cjs.map +68 -41
  3. package/dist/index.js +49514 -41635
  4. package/dist/index.js.map +125 -57
  5. package/dist/integrations/index.d.ts +3 -1
  6. package/dist/integrations/index.d.ts.map +1 -1
  7. package/dist/integrations/iporFusion/index.d.ts +2 -0
  8. package/dist/integrations/iporFusion/index.d.ts.map +1 -0
  9. package/dist/integrations/iporFusion/ipor.fusion.abi.d.ts +103 -0
  10. package/dist/integrations/iporFusion/ipor.fusion.abi.d.ts.map +1 -0
  11. package/dist/integrations/iporFusion/ipor.fusion.d.ts +32 -0
  12. package/dist/integrations/iporFusion/ipor.fusion.d.ts.map +1 -0
  13. package/dist/integrations/originArm/index.d.ts +2 -0
  14. package/dist/integrations/originArm/index.d.ts.map +1 -0
  15. package/dist/integrations/originArm/origin.arm.abi.d.ts +108 -0
  16. package/dist/integrations/originArm/origin.arm.abi.d.ts.map +1 -0
  17. package/dist/integrations/originArm/origin.arm.d.ts +41 -0
  18. package/dist/integrations/originArm/origin.arm.d.ts.map +1 -0
  19. package/dist/integrations/syrup/index.d.ts +0 -1
  20. package/dist/integrations/syrup/index.d.ts.map +1 -1
  21. package/dist/integrations/syrup/syrup.vault.abi.d.ts +6 -62
  22. package/dist/integrations/syrup/syrup.vault.abi.d.ts.map +1 -1
  23. package/dist/integrations/syrup/syrup.vault.d.ts +0 -9
  24. package/dist/integrations/syrup/syrup.vault.d.ts.map +1 -1
  25. package/package.json +1 -1
  26. package/src/integrations/index.ts +3 -1
  27. package/src/integrations/iporFusion/index.ts +1 -0
  28. package/src/integrations/iporFusion/ipor.fusion.abi.ts +55 -0
  29. package/src/integrations/iporFusion/ipor.fusion.ts +93 -0
  30. package/src/integrations/originArm/index.ts +1 -0
  31. package/src/integrations/originArm/origin.arm.abi.ts +64 -0
  32. package/src/integrations/originArm/origin.arm.ts +144 -0
  33. package/src/integrations/syrup/index.ts +0 -1
  34. package/src/integrations/syrup/syrup.vault.abi.ts +6 -49
  35. package/src/integrations/syrup/syrup.vault.ts +2 -30
  36. package/src/lib/contractsRegistry.json +2 -1
@@ -0,0 +1,64 @@
1
+ export const OriginArmVaultAbi = [
2
+ {
3
+ inputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
4
+ name: "deposit",
5
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
6
+ stateMutability: "nonpayable",
7
+ type: "function",
8
+ },
9
+ {
10
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
11
+ name: "requestRedeem",
12
+ outputs: [{ internalType: "uint256", name: "requestId", type: "uint256" }],
13
+ stateMutability: "nonpayable",
14
+ type: "function",
15
+ },
16
+ {
17
+ inputs: [{ internalType: "uint256", name: "requestId", type: "uint256" }],
18
+ name: "claimRedeem",
19
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
20
+ stateMutability: "nonpayable",
21
+ type: "function",
22
+ },
23
+ {
24
+ inputs: [],
25
+ name: "asset",
26
+ outputs: [{ internalType: "address", name: "", type: "address" }],
27
+ stateMutability: "view",
28
+ type: "function",
29
+ },
30
+ {
31
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
32
+ name: "balanceOf",
33
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
34
+ stateMutability: "view",
35
+ type: "function",
36
+ },
37
+ {
38
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
39
+ name: "convertToAssets",
40
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
41
+ stateMutability: "view",
42
+ type: "function",
43
+ },
44
+ ] as const;
45
+
46
+ export const OriginArmStethZapperAbi = [
47
+ {
48
+ inputs: [],
49
+ name: "deposit",
50
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
51
+ stateMutability: "payable",
52
+ type: "function",
53
+ },
54
+ ] as const;
55
+
56
+ export const OriginArmUniversalZapperAbi = [
57
+ {
58
+ inputs: [{ internalType: "address", name: "arm", type: "address" }],
59
+ name: "deposit",
60
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
61
+ stateMutability: "payable",
62
+ type: "function",
63
+ },
64
+ ] as const;
@@ -0,0 +1,144 @@
1
+ import { ethers } from "ethers";
2
+ import { OriginArmVaultAbi, OriginArmStethZapperAbi, OriginArmUniversalZapperAbi } from "./origin.arm.abi";
3
+ import type { Address } from "viem";
4
+ import type { HexString, Unwrapable, Call } from "../../types";
5
+ import { createCall } from "../../types";
6
+
7
+ const vaultInterface = new ethers.utils.Interface(OriginArmVaultAbi);
8
+ const stethZapperInterface = new ethers.utils.Interface(OriginArmStethZapperAbi);
9
+ const universalZapperInterface = new ethers.utils.Interface(OriginArmUniversalZapperAbi);
10
+
11
+ // ============================================================================
12
+ // Deposit WETH (direct to vault)
13
+ // ============================================================================
14
+
15
+ export type DepositOriginArmWethArgs = Readonly<{
16
+ assets: bigint;
17
+ }>;
18
+
19
+ export const DepositOriginArmWethCalldata = ({ assets }: DepositOriginArmWethArgs): HexString => {
20
+ return vaultInterface.encodeFunctionData("deposit", [assets]) as HexString;
21
+ };
22
+
23
+ export const depositOriginArmWethTrx = ({
24
+ args,
25
+ vaultAddress,
26
+ }: {
27
+ args: DepositOriginArmWethArgs;
28
+ vaultAddress: Address;
29
+ }): Unwrapable<Call> => {
30
+ return createCall({
31
+ operation: 0,
32
+ to: vaultAddress,
33
+ value: 0n,
34
+ data: DepositOriginArmWethCalldata(args),
35
+ });
36
+ };
37
+
38
+ // ============================================================================
39
+ // Deposit ETH via stETH ARM Zapper (payable, no parameters)
40
+ // ============================================================================
41
+
42
+ export const DepositOriginArmEthViaZapperCalldata = (): HexString => {
43
+ return stethZapperInterface.encodeFunctionData("deposit") as HexString;
44
+ };
45
+
46
+ export const depositOriginArmEthViaZapperTrx = ({
47
+ zapperAddress,
48
+ value,
49
+ }: {
50
+ zapperAddress: Address;
51
+ value: bigint;
52
+ }): Unwrapable<Call> => {
53
+ return createCall({
54
+ operation: 0,
55
+ to: zapperAddress,
56
+ value,
57
+ data: DepositOriginArmEthViaZapperCalldata(),
58
+ });
59
+ };
60
+
61
+ // ============================================================================
62
+ // Deposit ETH via Universal Zapper (payable, arm parameter)
63
+ // ============================================================================
64
+
65
+ export type DepositOriginArmEthViaUniversalZapperArgs = Readonly<{
66
+ arm: Address;
67
+ }>;
68
+
69
+ export const DepositOriginArmEthViaUniversalZapperCalldata = ({
70
+ arm,
71
+ }: DepositOriginArmEthViaUniversalZapperArgs): HexString => {
72
+ return universalZapperInterface.encodeFunctionData("deposit", [arm]) as HexString;
73
+ };
74
+
75
+ export const depositOriginArmEthViaUniversalZapperTrx = ({
76
+ args,
77
+ zapperAddress,
78
+ value,
79
+ }: {
80
+ args: DepositOriginArmEthViaUniversalZapperArgs;
81
+ zapperAddress: Address;
82
+ value: bigint;
83
+ }): Unwrapable<Call> => {
84
+ return createCall({
85
+ operation: 0,
86
+ to: zapperAddress,
87
+ value,
88
+ data: DepositOriginArmEthViaUniversalZapperCalldata(args),
89
+ });
90
+ };
91
+
92
+ // ============================================================================
93
+ // Request Redeem (async withdrawal - step 1)
94
+ // ============================================================================
95
+
96
+ export type RequestRedeemOriginArmArgs = Readonly<{
97
+ shares: bigint;
98
+ }>;
99
+
100
+ export const RequestRedeemOriginArmCalldata = ({ shares }: RequestRedeemOriginArmArgs): HexString => {
101
+ return vaultInterface.encodeFunctionData("requestRedeem", [shares]) as HexString;
102
+ };
103
+
104
+ export const requestRedeemOriginArmTrx = ({
105
+ args,
106
+ vaultAddress,
107
+ }: {
108
+ args: RequestRedeemOriginArmArgs;
109
+ vaultAddress: Address;
110
+ }): Unwrapable<Call> => {
111
+ return createCall({
112
+ operation: 0,
113
+ to: vaultAddress,
114
+ value: 0n,
115
+ data: RequestRedeemOriginArmCalldata(args),
116
+ });
117
+ };
118
+
119
+ // ============================================================================
120
+ // Claim Redeem (async withdrawal - step 2)
121
+ // ============================================================================
122
+
123
+ export type ClaimRedeemOriginArmArgs = Readonly<{
124
+ requestId: bigint;
125
+ }>;
126
+
127
+ export const ClaimRedeemOriginArmCalldata = ({ requestId }: ClaimRedeemOriginArmArgs): HexString => {
128
+ return vaultInterface.encodeFunctionData("claimRedeem", [requestId]) as HexString;
129
+ };
130
+
131
+ export const claimRedeemOriginArmTrx = ({
132
+ args,
133
+ vaultAddress,
134
+ }: {
135
+ args: ClaimRedeemOriginArmArgs;
136
+ vaultAddress: Address;
137
+ }): Unwrapable<Call> => {
138
+ return createCall({
139
+ operation: 0,
140
+ to: vaultAddress,
141
+ value: 0n,
142
+ data: ClaimRedeemOriginArmCalldata(args),
143
+ });
144
+ };
@@ -1,2 +1 @@
1
1
  export * from "./syrup.vault";
2
- export { default as SyrupVaultAbi } from "./syrup.vault.abi";
@@ -1,65 +1,22 @@
1
1
  export default [
2
2
  {
3
3
  inputs: [
4
- { internalType: "uint256", name: "assets_", type: "uint256" },
5
- { internalType: "address", name: "receiver_", type: "address" },
4
+ { internalType: "uint256", name: "assets", type: "uint256" },
5
+ { internalType: "address", name: "receiver", type: "address" },
6
6
  ],
7
7
  name: "deposit",
8
- outputs: [{ internalType: "uint256", name: "shares_", type: "uint256" }],
8
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
9
9
  stateMutability: "nonpayable",
10
10
  type: "function",
11
11
  },
12
12
  {
13
13
  inputs: [
14
- { internalType: "uint256", name: "assets_", type: "uint256" },
15
- { internalType: "address", name: "owner_", type: "address" },
16
- ],
17
- name: "requestWithdraw",
18
- outputs: [
19
- {
20
- internalType: "uint256",
21
- name: "escrowedShares_",
22
- type: "uint256",
23
- },
24
- ],
25
- stateMutability: "nonpayable",
26
- type: "function",
27
- },
28
- {
29
- inputs: [
30
- { internalType: "uint256", name: "shares_", type: "uint256" },
31
- { internalType: "address", name: "owner_", type: "address" },
14
+ { internalType: "uint256", name: "shares", type: "uint256" },
15
+ { internalType: "address", name: "owner", type: "address" },
32
16
  ],
33
17
  name: "requestRedeem",
34
- outputs: [
35
- {
36
- internalType: "uint256",
37
- name: "escrowedShares_",
38
- type: "uint256",
39
- },
40
- ],
18
+ outputs: [{ internalType: "uint256", name: "escrowedShares", type: "uint256" }],
41
19
  stateMutability: "nonpayable",
42
20
  type: "function",
43
21
  },
44
- {
45
- inputs: [],
46
- name: "asset",
47
- outputs: [{ internalType: "address", name: "", type: "address" }],
48
- stateMutability: "view",
49
- type: "function",
50
- },
51
- {
52
- inputs: [{ internalType: "address", name: "", type: "address" }],
53
- name: "balanceOf",
54
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
55
- stateMutability: "view",
56
- type: "function",
57
- },
58
- {
59
- inputs: [{ internalType: "uint256", name: "shares_", type: "uint256" }],
60
- name: "convertToAssets",
61
- outputs: [{ internalType: "uint256", name: "assets_", type: "uint256" }],
62
- stateMutability: "view",
63
- type: "function",
64
- },
65
22
  ] as const;
@@ -7,7 +7,7 @@ import { createCall } from "../../types";
7
7
  const syrupVaultInterface = new ethers.utils.Interface(SyrupVaultAbi);
8
8
 
9
9
  // ============================================================================
10
- // Deposit
10
+ // Deposit (ERC4626)
11
11
  // ============================================================================
12
12
 
13
13
  export type DepositSyrupVaultArgs = Readonly<{
@@ -35,35 +35,7 @@ export const depositSyrupVaultTrx = ({
35
35
  };
36
36
 
37
37
  // ============================================================================
38
- // Request Withdraw (assets-based async withdrawal)
39
- // ============================================================================
40
-
41
- export type RequestWithdrawSyrupVaultArgs = Readonly<{
42
- assets: bigint;
43
- owner: Address;
44
- }>;
45
-
46
- export const RequestWithdrawSyrupVaultCalldata = ({ assets, owner }: RequestWithdrawSyrupVaultArgs): HexString => {
47
- return syrupVaultInterface.encodeFunctionData("requestWithdraw", [assets, owner]) as HexString;
48
- };
49
-
50
- export const requestWithdrawSyrupVaultTrx = ({
51
- args,
52
- syrupVaultAddress,
53
- }: {
54
- args: RequestWithdrawSyrupVaultArgs;
55
- syrupVaultAddress: Address;
56
- }): Unwrapable<Call> => {
57
- return createCall({
58
- operation: 0,
59
- to: syrupVaultAddress,
60
- value: 0n,
61
- data: RequestWithdrawSyrupVaultCalldata(args),
62
- });
63
- };
64
-
65
- // ============================================================================
66
- // Request Redeem (shares-based async withdrawal)
38
+ // Request Redeem (async withdrawal — ERC-7540 pattern)
67
39
  // ============================================================================
68
40
 
69
41
  export type RequestRedeemSyrupVaultArgs = Readonly<{
@@ -501,7 +501,8 @@
501
501
  "bal": "0xba100000625a3754423978a60c9317c58a424e3D",
502
502
  "cvx": "0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B",
503
503
  "crv": "0xD533a949740bb3306d119CC777fa900bA034cd52",
504
- "ausd": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a"
504
+ "ausd": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
505
+ "pendle": "0x808507121B80c02388FAd14726482e061B8da827"
505
506
  },
506
507
  "morpho": {
507
508
  "morphoBlue": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",