damm-sdk 1.3.1 → 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.
@@ -17,4 +17,5 @@ export * from "./cctp";
17
17
  export * from "./erc721";
18
18
  export * from "./iporFusion";
19
19
  export * from "./originArm";
20
+ export * from "./syrup";
20
21
  //# 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"}
@@ -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.2",
8
8
  "files": [
9
9
  "dist",
10
10
  "src",
@@ -17,3 +17,4 @@ export * from "./cctp";
17
17
  export * from "./erc721";
18
18
  export * from "./iporFusion";
19
19
  export * from "./originArm";
20
+ export * from "./syrup";
@@ -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
+ };