damm-sdk 1.3.0 → 1.3.1

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 (35) hide show
  1. package/dist/index.cjs +261 -120
  2. package/dist/index.cjs.map +7 -5
  3. package/dist/index.js +261 -120
  4. package/dist/index.js.map +7 -5
  5. package/dist/integrations/index.d.ts +2 -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/{syrup/syrup.vault.abi.d.ts → iporFusion/ipor.fusion.abi.d.ts} +23 -15
  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/package.json +1 -1
  20. package/src/integrations/index.ts +2 -1
  21. package/src/integrations/iporFusion/index.ts +1 -0
  22. package/src/integrations/iporFusion/ipor.fusion.abi.ts +55 -0
  23. package/src/integrations/iporFusion/ipor.fusion.ts +93 -0
  24. package/src/integrations/originArm/index.ts +1 -0
  25. package/src/integrations/originArm/origin.arm.abi.ts +64 -0
  26. package/src/integrations/originArm/origin.arm.ts +144 -0
  27. package/src/lib/contractsRegistry.json +2 -1
  28. package/dist/integrations/syrup/index.d.ts +0 -3
  29. package/dist/integrations/syrup/index.d.ts.map +0 -1
  30. package/dist/integrations/syrup/syrup.vault.abi.d.ts.map +0 -1
  31. package/dist/integrations/syrup/syrup.vault.d.ts +0 -30
  32. package/dist/integrations/syrup/syrup.vault.d.ts.map +0 -1
  33. package/src/integrations/syrup/index.ts +0 -2
  34. package/src/integrations/syrup/syrup.vault.abi.ts +0 -65
  35. package/src/integrations/syrup/syrup.vault.ts +0 -91
@@ -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
+ };
@@ -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",
@@ -1,3 +0,0 @@
1
- export * from "./syrup.vault";
2
- export { default as SyrupVaultAbi } from "./syrup.vault.abi";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/syrup/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"syrup.vault.abi.d.ts","sourceRoot":"","sources":["../../../src/integrations/syrup/syrup.vault.abi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAgEW"}
@@ -1,30 +0,0 @@
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 RequestWithdrawSyrupVaultArgs = Readonly<{
13
- assets: bigint;
14
- owner: Address;
15
- }>;
16
- export declare const RequestWithdrawSyrupVaultCalldata: ({ assets, owner }: RequestWithdrawSyrupVaultArgs) => HexString;
17
- export declare const requestWithdrawSyrupVaultTrx: ({ args, syrupVaultAddress, }: {
18
- args: RequestWithdrawSyrupVaultArgs;
19
- syrupVaultAddress: Address;
20
- }) => Unwrapable<Call>;
21
- export type RequestRedeemSyrupVaultArgs = Readonly<{
22
- shares: bigint;
23
- owner: Address;
24
- }>;
25
- export declare const RequestRedeemSyrupVaultCalldata: ({ shares, owner }: RequestRedeemSyrupVaultArgs) => HexString;
26
- export declare const requestRedeemSyrupVaultTrx: ({ args, syrupVaultAddress, }: {
27
- args: RequestRedeemSyrupVaultArgs;
28
- syrupVaultAddress: Address;
29
- }) => Unwrapable<Call>;
30
- //# sourceMappingURL=syrup.vault.d.ts.map
@@ -1 +0,0 @@
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,6BAA6B,GAAG,QAAQ,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH,eAAO,MAAM,iCAAiC,sBAAuB,6BAA6B,KAAG,SAEpG,CAAC;AAEF,eAAO,MAAM,4BAA4B;UAI/B,6BAA6B;uBAChB,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"}
@@ -1,2 +0,0 @@
1
- export * from "./syrup.vault";
2
- export { default as SyrupVaultAbi } from "./syrup.vault.abi";
@@ -1,65 +0,0 @@
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: "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" },
32
- ],
33
- name: "requestRedeem",
34
- outputs: [
35
- {
36
- internalType: "uint256",
37
- name: "escrowedShares_",
38
- type: "uint256",
39
- },
40
- ],
41
- stateMutability: "nonpayable",
42
- type: "function",
43
- },
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
- ] as const;
@@ -1,91 +0,0 @@
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
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 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)
67
- // ============================================================================
68
-
69
- export type RequestRedeemSyrupVaultArgs = Readonly<{
70
- shares: bigint;
71
- owner: Address;
72
- }>;
73
-
74
- export const RequestRedeemSyrupVaultCalldata = ({ shares, owner }: RequestRedeemSyrupVaultArgs): HexString => {
75
- return syrupVaultInterface.encodeFunctionData("requestRedeem", [shares, owner]) as HexString;
76
- };
77
-
78
- export const requestRedeemSyrupVaultTrx = ({
79
- args,
80
- syrupVaultAddress,
81
- }: {
82
- args: RequestRedeemSyrupVaultArgs;
83
- syrupVaultAddress: Address;
84
- }): Unwrapable<Call> => {
85
- return createCall({
86
- operation: 0,
87
- to: syrupVaultAddress,
88
- value: 0n,
89
- data: RequestRedeemSyrupVaultCalldata(args),
90
- });
91
- };