@unionlabs/payments 0.2.1 → 0.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.
- package/ChainRegistry/package.json +6 -0
- package/README.md +283 -1
- package/dist/cjs/Attestor.js +9 -2
- package/dist/cjs/Attestor.js.map +1 -1
- package/dist/cjs/ChainRegistry.js +24 -0
- package/dist/cjs/ChainRegistry.js.map +1 -0
- package/dist/cjs/Domain.js +8 -2
- package/dist/cjs/Domain.js.map +1 -1
- package/dist/cjs/Error.js +1 -1
- package/dist/cjs/Error.js.map +1 -1
- package/dist/cjs/EvmPublicClient.js +5 -277
- package/dist/cjs/EvmPublicClient.js.map +1 -1
- package/dist/cjs/EvmWalletClient.js +7 -642
- package/dist/cjs/EvmWalletClient.js.map +1 -1
- package/dist/cjs/Payment.js +86 -79
- package/dist/cjs/Payment.js.map +1 -1
- package/dist/cjs/Prover.js +2 -2
- package/dist/cjs/Prover.js.map +1 -1
- package/dist/cjs/PublicClient.js +2 -2
- package/dist/cjs/PublicClient.js.map +1 -1
- package/dist/cjs/WalletClient.js +2 -2
- package/dist/cjs/WalletClient.js.map +1 -1
- package/dist/cjs/constants/ibc-core-registry.js +7 -9
- package/dist/cjs/constants/ibc-core-registry.js.map +1 -1
- package/dist/cjs/constants/z-asset-registry.js +9 -7
- package/dist/cjs/constants/z-asset-registry.js.map +1 -1
- package/dist/cjs/internal/evmPublicClient.js +261 -0
- package/dist/cjs/internal/evmPublicClient.js.map +1 -0
- package/dist/cjs/internal/evmWalletClient.js +650 -0
- package/dist/cjs/internal/evmWalletClient.js.map +1 -1
- package/dist/cjs/internal/publicClient.js +0 -2
- package/dist/cjs/internal/publicClient.js.map +1 -1
- package/dist/cjs/promises/Payment.js +4 -3
- package/dist/cjs/promises/Payment.js.map +1 -1
- package/dist/cjs/promises/PublicClient.js +1 -2
- package/dist/cjs/promises/PublicClient.js.map +1 -1
- package/dist/cjs/promises/WalletClient.js +0 -1
- package/dist/cjs/promises/WalletClient.js.map +1 -1
- package/dist/cjs/rpc.js +3 -5
- package/dist/cjs/rpc.js.map +1 -1
- package/dist/dts/Attestor.d.ts +21 -6
- package/dist/dts/Attestor.d.ts.map +1 -1
- package/dist/dts/ChainRegistry.d.ts +6 -0
- package/dist/dts/ChainRegistry.d.ts.map +1 -0
- package/dist/dts/Domain.d.ts +92 -59
- package/dist/dts/Domain.d.ts.map +1 -1
- package/dist/dts/Error.d.ts +2 -2
- package/dist/dts/Error.d.ts.map +1 -1
- package/dist/dts/EvmPublicClient.d.ts +7 -19
- package/dist/dts/EvmPublicClient.d.ts.map +1 -1
- package/dist/dts/EvmWalletClient.d.ts +7 -23
- package/dist/dts/EvmWalletClient.d.ts.map +1 -1
- package/dist/dts/Payment.d.ts +72 -71
- package/dist/dts/Payment.d.ts.map +1 -1
- package/dist/dts/Prover.d.ts +6 -0
- package/dist/dts/Prover.d.ts.map +1 -1
- package/dist/dts/PublicClient.d.ts +11 -15
- package/dist/dts/PublicClient.d.ts.map +1 -1
- package/dist/dts/WalletClient.d.ts +10 -6
- package/dist/dts/WalletClient.d.ts.map +1 -1
- package/dist/dts/constants/ibc-core-registry.d.ts +5 -6
- package/dist/dts/constants/ibc-core-registry.d.ts.map +1 -1
- package/dist/dts/constants/z-asset-registry.d.ts +4 -4
- package/dist/dts/constants/z-asset-registry.d.ts.map +1 -1
- package/dist/dts/internal/evm.d.ts +3 -3
- package/dist/dts/internal/evm.d.ts.map +1 -1
- package/dist/dts/internal/evmPublicClient.d.ts +6 -0
- package/dist/dts/internal/evmPublicClient.d.ts.map +1 -0
- package/dist/dts/promises/Attestor.d.ts +5 -5
- package/dist/dts/promises/EvmPublicClient.d.ts +73 -74
- package/dist/dts/promises/EvmPublicClient.d.ts.map +1 -1
- package/dist/dts/promises/EvmWalletClient.d.ts +4 -5
- package/dist/dts/promises/EvmWalletClient.d.ts.map +1 -1
- package/dist/dts/promises/Payment.d.ts +39 -17
- package/dist/dts/promises/Payment.d.ts.map +1 -1
- package/dist/dts/promises/PublicClient.d.ts +3 -4
- package/dist/dts/promises/PublicClient.d.ts.map +1 -1
- package/dist/dts/promises/WalletClient.d.ts +77 -34
- package/dist/dts/promises/WalletClient.d.ts.map +1 -1
- package/dist/dts/rpc.d.ts +31 -0
- package/dist/dts/rpc.d.ts.map +1 -1
- package/dist/esm/Attestor.js +8 -1
- package/dist/esm/Attestor.js.map +1 -1
- package/dist/esm/ChainRegistry.js +16 -0
- package/dist/esm/ChainRegistry.js.map +1 -0
- package/dist/esm/Domain.js +7 -1
- package/dist/esm/Domain.js.map +1 -1
- package/dist/esm/Error.js +1 -1
- package/dist/esm/Error.js.map +1 -1
- package/dist/esm/EvmPublicClient.js +4 -275
- package/dist/esm/EvmPublicClient.js.map +1 -1
- package/dist/esm/EvmWalletClient.js +5 -638
- package/dist/esm/EvmWalletClient.js.map +1 -1
- package/dist/esm/Payment.js +84 -78
- package/dist/esm/Payment.js.map +1 -1
- package/dist/esm/Prover.js +1 -1
- package/dist/esm/Prover.js.map +1 -1
- package/dist/esm/PublicClient.js +2 -2
- package/dist/esm/PublicClient.js.map +1 -1
- package/dist/esm/WalletClient.js +2 -2
- package/dist/esm/WalletClient.js.map +1 -1
- package/dist/esm/constants/ibc-core-registry.js +5 -6
- package/dist/esm/constants/ibc-core-registry.js.map +1 -1
- package/dist/esm/constants/z-asset-registry.js +7 -4
- package/dist/esm/constants/z-asset-registry.js.map +1 -1
- package/dist/esm/internal/evmPublicClient.js +253 -0
- package/dist/esm/internal/evmPublicClient.js.map +1 -0
- package/dist/esm/internal/evmWalletClient.js +647 -1
- package/dist/esm/internal/evmWalletClient.js.map +1 -1
- package/dist/esm/internal/publicClient.js +0 -2
- package/dist/esm/internal/publicClient.js.map +1 -1
- package/dist/esm/promises/Payment.js +2 -2
- package/dist/esm/promises/Payment.js.map +1 -1
- package/dist/esm/promises/PublicClient.js +2 -3
- package/dist/esm/promises/PublicClient.js.map +1 -1
- package/dist/esm/promises/WalletClient.js +0 -1
- package/dist/esm/promises/WalletClient.js.map +1 -1
- package/dist/esm/rpc.js +2 -4
- package/dist/esm/rpc.js.map +1 -1
- package/package.json +15 -3
- package/src/Attestor.ts +12 -3
- package/src/ChainRegistry.ts +27 -0
- package/src/Domain.ts +30 -9
- package/src/Error.ts +1 -0
- package/src/EvmPublicClient.ts +9 -488
- package/src/EvmWalletClient.ts +21 -973
- package/src/Payment.ts +234 -159
- package/src/Prover.ts +2 -2
- package/src/PublicClient.ts +11 -18
- package/src/WalletClient.ts +11 -7
- package/src/constants/ibc-core-registry.ts +14 -14
- package/src/constants/z-asset-registry.ts +10 -7
- package/src/internal/evmPublicClient.ts +459 -0
- package/src/internal/evmWalletClient.ts +1008 -0
- package/src/internal/publicClient.ts +0 -3
- package/src/promises/Payment.ts +26 -25
- package/src/promises/PublicClient.ts +2 -3
- package/src/promises/WalletClient.ts +0 -1
- package/src/rpc.ts +2 -4
- package/unionlabs-payments-0.3.1.tgz +0 -0
- package/src/tsdoc-metadata.json +0 -11
- /package/{constants → Constants}/ibc-core-registry/package.json +0 -0
- /package/{constants → Constants}/services/package.json +0 -0
- /package/{constants → Constants}/z-asset-registry/package.json +0 -0
package/dist/dts/Domain.d.ts
CHANGED
|
@@ -3,124 +3,153 @@ import type * as A from "effect/Array";
|
|
|
3
3
|
import * as Data from "effect/Data";
|
|
4
4
|
import * as S from "effect/Schema";
|
|
5
5
|
import type * as Viem from "viem";
|
|
6
|
-
export
|
|
6
|
+
export declare const UniversalChainId: S.brand<S.filter<typeof S.String>, "UniversalChainId">;
|
|
7
|
+
export type UniversalChainId = typeof UniversalChainId.Type;
|
|
7
8
|
export type PreparedRequest = Data.TaggedEnum<{
|
|
8
|
-
|
|
9
|
-
kind:
|
|
10
|
-
|
|
9
|
+
PreparedEvm: {
|
|
10
|
+
kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update";
|
|
11
|
+
universalChainId: UniversalChainId;
|
|
12
|
+
contractAddress: Erc20Address;
|
|
13
|
+
abi: Viem.Abi;
|
|
14
|
+
functionName: string;
|
|
15
|
+
args: ReadonlyArray<unknown>;
|
|
11
16
|
};
|
|
12
17
|
}>;
|
|
13
18
|
export declare const PreparedRequest: {
|
|
14
|
-
readonly
|
|
15
|
-
readonly _tag: "
|
|
16
|
-
readonly kind:
|
|
17
|
-
readonly
|
|
19
|
+
readonly PreparedEvm: Data.Case.Constructor<{
|
|
20
|
+
readonly _tag: "PreparedEvm";
|
|
21
|
+
readonly kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update";
|
|
22
|
+
readonly universalChainId: UniversalChainId;
|
|
23
|
+
readonly contractAddress: Erc20Address;
|
|
24
|
+
readonly abi: Viem.Abi;
|
|
25
|
+
readonly functionName: string;
|
|
26
|
+
readonly args: ReadonlyArray<unknown>;
|
|
18
27
|
}, "_tag">;
|
|
19
|
-
readonly $is: <Tag extends "
|
|
20
|
-
readonly _tag: "
|
|
21
|
-
readonly kind:
|
|
22
|
-
readonly
|
|
28
|
+
readonly $is: <Tag extends "PreparedEvm">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
29
|
+
readonly _tag: "PreparedEvm";
|
|
30
|
+
readonly kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update";
|
|
31
|
+
readonly universalChainId: UniversalChainId;
|
|
32
|
+
readonly contractAddress: Erc20Address;
|
|
33
|
+
readonly abi: Viem.Abi;
|
|
34
|
+
readonly functionName: string;
|
|
35
|
+
readonly args: ReadonlyArray<unknown>;
|
|
23
36
|
}, {
|
|
24
37
|
readonly _tag: Tag;
|
|
25
38
|
}>;
|
|
26
39
|
readonly $match: {
|
|
27
40
|
<const Cases extends {
|
|
28
|
-
readonly
|
|
29
|
-
readonly _tag: "
|
|
30
|
-
readonly kind:
|
|
31
|
-
readonly
|
|
41
|
+
readonly PreparedEvm: (args: {
|
|
42
|
+
readonly _tag: "PreparedEvm";
|
|
43
|
+
readonly kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update";
|
|
44
|
+
readonly universalChainId: UniversalChainId;
|
|
45
|
+
readonly contractAddress: Erc20Address;
|
|
46
|
+
readonly abi: Viem.Abi;
|
|
47
|
+
readonly functionName: string;
|
|
48
|
+
readonly args: ReadonlyArray<unknown>;
|
|
32
49
|
}) => any;
|
|
33
|
-
}>(cases: Cases & { [K in Exclude<keyof Cases, "
|
|
34
|
-
readonly _tag: "
|
|
35
|
-
readonly kind:
|
|
36
|
-
readonly
|
|
37
|
-
|
|
50
|
+
}>(cases: Cases & { [K in Exclude<keyof Cases, "PreparedEvm">]: never; }): (value: {
|
|
51
|
+
readonly _tag: "PreparedEvm";
|
|
52
|
+
readonly kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update";
|
|
53
|
+
readonly universalChainId: UniversalChainId;
|
|
54
|
+
readonly contractAddress: Erc20Address;
|
|
55
|
+
readonly abi: Viem.Abi;
|
|
56
|
+
readonly functionName: string;
|
|
57
|
+
readonly args: ReadonlyArray<unknown>;
|
|
58
|
+
}) => import("effect/Unify").Unify<ReturnType<Cases["PreparedEvm"]>>;
|
|
38
59
|
<const Cases extends {
|
|
39
|
-
readonly
|
|
40
|
-
readonly _tag: "
|
|
41
|
-
readonly kind:
|
|
42
|
-
readonly
|
|
60
|
+
readonly PreparedEvm: (args: {
|
|
61
|
+
readonly _tag: "PreparedEvm";
|
|
62
|
+
readonly kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update";
|
|
63
|
+
readonly universalChainId: UniversalChainId;
|
|
64
|
+
readonly contractAddress: Erc20Address;
|
|
65
|
+
readonly abi: Viem.Abi;
|
|
66
|
+
readonly functionName: string;
|
|
67
|
+
readonly args: ReadonlyArray<unknown>;
|
|
43
68
|
}) => any;
|
|
44
69
|
}>(value: {
|
|
45
|
-
readonly _tag: "
|
|
46
|
-
readonly kind:
|
|
47
|
-
readonly
|
|
48
|
-
|
|
70
|
+
readonly _tag: "PreparedEvm";
|
|
71
|
+
readonly kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update";
|
|
72
|
+
readonly universalChainId: UniversalChainId;
|
|
73
|
+
readonly contractAddress: Erc20Address;
|
|
74
|
+
readonly abi: Viem.Abi;
|
|
75
|
+
readonly functionName: string;
|
|
76
|
+
readonly args: ReadonlyArray<unknown>;
|
|
77
|
+
}, cases: Cases & { [K in Exclude<keyof Cases, "PreparedEvm">]: never; }): import("effect/Unify").Unify<ReturnType<Cases["PreparedEvm"]>>;
|
|
49
78
|
};
|
|
50
79
|
};
|
|
51
80
|
export type PreparedRequests = A.NonEmptyReadonlyArray<PreparedRequest>;
|
|
52
81
|
export type SignedRequest = Data.TaggedEnum<{
|
|
53
|
-
|
|
82
|
+
SignedEvm: {
|
|
54
83
|
value: Viem.SignTransactionReturnType;
|
|
55
84
|
};
|
|
56
85
|
}>;
|
|
57
86
|
export declare const SignedRequest: {
|
|
58
|
-
readonly
|
|
59
|
-
readonly _tag: "
|
|
87
|
+
readonly SignedEvm: Data.Case.Constructor<{
|
|
88
|
+
readonly _tag: "SignedEvm";
|
|
60
89
|
readonly value: Viem.SignTransactionReturnType;
|
|
61
90
|
}, "_tag">;
|
|
62
|
-
readonly $is: <Tag extends "
|
|
63
|
-
readonly _tag: "
|
|
91
|
+
readonly $is: <Tag extends "SignedEvm">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
92
|
+
readonly _tag: "SignedEvm";
|
|
64
93
|
readonly value: Viem.SignTransactionReturnType;
|
|
65
94
|
}, {
|
|
66
95
|
readonly _tag: Tag;
|
|
67
96
|
}>;
|
|
68
97
|
readonly $match: {
|
|
69
98
|
<const Cases extends {
|
|
70
|
-
readonly
|
|
71
|
-
readonly _tag: "
|
|
99
|
+
readonly SignedEvm: (args: {
|
|
100
|
+
readonly _tag: "SignedEvm";
|
|
72
101
|
readonly value: Viem.SignTransactionReturnType;
|
|
73
102
|
}) => any;
|
|
74
|
-
}>(cases: Cases & { [K in Exclude<keyof Cases, "
|
|
75
|
-
readonly _tag: "
|
|
103
|
+
}>(cases: Cases & { [K in Exclude<keyof Cases, "SignedEvm">]: never; }): (value: {
|
|
104
|
+
readonly _tag: "SignedEvm";
|
|
76
105
|
readonly value: Viem.SignTransactionReturnType;
|
|
77
|
-
}) => import("effect/Unify").Unify<ReturnType<Cases["
|
|
106
|
+
}) => import("effect/Unify").Unify<ReturnType<Cases["SignedEvm"]>>;
|
|
78
107
|
<const Cases extends {
|
|
79
|
-
readonly
|
|
80
|
-
readonly _tag: "
|
|
108
|
+
readonly SignedEvm: (args: {
|
|
109
|
+
readonly _tag: "SignedEvm";
|
|
81
110
|
readonly value: Viem.SignTransactionReturnType;
|
|
82
111
|
}) => any;
|
|
83
112
|
}>(value: {
|
|
84
|
-
readonly _tag: "
|
|
113
|
+
readonly _tag: "SignedEvm";
|
|
85
114
|
readonly value: Viem.SignTransactionReturnType;
|
|
86
|
-
}, cases: Cases & { [K in Exclude<keyof Cases, "
|
|
115
|
+
}, cases: Cases & { [K in Exclude<keyof Cases, "SignedEvm">]: never; }): import("effect/Unify").Unify<ReturnType<Cases["SignedEvm"]>>;
|
|
87
116
|
};
|
|
88
117
|
};
|
|
89
118
|
export type SubmissionResult = Data.TaggedEnum<{
|
|
90
|
-
|
|
119
|
+
SubmissionEvm: {
|
|
91
120
|
hash: TxHash;
|
|
92
121
|
};
|
|
93
122
|
}>;
|
|
94
123
|
export declare const SubmissionResult: {
|
|
95
|
-
readonly
|
|
96
|
-
readonly _tag: "
|
|
124
|
+
readonly SubmissionEvm: Data.Case.Constructor<{
|
|
125
|
+
readonly _tag: "SubmissionEvm";
|
|
97
126
|
readonly hash: TxHash;
|
|
98
127
|
}, "_tag">;
|
|
99
|
-
readonly $is: <Tag extends "
|
|
100
|
-
readonly _tag: "
|
|
128
|
+
readonly $is: <Tag extends "SubmissionEvm">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
129
|
+
readonly _tag: "SubmissionEvm";
|
|
101
130
|
readonly hash: TxHash;
|
|
102
131
|
}, {
|
|
103
132
|
readonly _tag: Tag;
|
|
104
133
|
}>;
|
|
105
134
|
readonly $match: {
|
|
106
135
|
<const Cases extends {
|
|
107
|
-
readonly
|
|
108
|
-
readonly _tag: "
|
|
136
|
+
readonly SubmissionEvm: (args: {
|
|
137
|
+
readonly _tag: "SubmissionEvm";
|
|
109
138
|
readonly hash: TxHash;
|
|
110
139
|
}) => any;
|
|
111
|
-
}>(cases: Cases & { [K in Exclude<keyof Cases, "
|
|
112
|
-
readonly _tag: "
|
|
140
|
+
}>(cases: Cases & { [K in Exclude<keyof Cases, "SubmissionEvm">]: never; }): (value: {
|
|
141
|
+
readonly _tag: "SubmissionEvm";
|
|
113
142
|
readonly hash: TxHash;
|
|
114
|
-
}) => import("effect/Unify").Unify<ReturnType<Cases["
|
|
143
|
+
}) => import("effect/Unify").Unify<ReturnType<Cases["SubmissionEvm"]>>;
|
|
115
144
|
<const Cases extends {
|
|
116
|
-
readonly
|
|
117
|
-
readonly _tag: "
|
|
145
|
+
readonly SubmissionEvm: (args: {
|
|
146
|
+
readonly _tag: "SubmissionEvm";
|
|
118
147
|
readonly hash: TxHash;
|
|
119
148
|
}) => any;
|
|
120
149
|
}>(value: {
|
|
121
|
-
readonly _tag: "
|
|
150
|
+
readonly _tag: "SubmissionEvm";
|
|
122
151
|
readonly hash: TxHash;
|
|
123
|
-
}, cases: Cases & { [K in Exclude<keyof Cases, "
|
|
152
|
+
}, cases: Cases & { [K in Exclude<keyof Cases, "SubmissionEvm">]: never; }): import("effect/Unify").Unify<ReturnType<Cases["SubmissionEvm"]>>;
|
|
124
153
|
};
|
|
125
154
|
};
|
|
126
155
|
export declare const CounterpartyInfo: S.Struct<{
|
|
@@ -130,12 +159,16 @@ export declare const CounterpartyInfo: S.Struct<{
|
|
|
130
159
|
export type CounterpartyInfo = typeof CounterpartyInfo.Type;
|
|
131
160
|
export type Erc20Address = `0x${string}` & Brand.Brand<"Erc20Address">;
|
|
132
161
|
export declare const Erc20Address: Brand.Brand.Constructor<Erc20Address>;
|
|
133
|
-
export type
|
|
134
|
-
export declare const
|
|
162
|
+
export type IbcCoreAddress = `0x${string}` & Brand.Brand<"IbcCoreAddress">;
|
|
163
|
+
export declare const IbcCoreAddress: Brand.Brand.Constructor<IbcCoreAddress>;
|
|
135
164
|
export type LightClientAddress = `0x${string}` & Brand.Brand<"LightClientAddress">;
|
|
136
165
|
export declare const LightClientAddress: Brand.Brand.Constructor<LightClientAddress>;
|
|
137
166
|
export type TxHash = `0x${string}` & Brand.Brand<"TxHash">;
|
|
138
167
|
export declare const TxHash: Brand.Brand.Constructor<TxHash>;
|
|
139
168
|
export type ZAssetAddress = `0x${string}` & Brand.Brand<"ZAssetAddress">;
|
|
140
169
|
export declare const ZAssetAddress: Brand.Brand.Constructor<ZAssetAddress>;
|
|
170
|
+
export type PaymentKey = `0x${string}` & Brand.Brand<"PaymentKey">;
|
|
171
|
+
export declare const PaymentKey: Brand.Brand.Constructor<PaymentKey>;
|
|
172
|
+
export type Nullifier = bigint & Brand.Brand<"Nullifier">;
|
|
173
|
+
export declare const Nullifier: Brand.Brand.Constructor<Nullifier>;
|
|
141
174
|
//# sourceMappingURL=Domain.d.ts.map
|
package/dist/dts/Domain.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Domain.d.ts","sourceRoot":"","sources":["../../src/Domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,CAAC,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Domain.d.ts","sourceRoot":"","sources":["../../src/Domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC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,MAAM,YAAY,GAAG,KAAK,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AACvE,eAAO,MAAM,YAAY,uCAAgC,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,KAAK,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAC3E,eAAO,MAAM,cAAc,yCAAkC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,KAAK,MAAM,EAAE,GAC5C,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACpC,eAAO,MAAM,kBAAkB,6CAAsC,CAAC;AACtE,MAAM,MAAM,MAAM,GAAG,KAAK,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC3D,eAAO,MAAM,MAAM,iCAA0B,CAAC;AAC9C,MAAM,MAAM,aAAa,GAAG,KAAK,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;AACzE,eAAO,MAAM,aAAa,wCAAiC,CAAC;AAC5D,MAAM,MAAM,UAAU,GAAG,KAAK,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AACnE,eAAO,MAAM,UAAU,qCAA8B,CAAC;AACtD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAC1D,eAAO,MAAM,SAAS,oCAA6B,CAAC"}
|
package/dist/dts/Error.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export declare class BadArgument extends BadArgument_base {
|
|
|
57
57
|
* @since 1.0.0
|
|
58
58
|
* @category Model
|
|
59
59
|
*/
|
|
60
|
-
export declare const SystemErrorReason: Schema.Literal<["DynamicImport", "ReadContract", "InvalidData", "SimulateCalls"]>;
|
|
60
|
+
export declare const SystemErrorReason: Schema.Literal<["DynamicImport", "ReadContract", "InvalidData", "SimulateCalls", "Crypto"]>;
|
|
61
61
|
/**
|
|
62
62
|
* @since 1.0.0
|
|
63
63
|
* @category Model
|
|
@@ -66,7 +66,7 @@ export type SystemErrorReason = typeof SystemErrorReason.Type;
|
|
|
66
66
|
declare const SystemError_base: Schema.TaggedErrorClass<SystemError, "SystemError", {
|
|
67
67
|
readonly _tag: Schema.tag<"SystemError">;
|
|
68
68
|
} & {
|
|
69
|
-
reason: Schema.Literal<["DynamicImport", "ReadContract", "InvalidData", "SimulateCalls"]>;
|
|
69
|
+
reason: Schema.Literal<["DynamicImport", "ReadContract", "InvalidData", "SimulateCalls", "Crypto"]>;
|
|
70
70
|
module: Schema.Literal<["EvmWalletClient", "EvmPublicClient", "PaymentClient", "Prover", "Attestor", "IbcCoreRegistry"]>;
|
|
71
71
|
method: typeof Schema.String;
|
|
72
72
|
description: Schema.optional<typeof Schema.String>;
|
package/dist/dts/Error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../src/Error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,OAAO,MAAgD,CAAC;AAE7E;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,QACX,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,WAAW,GACtB,KAAK,CAAC,MAAM,SAAS,MAAM,EAC3B,KAAK,CAAC,GAAG,SAAS,MAAM,EAExB,QAAQ,MAAM,EACd,KAAK,GAAG,KACP,CAAC,KAAK,CAAC,SAAS,MAAM,CAAC,MAAM,EA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AAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAA;CAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAO9D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,kHAclB,CAAC;;;;;;;;;AAEF;;;GAGG;AACH,qBAAa,WAAY,SAAQ,gBAO/B;IACA;;OAEG;IACH,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,MAAM,CAAU;IAE1C;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,6FAe7B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAC;;;;;;;;;;;;AAE9D;;;GAGG;AACH,qBAAa,WAAY,SAAQ,gBAU/B;IACA;;OAEG;IACH,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,MAAM,CAAU;IAE1C;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAIpB;CACF;AAED;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,WAAW,EAAE,OAAO,WAAW,CAAC,CACpC,CAAC"}
|
|
@@ -2,26 +2,26 @@ import * as Context from "effect/Context";
|
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import type * as Viem from "viem";
|
|
5
|
-
import type
|
|
6
|
-
import * as Error from "./Error.js";
|
|
5
|
+
import type * as Domain from "./Domain.js";
|
|
6
|
+
import type * as Error from "./Error.js";
|
|
7
7
|
import * as Client from "./PublicClient.js";
|
|
8
8
|
/**
|
|
9
|
+
* @since 0.0.0
|
|
9
10
|
* @category type ids
|
|
10
|
-
* @since 1.0.0
|
|
11
11
|
*/
|
|
12
|
-
export declare const TypeId:
|
|
12
|
+
export declare const TypeId: unique symbol;
|
|
13
13
|
/**
|
|
14
|
+
* @since 0.0.0
|
|
14
15
|
* @category type ids
|
|
15
|
-
* @since 1.0.0
|
|
16
16
|
*/
|
|
17
|
-
export type TypeId =
|
|
17
|
+
export type TypeId = typeof TypeId;
|
|
18
18
|
/**
|
|
19
19
|
* @category models
|
|
20
20
|
* @since 1.0.0
|
|
21
21
|
*/
|
|
22
22
|
export interface EvmPublicClient extends Client.PublicClient {
|
|
23
23
|
readonly [TypeId]: TypeId;
|
|
24
|
-
readonly waitForTransactionReceipt: (hash: TxHash) => Effect.Effect<Viem.TransactionReceipt, Error.SdkError, never>;
|
|
24
|
+
readonly waitForTransactionReceipt: (hash: Domain.TxHash) => Effect.Effect<Viem.TransactionReceipt, Error.SdkError, never>;
|
|
25
25
|
readonly simulateCalls: (params: {
|
|
26
26
|
calls: Array<{
|
|
27
27
|
to: `0x${string}`;
|
|
@@ -41,18 +41,6 @@ export declare const EvmPublicClient: Context.Tag<EvmPublicClient, EvmPublicClie
|
|
|
41
41
|
* @since 1.0.0
|
|
42
42
|
*/
|
|
43
43
|
export type EvmPublicClientConfig = {};
|
|
44
|
-
/**
|
|
45
|
-
* A type-safe wrapper around viem's writeContract that handles error cases
|
|
46
|
-
* and returns an Effect with proper type inference. Extracts all error info
|
|
47
|
-
*
|
|
48
|
-
* @param client - The viem PublicClient to use for the contract transaction
|
|
49
|
-
* @param params - The parameters for the contract transaction
|
|
50
|
-
* @returns An Effect that resolves to the transaction hash
|
|
51
|
-
*
|
|
52
|
-
* @category utils
|
|
53
|
-
* @since 0.0.0
|
|
54
|
-
*/
|
|
55
|
-
export declare const makeViem: (client: Viem.PublicClient) => Effect.Effect<EvmPublicClient, Error.SdkError, never>;
|
|
56
44
|
/**
|
|
57
45
|
* @category layers
|
|
58
46
|
* @since 1.0.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvmPublicClient.d.ts","sourceRoot":"","sources":["../../src/EvmPublicClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"EvmPublicClient.d.ts","sourceRoot":"","sources":["../../src/EvmPublicClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,IAAI,MAAM,MAAM,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,OAAO,MAAwB,CAAC;AAErD;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,YAAY;IAC1D,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,yBAAyB,EAAE,CAClC,IAAI,EAAE,MAAM,CAAC,MAAM,KAChB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEnE,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE;QAC/B,KAAK,EAAE,KAAK,CAAC;YACX,EAAE,EAAE,KAAK,MAAM,EAAE,CAAC;YAClB,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;YACpB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SAC5B,CAAC,CAAC;QACH,OAAO,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;KACzB,KAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;CACjD;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,+CAE3B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,IAAI,CAAC,YAAY,KACxB,KAAK,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ,CAOjE,CAAC"}
|
|
@@ -2,32 +2,28 @@ import * as Context from "effect/Context";
|
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import type * as P from "effect/Predicate";
|
|
5
|
-
import type * as Scope from "effect/Scope";
|
|
6
5
|
import type * as Mipd from "mipd";
|
|
7
6
|
import type * as Viem from "viem";
|
|
8
|
-
import * as
|
|
7
|
+
import type * as Domain from "./Domain.js";
|
|
8
|
+
import type * as Error from "./Error.js";
|
|
9
9
|
import * as Client from "./WalletClient.js";
|
|
10
10
|
/**
|
|
11
|
+
* @since 0.0.0
|
|
11
12
|
* @category type ids
|
|
12
|
-
* @since 1.0.0
|
|
13
13
|
*/
|
|
14
|
-
export declare const TypeId:
|
|
14
|
+
export declare const TypeId: unique symbol;
|
|
15
15
|
/**
|
|
16
|
+
* @since 0.0.0
|
|
16
17
|
* @category type ids
|
|
17
|
-
* @since 1.0.0
|
|
18
18
|
*/
|
|
19
|
-
export type TypeId =
|
|
19
|
+
export type TypeId = typeof TypeId;
|
|
20
20
|
/**
|
|
21
21
|
* @category models
|
|
22
22
|
* @since 1.0.0
|
|
23
23
|
*/
|
|
24
24
|
export interface EvmWalletClient extends Client.WalletClient {
|
|
25
25
|
readonly [TypeId]: TypeId;
|
|
26
|
-
readonly prepareBatchTransactionRequest: (
|
|
27
|
-
to: `0x${string}`;
|
|
28
|
-
data: `0x${string}`;
|
|
29
|
-
value?: bigint;
|
|
30
|
-
}>) => Effect.Effect<Array<any>, Error.SdkError, never>;
|
|
26
|
+
readonly prepareBatchTransactionRequest: (requests: ReadonlyArray<Domain.PreparedRequest>) => Effect.Effect<ReadonlyArray<Viem.PrepareTransactionRequestReturnType>, Error.SdkError, never>;
|
|
31
27
|
}
|
|
32
28
|
/**
|
|
33
29
|
* @category tags
|
|
@@ -39,18 +35,6 @@ export declare const EvmWalletClient: Context.Tag<EvmWalletClient, EvmWalletClie
|
|
|
39
35
|
* @since 1.0.0
|
|
40
36
|
*/
|
|
41
37
|
export type EvmWalletClientConfig = {};
|
|
42
|
-
/**
|
|
43
|
-
* A type-safe wrapper around viem's writeContract that handles error cases
|
|
44
|
-
* and returns an Effect with proper type inference. Extracts all error info
|
|
45
|
-
*
|
|
46
|
-
* @param client - The viem WalletClient to use for the contract transaction
|
|
47
|
-
* @param params - The parameters for the contract transaction
|
|
48
|
-
* @returns An Effect that resolves to the transaction hash
|
|
49
|
-
*
|
|
50
|
-
* @category utils
|
|
51
|
-
* @since 0.0.0
|
|
52
|
-
*/
|
|
53
|
-
export declare const makeViem: <transport extends Viem.Transport = Viem.Transport, chain extends Viem.Chain | undefined = Viem.Chain | undefined, account extends Viem.Account | undefined = Viem.Account | undefined, rpcSchema extends Viem.RpcSchema | undefined = undefined>(wallet: Viem.WalletClient<transport, chain, account, rpcSchema>) => Effect.Effect<EvmWalletClient, Error.SdkError, Scope.Scope>;
|
|
54
38
|
/**
|
|
55
39
|
* @category layers
|
|
56
40
|
* @since 1.0.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvmWalletClient.d.ts","sourceRoot":"","sources":["../../src/EvmWalletClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EvmWalletClient.d.ts","sourceRoot":"","sources":["../../src/EvmWalletClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC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AAC,CAAC;IAC3D,gBAAgB,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC;CAC9C,KAAG,KAAK,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ,CAOlE,CAAC"}
|
package/dist/dts/Payment.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* - for redemptions you need wallet on dest chain
|
|
4
4
|
*/
|
|
5
5
|
import { Effect } from "effect";
|
|
6
|
+
import * as Layer from "effect/Layer";
|
|
6
7
|
import { type Address } from "viem";
|
|
7
|
-
import * as Attestor from "./Attestor.js";
|
|
8
|
-
import type { Erc20Address } from "./Domain.js";
|
|
8
|
+
import type * as Attestor from "./Attestor.js";
|
|
9
9
|
import * as Domain from "./Domain.js";
|
|
10
10
|
import * as Error from "./Error.js";
|
|
11
11
|
import * as Prover from "./Prover.js";
|
|
@@ -17,15 +17,11 @@ import * as WalletClient from "./WalletClient.js";
|
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
19
|
export interface DepositOptions {
|
|
20
|
-
|
|
21
|
-
readonly paymentKey: PS.Hex;
|
|
22
|
-
/** Array of 0-4 beneficiary addresses*/
|
|
23
|
-
readonly beneficiaries: ReadonlyArray<Address>;
|
|
20
|
+
readonly depositAddress: DepositAddress;
|
|
24
21
|
/** Amount to deposit (in underlying token's smallest unit) */
|
|
25
22
|
readonly amount: bigint;
|
|
26
|
-
readonly destinationChainId: bigint;
|
|
27
|
-
readonly sourceChainId: bigint;
|
|
28
23
|
readonly srcErc20Address: Domain.Erc20Address;
|
|
24
|
+
readonly destinationChainId: Domain.UniversalChainId;
|
|
29
25
|
}
|
|
30
26
|
/**
|
|
31
27
|
* @public
|
|
@@ -46,8 +42,29 @@ export interface RedeemOptions {
|
|
|
46
42
|
/** Auto unwrap */
|
|
47
43
|
unwrap?: boolean | undefined;
|
|
48
44
|
}
|
|
49
|
-
export
|
|
50
|
-
|
|
45
|
+
export interface DepositAddress {
|
|
46
|
+
readonly beneficiaries: [
|
|
47
|
+
Domain.Erc20Address,
|
|
48
|
+
Domain.Erc20Address,
|
|
49
|
+
Domain.Erc20Address,
|
|
50
|
+
Domain.Erc20Address
|
|
51
|
+
];
|
|
52
|
+
readonly zAssetAddress: Domain.ZAssetAddress;
|
|
53
|
+
readonly destinationChainId: Domain.UniversalChainId;
|
|
54
|
+
}
|
|
55
|
+
export declare const getDepositAddress: (options: {
|
|
56
|
+
paymentKey: Domain.PaymentKey;
|
|
57
|
+
beneficiaries: ReadonlyArray<Domain.Erc20Address>;
|
|
58
|
+
destinationChainId: Domain.UniversalChainId;
|
|
59
|
+
}) => Effect.Effect<{
|
|
60
|
+
beneficiaries: [Domain.Erc20Address, Domain.Erc20Address, Domain.Erc20Address, Domain.Erc20Address];
|
|
61
|
+
zAssetAddress: Domain.ZAssetAddress;
|
|
62
|
+
destinationChainId: string & import("effect/Brand").Brand<"UniversalChainId">;
|
|
63
|
+
}, Error.SdkError, never>;
|
|
64
|
+
export declare const getNullifier: (options: {
|
|
65
|
+
paymentKey: Domain.PaymentKey;
|
|
66
|
+
destinationChainId: Domain.UniversalChainId;
|
|
67
|
+
}) => Effect.Effect<Domain.Nullifier, Error.SdkError, never>;
|
|
51
68
|
/**
|
|
52
69
|
* Deterministically shuffle light clients using the secret as seed.
|
|
53
70
|
* Same secret always produces the same ordering for privacy.
|
|
@@ -55,74 +72,58 @@ export declare const getNullifier: (secret: `0x${string}`, destinationChainId: b
|
|
|
55
72
|
*/
|
|
56
73
|
export declare function deterministicShuffleClients(clients: LightClientData[], secret: PS.Hex): LightClientData[];
|
|
57
74
|
export declare const computeStorageSlot: (address: `0x${string}`, mappingSlot: bigint) => Effect.Effect<`0x${string}`, never, never>;
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
dstChainId: bigint;
|
|
67
|
-
srcErc20Address: Erc20Address;
|
|
68
|
-
dstErc20Address: Erc20Address;
|
|
69
|
-
}) => Effect.Effect<{
|
|
70
|
-
readonly proof: {
|
|
71
|
-
readonly proof: readonly [string, string, string, string, string, string, string, string];
|
|
72
|
-
readonly commitments: readonly [string, string];
|
|
73
|
-
readonly commitmentPok: readonly [string, string];
|
|
74
|
-
readonly publicInputs: readonly string[];
|
|
75
|
-
};
|
|
76
|
-
readonly metadata: {
|
|
77
|
-
readonly depositAddress: Domain.ZAssetAddress;
|
|
78
|
-
readonly beneficiary: `0x${string}`;
|
|
79
|
-
readonly value: bigint;
|
|
80
|
-
readonly lightClients: LightClientData[];
|
|
81
|
-
readonly nullifier: bigint;
|
|
82
|
-
};
|
|
83
|
-
}, Error.SdkError | {
|
|
84
|
-
proof: {
|
|
85
|
-
success: boolean;
|
|
86
|
-
error: string;
|
|
75
|
+
export interface Proof {
|
|
76
|
+
proof: Prover.Proof;
|
|
77
|
+
metadata: {
|
|
78
|
+
depositAddress: Domain.ZAssetAddress;
|
|
79
|
+
beneficiary: Domain.Erc20Address;
|
|
80
|
+
value: bigint;
|
|
81
|
+
lightClients: LightClientData[];
|
|
82
|
+
nullifier: Domain.Nullifier;
|
|
87
83
|
};
|
|
88
|
-
}
|
|
89
|
-
export declare const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
/** Array of 0-4 beneficiary addresses */
|
|
93
|
-
beneficiaries: Address[];
|
|
94
|
-
/** The beneficiary address to redeem to */
|
|
95
|
-
beneficiary: Address;
|
|
96
|
-
/** Amount to redeem */
|
|
84
|
+
}
|
|
85
|
+
export declare const generateProof: (options: {
|
|
86
|
+
paymentKey: Domain.PaymentKey;
|
|
87
|
+
beneficiary: Domain.Erc20Address;
|
|
97
88
|
amount: bigint;
|
|
98
|
-
/** Light client IDs to include in the proof (for anonymity set) */
|
|
99
89
|
clientIds: number[];
|
|
100
|
-
/** The specific light client ID to use for the proof */
|
|
101
90
|
selectedClientId: number;
|
|
102
|
-
|
|
103
|
-
|
|
91
|
+
nullifier: Domain.Nullifier;
|
|
92
|
+
depositAddress: DepositAddress;
|
|
93
|
+
srcChainId: Domain.UniversalChainId;
|
|
104
94
|
srcErc20Address: Domain.Erc20Address;
|
|
105
95
|
dstErc20Address: Domain.Erc20Address;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}, Error.SdkError
|
|
113
|
-
|
|
114
|
-
success: boolean;
|
|
115
|
-
error: string;
|
|
116
|
-
};
|
|
117
|
-
}, Attestor.Attestor | PublicClient.PublicClient | PublicClient.SourcePublicClient | PublicClient.DestinationPublicClient | WalletClient.DestinationWalletClient | Prover.Prover>;
|
|
118
|
-
export declare const generateKey: Effect.Effect<`0x${string}`, never, never>;
|
|
96
|
+
}) => Effect.Effect<Proof, Error.SdkError, PublicClient.SourcePublicClient | PublicClient.DestinationPublicClient | PublicClient.PublicClient | Prover.Prover>;
|
|
97
|
+
export declare const prepareRedemption: (options: {
|
|
98
|
+
universalChainId: Domain.UniversalChainId;
|
|
99
|
+
dstErc20Address: Domain.Erc20Address;
|
|
100
|
+
attestation: Attestor.Attestation;
|
|
101
|
+
proof: Proof;
|
|
102
|
+
}) => Effect.Effect<Domain.PreparedRequest, Error.SdkError, WalletClient.DestinationWalletClient>;
|
|
103
|
+
export declare const generateKey: Effect.Effect<Domain.PaymentKey, Error.SdkError>;
|
|
119
104
|
export declare const prepareDeposit: (options: DepositOptions) => Effect.Effect<readonly [{
|
|
120
|
-
readonly _tag: "
|
|
121
|
-
readonly kind:
|
|
122
|
-
readonly
|
|
105
|
+
readonly _tag: "PreparedEvm";
|
|
106
|
+
readonly kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update";
|
|
107
|
+
readonly universalChainId: Domain.UniversalChainId;
|
|
108
|
+
readonly contractAddress: Domain.Erc20Address;
|
|
109
|
+
readonly abi: import("viem").Abi;
|
|
110
|
+
readonly functionName: string;
|
|
111
|
+
readonly args: ReadonlyArray<unknown>;
|
|
123
112
|
}, ...{
|
|
124
|
-
readonly _tag: "
|
|
125
|
-
readonly kind:
|
|
126
|
-
readonly
|
|
113
|
+
readonly _tag: "PreparedEvm";
|
|
114
|
+
readonly kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update";
|
|
115
|
+
readonly universalChainId: Domain.UniversalChainId;
|
|
116
|
+
readonly contractAddress: Domain.Erc20Address;
|
|
117
|
+
readonly abi: import("viem").Abi;
|
|
118
|
+
readonly functionName: string;
|
|
119
|
+
readonly args: ReadonlyArray<unknown>;
|
|
127
120
|
}[]], Error.SdkError, WalletClient.SourceWalletClient>;
|
|
121
|
+
/**
|
|
122
|
+
* @category layers
|
|
123
|
+
* @since 1.0.0
|
|
124
|
+
*/
|
|
125
|
+
export declare const layerSingleChain: <E1, E2, R1 = never, R2 = never>(options: {
|
|
126
|
+
walletClient: Layer.Layer<WalletClient.WalletClient, E1, R1>;
|
|
127
|
+
publicClient: Layer.Layer<PublicClient.PublicClient, E2, R2>;
|
|
128
|
+
}) => Layer.Layer<WalletClient.SourceWalletClient | WalletClient.DestinationWalletClient | WalletClient.WalletClient | PublicClient.SourcePublicClient | PublicClient.DestinationPublicClient | PublicClient.PublicClient, E1 | E2 | Error.SdkError, R1 | R2>;
|
|
128
129
|
//# sourceMappingURL=Payment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Payment.d.ts","sourceRoot":"","sources":["../../src/Payment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAQ,MAAM,QAAQ,CAAC;AAEtC,OAAO,
|
|
1
|
+
{"version":3,"file":"Payment.d.ts","sourceRoot":"","sources":["../../src/Payment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAQ,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,KAA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AC,KAAK,CACX,YAAY,CAAC,kBAAkB,GAC/B,YAAY,CAAC,uBAAuB,GACpC,YAAY,CAAC,YAAY,GACzB,YAAY,CAAC,kBAAkB,GAC/B,YAAY,CAAC,uBAAuB,GACpC,YAAY,CAAC,YAAY,EAC3B,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,QAAQ,EACxB,EAAE,GAAG,EAAE,CASN,CAAC"}
|
package/dist/dts/Prover.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ import type * as Domain from "./Domain.js";
|
|
|
6
6
|
import * as Error from "./Error.js";
|
|
7
7
|
import * as GenProver from "./gen/prover_pb.js";
|
|
8
8
|
import type { LightClientData, MptProofData } from "./types.js";
|
|
9
|
+
export declare const Options: S.Struct<{
|
|
10
|
+
proverUrl: S.optionalWith<S.Union<[typeof S.URLFromSelf, typeof S.URL]>, {
|
|
11
|
+
default: () => URL;
|
|
12
|
+
}>;
|
|
13
|
+
}>;
|
|
14
|
+
export type Options = typeof Options.Type;
|
|
9
15
|
/**
|
|
10
16
|
* Result from the prover server after proof generation.
|
|
11
17
|
* @public
|