x402z-shared 0.0.2 → 0.0.4
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/dist/chunk-LTE4V3LT.mjs +156 -0
- package/dist/index.d.mts +4 -35
- package/dist/index.d.ts +4 -35
- package/dist/index.js +95 -3
- package/dist/index.mjs +53 -14
- package/dist/types-Cy4f8wJ6.d.mts +266 -0
- package/dist/types-Cy4f8wJ6.d.ts +266 -0
- package/dist/types-gx3OAvqG.d.mts +266 -0
- package/dist/types-gx3OAvqG.d.ts +266 -0
- package/dist/web.d.mts +13 -2
- package/dist/web.d.ts +13 -2
- package/dist/web.js +119 -3
- package/dist/web.mjs +76 -14
- package/package.json +1 -1
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { FhevmInstanceConfig, createInstance } from '@zama-fhe/relayer-sdk/node';
|
|
2
|
+
|
|
3
|
+
declare const confidentialTokenAbi: readonly [{
|
|
4
|
+
readonly inputs: readonly [{
|
|
5
|
+
readonly components: readonly [{
|
|
6
|
+
readonly internalType: "address";
|
|
7
|
+
readonly name: "holder";
|
|
8
|
+
readonly type: "address";
|
|
9
|
+
}, {
|
|
10
|
+
readonly internalType: "address";
|
|
11
|
+
readonly name: "payee";
|
|
12
|
+
readonly type: "address";
|
|
13
|
+
}, {
|
|
14
|
+
readonly internalType: "uint256";
|
|
15
|
+
readonly name: "maxClearAmount";
|
|
16
|
+
readonly type: "uint256";
|
|
17
|
+
}, {
|
|
18
|
+
readonly internalType: "bytes32";
|
|
19
|
+
readonly name: "resourceHash";
|
|
20
|
+
readonly type: "bytes32";
|
|
21
|
+
}, {
|
|
22
|
+
readonly internalType: "uint48";
|
|
23
|
+
readonly name: "validAfter";
|
|
24
|
+
readonly type: "uint48";
|
|
25
|
+
}, {
|
|
26
|
+
readonly internalType: "uint48";
|
|
27
|
+
readonly name: "validBefore";
|
|
28
|
+
readonly type: "uint48";
|
|
29
|
+
}, {
|
|
30
|
+
readonly internalType: "bytes32";
|
|
31
|
+
readonly name: "nonce";
|
|
32
|
+
readonly type: "bytes32";
|
|
33
|
+
}, {
|
|
34
|
+
readonly internalType: "bytes32";
|
|
35
|
+
readonly name: "encryptedAmountHash";
|
|
36
|
+
readonly type: "bytes32";
|
|
37
|
+
}];
|
|
38
|
+
readonly internalType: "struct FHEToken.ConfidentialPayment";
|
|
39
|
+
readonly name: "p";
|
|
40
|
+
readonly type: "tuple";
|
|
41
|
+
}, {
|
|
42
|
+
readonly internalType: "externalEuint64";
|
|
43
|
+
readonly name: "encryptedAmountInput";
|
|
44
|
+
readonly type: "bytes32";
|
|
45
|
+
}, {
|
|
46
|
+
readonly internalType: "bytes";
|
|
47
|
+
readonly name: "inputProof";
|
|
48
|
+
readonly type: "bytes";
|
|
49
|
+
}, {
|
|
50
|
+
readonly internalType: "bytes";
|
|
51
|
+
readonly name: "sig";
|
|
52
|
+
readonly type: "bytes";
|
|
53
|
+
}];
|
|
54
|
+
readonly name: "confidentialTransferWithAuthorization";
|
|
55
|
+
readonly outputs: readonly [{
|
|
56
|
+
readonly internalType: "euint64";
|
|
57
|
+
readonly name: "transferred";
|
|
58
|
+
readonly type: "bytes32";
|
|
59
|
+
}];
|
|
60
|
+
readonly stateMutability: "nonpayable";
|
|
61
|
+
readonly type: "function";
|
|
62
|
+
}, {
|
|
63
|
+
readonly anonymous: false;
|
|
64
|
+
readonly inputs: readonly [{
|
|
65
|
+
readonly indexed: true;
|
|
66
|
+
readonly internalType: "address";
|
|
67
|
+
readonly name: "holder";
|
|
68
|
+
readonly type: "address";
|
|
69
|
+
}, {
|
|
70
|
+
readonly indexed: true;
|
|
71
|
+
readonly internalType: "address";
|
|
72
|
+
readonly name: "payee";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
}, {
|
|
75
|
+
readonly indexed: false;
|
|
76
|
+
readonly internalType: "uint256";
|
|
77
|
+
readonly name: "maxClearAmount";
|
|
78
|
+
readonly type: "uint256";
|
|
79
|
+
}, {
|
|
80
|
+
readonly indexed: true;
|
|
81
|
+
readonly internalType: "bytes32";
|
|
82
|
+
readonly name: "resourceHash";
|
|
83
|
+
readonly type: "bytes32";
|
|
84
|
+
}, {
|
|
85
|
+
readonly indexed: false;
|
|
86
|
+
readonly internalType: "bytes32";
|
|
87
|
+
readonly name: "nonce";
|
|
88
|
+
readonly type: "bytes32";
|
|
89
|
+
}, {
|
|
90
|
+
readonly indexed: false;
|
|
91
|
+
readonly internalType: "bytes32";
|
|
92
|
+
readonly name: "transferredAmount";
|
|
93
|
+
readonly type: "bytes32";
|
|
94
|
+
}];
|
|
95
|
+
readonly name: "ConfidentialPaymentExecuted";
|
|
96
|
+
readonly type: "event";
|
|
97
|
+
}, {
|
|
98
|
+
readonly inputs: readonly [{
|
|
99
|
+
readonly internalType: "address";
|
|
100
|
+
readonly name: "";
|
|
101
|
+
readonly type: "address";
|
|
102
|
+
}, {
|
|
103
|
+
readonly internalType: "bytes32";
|
|
104
|
+
readonly name: "";
|
|
105
|
+
readonly type: "bytes32";
|
|
106
|
+
}];
|
|
107
|
+
readonly name: "usedNonces";
|
|
108
|
+
readonly outputs: readonly [{
|
|
109
|
+
readonly internalType: "bool";
|
|
110
|
+
readonly name: "";
|
|
111
|
+
readonly type: "bool";
|
|
112
|
+
}];
|
|
113
|
+
readonly stateMutability: "view";
|
|
114
|
+
readonly type: "function";
|
|
115
|
+
}, {
|
|
116
|
+
readonly inputs: readonly [{
|
|
117
|
+
readonly internalType: "address";
|
|
118
|
+
readonly name: "account";
|
|
119
|
+
readonly type: "address";
|
|
120
|
+
}];
|
|
121
|
+
readonly name: "observer";
|
|
122
|
+
readonly outputs: readonly [{
|
|
123
|
+
readonly internalType: "address";
|
|
124
|
+
readonly name: "";
|
|
125
|
+
readonly type: "address";
|
|
126
|
+
}];
|
|
127
|
+
readonly stateMutability: "view";
|
|
128
|
+
readonly type: "function";
|
|
129
|
+
}, {
|
|
130
|
+
readonly inputs: readonly [{
|
|
131
|
+
readonly internalType: "address";
|
|
132
|
+
readonly name: "account";
|
|
133
|
+
readonly type: "address";
|
|
134
|
+
}, {
|
|
135
|
+
readonly internalType: "address";
|
|
136
|
+
readonly name: "newObserver";
|
|
137
|
+
readonly type: "address";
|
|
138
|
+
}];
|
|
139
|
+
readonly name: "setObserver";
|
|
140
|
+
readonly outputs: readonly [];
|
|
141
|
+
readonly stateMutability: "nonpayable";
|
|
142
|
+
readonly type: "function";
|
|
143
|
+
}];
|
|
144
|
+
|
|
145
|
+
declare const confidentialPaymentTypes: {
|
|
146
|
+
readonly ConfidentialPayment: readonly [{
|
|
147
|
+
readonly name: "holder";
|
|
148
|
+
readonly type: "address";
|
|
149
|
+
}, {
|
|
150
|
+
readonly name: "payee";
|
|
151
|
+
readonly type: "address";
|
|
152
|
+
}, {
|
|
153
|
+
readonly name: "maxClearAmount";
|
|
154
|
+
readonly type: "uint256";
|
|
155
|
+
}, {
|
|
156
|
+
readonly name: "resourceHash";
|
|
157
|
+
readonly type: "bytes32";
|
|
158
|
+
}, {
|
|
159
|
+
readonly name: "validAfter";
|
|
160
|
+
readonly type: "uint48";
|
|
161
|
+
}, {
|
|
162
|
+
readonly name: "validBefore";
|
|
163
|
+
readonly type: "uint48";
|
|
164
|
+
}, {
|
|
165
|
+
readonly name: "nonce";
|
|
166
|
+
readonly type: "bytes32";
|
|
167
|
+
}, {
|
|
168
|
+
readonly name: "encryptedAmountHash";
|
|
169
|
+
readonly type: "bytes32";
|
|
170
|
+
}];
|
|
171
|
+
};
|
|
172
|
+
declare const confidentialErrorCodes: {
|
|
173
|
+
readonly observerNotAuthorized: "observer_not_authorized";
|
|
174
|
+
};
|
|
175
|
+
type ConfidentialErrorCode = (typeof confidentialErrorCodes)[keyof typeof confidentialErrorCodes];
|
|
176
|
+
|
|
177
|
+
declare function createNonce(): `0x${string}`;
|
|
178
|
+
declare function hashEncryptedAmountInput(encryptedAmountInput: `0x${string}`): `0x${string}`;
|
|
179
|
+
declare function normalizeAmount(amount: string | number | bigint): string;
|
|
180
|
+
|
|
181
|
+
type RelayerInstance = Awaited<ReturnType<typeof createInstance>>;
|
|
182
|
+
type RelayerSigner = {
|
|
183
|
+
address: string;
|
|
184
|
+
signTypedData: ((domain: Record<string, unknown>, types: Record<string, Array<{
|
|
185
|
+
name: string;
|
|
186
|
+
type: string;
|
|
187
|
+
}>>, message: Record<string, unknown>) => Promise<string>) | ((args: {
|
|
188
|
+
domain: Record<string, unknown>;
|
|
189
|
+
types: Record<string, Array<{
|
|
190
|
+
name: string;
|
|
191
|
+
type: string;
|
|
192
|
+
}>>;
|
|
193
|
+
primaryType: string;
|
|
194
|
+
message: Record<string, unknown>;
|
|
195
|
+
}) => Promise<string>);
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
declare function createRelayerInstance(config: FhevmInstanceConfig): Promise<RelayerInstance>;
|
|
199
|
+
|
|
200
|
+
declare function createEncryptedAmountInput(relayer: RelayerInstance, contractAddress: string, senderAddress: string, amount: number): Promise<{
|
|
201
|
+
handle: `0x${string}`;
|
|
202
|
+
inputProof: `0x${string}`;
|
|
203
|
+
}>;
|
|
204
|
+
declare function userDecryptEuint64(relayer: RelayerInstance, handle: string, contractAddress: string, signer: RelayerSigner, options?: {
|
|
205
|
+
durationDays?: string;
|
|
206
|
+
startTimestamp?: string;
|
|
207
|
+
}): Promise<bigint>;
|
|
208
|
+
declare function publicDecrypt(relayer: RelayerInstance, handles: string[]): Promise<{
|
|
209
|
+
clearValues: Record<string, bigint>;
|
|
210
|
+
decryptionProof: string;
|
|
211
|
+
}>;
|
|
212
|
+
|
|
213
|
+
type SetObserverOptions = {
|
|
214
|
+
rpcUrl: string;
|
|
215
|
+
tokenAddress: `0x${string}`;
|
|
216
|
+
account: `0x${string}`;
|
|
217
|
+
observer: `0x${string}`;
|
|
218
|
+
signer: RelayerSigner & {
|
|
219
|
+
writeContract: (args: {
|
|
220
|
+
address: `0x${string}`;
|
|
221
|
+
abi: typeof confidentialTokenAbi;
|
|
222
|
+
functionName: "setObserver";
|
|
223
|
+
args: [`0x${string}`, `0x${string}`];
|
|
224
|
+
}) => Promise<`0x${string}`>;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
declare function setObserver(options: SetObserverOptions): Promise<`0x${string}`>;
|
|
228
|
+
|
|
229
|
+
type ConfidentialPaymentAuthorization = {
|
|
230
|
+
holder: `0x${string}`;
|
|
231
|
+
payee: `0x${string}`;
|
|
232
|
+
maxClearAmount: string;
|
|
233
|
+
resourceHash: `0x${string}`;
|
|
234
|
+
validAfter: string;
|
|
235
|
+
validBefore: string;
|
|
236
|
+
nonce: `0x${string}`;
|
|
237
|
+
encryptedAmountHash: `0x${string}`;
|
|
238
|
+
};
|
|
239
|
+
type ConfidentialPaymentPayload = {
|
|
240
|
+
authorization: ConfidentialPaymentAuthorization;
|
|
241
|
+
signature: `0x${string}`;
|
|
242
|
+
encryptedAmountInput: `0x${string}`;
|
|
243
|
+
inputProof: `0x${string}`;
|
|
244
|
+
};
|
|
245
|
+
type ConfidentialRequirementsExtra = {
|
|
246
|
+
eip712: {
|
|
247
|
+
name: string;
|
|
248
|
+
version: string;
|
|
249
|
+
};
|
|
250
|
+
confidential?: {
|
|
251
|
+
maxClearAmount?: string;
|
|
252
|
+
resourceHash?: `0x${string}`;
|
|
253
|
+
batcherAddress?: `0x${string}`;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
type ConfidentialPaymentInput = {
|
|
257
|
+
encryptedAmountInput: `0x${string}`;
|
|
258
|
+
inputProof: `0x${string}`;
|
|
259
|
+
maxClearAmount?: string;
|
|
260
|
+
resourceHash?: `0x${string}`;
|
|
261
|
+
validAfter?: number;
|
|
262
|
+
validBefore?: number;
|
|
263
|
+
nonce?: `0x${string}`;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
export { type ConfidentialErrorCode as C, type RelayerInstance as R, type SetObserverOptions as S, type RelayerSigner as a, confidentialPaymentTypes as b, confidentialTokenAbi as c, confidentialErrorCodes as d, createNonce as e, createRelayerInstance as f, createEncryptedAmountInput as g, hashEncryptedAmountInput as h, type ConfidentialPaymentAuthorization as i, type ConfidentialPaymentPayload as j, type ConfidentialRequirementsExtra as k, type ConfidentialPaymentInput as l, normalizeAmount as n, publicDecrypt as p, setObserver as s, userDecryptEuint64 as u };
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { FhevmInstanceConfig, createInstance } from '@zama-fhe/relayer-sdk/node';
|
|
2
|
+
|
|
3
|
+
declare const confidentialTokenAbi: readonly [{
|
|
4
|
+
readonly inputs: readonly [{
|
|
5
|
+
readonly components: readonly [{
|
|
6
|
+
readonly internalType: "address";
|
|
7
|
+
readonly name: "holder";
|
|
8
|
+
readonly type: "address";
|
|
9
|
+
}, {
|
|
10
|
+
readonly internalType: "address";
|
|
11
|
+
readonly name: "payee";
|
|
12
|
+
readonly type: "address";
|
|
13
|
+
}, {
|
|
14
|
+
readonly internalType: "uint256";
|
|
15
|
+
readonly name: "maxClearAmount";
|
|
16
|
+
readonly type: "uint256";
|
|
17
|
+
}, {
|
|
18
|
+
readonly internalType: "bytes32";
|
|
19
|
+
readonly name: "resourceHash";
|
|
20
|
+
readonly type: "bytes32";
|
|
21
|
+
}, {
|
|
22
|
+
readonly internalType: "uint48";
|
|
23
|
+
readonly name: "validAfter";
|
|
24
|
+
readonly type: "uint48";
|
|
25
|
+
}, {
|
|
26
|
+
readonly internalType: "uint48";
|
|
27
|
+
readonly name: "validBefore";
|
|
28
|
+
readonly type: "uint48";
|
|
29
|
+
}, {
|
|
30
|
+
readonly internalType: "bytes32";
|
|
31
|
+
readonly name: "nonce";
|
|
32
|
+
readonly type: "bytes32";
|
|
33
|
+
}, {
|
|
34
|
+
readonly internalType: "bytes32";
|
|
35
|
+
readonly name: "encryptedAmountHash";
|
|
36
|
+
readonly type: "bytes32";
|
|
37
|
+
}];
|
|
38
|
+
readonly internalType: "struct FHEToken.ConfidentialPayment";
|
|
39
|
+
readonly name: "p";
|
|
40
|
+
readonly type: "tuple";
|
|
41
|
+
}, {
|
|
42
|
+
readonly internalType: "externalEuint64";
|
|
43
|
+
readonly name: "encryptedAmountInput";
|
|
44
|
+
readonly type: "bytes32";
|
|
45
|
+
}, {
|
|
46
|
+
readonly internalType: "bytes";
|
|
47
|
+
readonly name: "inputProof";
|
|
48
|
+
readonly type: "bytes";
|
|
49
|
+
}, {
|
|
50
|
+
readonly internalType: "bytes";
|
|
51
|
+
readonly name: "sig";
|
|
52
|
+
readonly type: "bytes";
|
|
53
|
+
}];
|
|
54
|
+
readonly name: "confidentialTransferWithAuthorization";
|
|
55
|
+
readonly outputs: readonly [{
|
|
56
|
+
readonly internalType: "euint64";
|
|
57
|
+
readonly name: "transferred";
|
|
58
|
+
readonly type: "bytes32";
|
|
59
|
+
}];
|
|
60
|
+
readonly stateMutability: "nonpayable";
|
|
61
|
+
readonly type: "function";
|
|
62
|
+
}, {
|
|
63
|
+
readonly anonymous: false;
|
|
64
|
+
readonly inputs: readonly [{
|
|
65
|
+
readonly indexed: true;
|
|
66
|
+
readonly internalType: "address";
|
|
67
|
+
readonly name: "holder";
|
|
68
|
+
readonly type: "address";
|
|
69
|
+
}, {
|
|
70
|
+
readonly indexed: true;
|
|
71
|
+
readonly internalType: "address";
|
|
72
|
+
readonly name: "payee";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
}, {
|
|
75
|
+
readonly indexed: false;
|
|
76
|
+
readonly internalType: "uint256";
|
|
77
|
+
readonly name: "maxClearAmount";
|
|
78
|
+
readonly type: "uint256";
|
|
79
|
+
}, {
|
|
80
|
+
readonly indexed: true;
|
|
81
|
+
readonly internalType: "bytes32";
|
|
82
|
+
readonly name: "resourceHash";
|
|
83
|
+
readonly type: "bytes32";
|
|
84
|
+
}, {
|
|
85
|
+
readonly indexed: false;
|
|
86
|
+
readonly internalType: "bytes32";
|
|
87
|
+
readonly name: "nonce";
|
|
88
|
+
readonly type: "bytes32";
|
|
89
|
+
}, {
|
|
90
|
+
readonly indexed: false;
|
|
91
|
+
readonly internalType: "bytes32";
|
|
92
|
+
readonly name: "transferredAmount";
|
|
93
|
+
readonly type: "bytes32";
|
|
94
|
+
}];
|
|
95
|
+
readonly name: "ConfidentialPaymentExecuted";
|
|
96
|
+
readonly type: "event";
|
|
97
|
+
}, {
|
|
98
|
+
readonly inputs: readonly [{
|
|
99
|
+
readonly internalType: "address";
|
|
100
|
+
readonly name: "";
|
|
101
|
+
readonly type: "address";
|
|
102
|
+
}, {
|
|
103
|
+
readonly internalType: "bytes32";
|
|
104
|
+
readonly name: "";
|
|
105
|
+
readonly type: "bytes32";
|
|
106
|
+
}];
|
|
107
|
+
readonly name: "usedNonces";
|
|
108
|
+
readonly outputs: readonly [{
|
|
109
|
+
readonly internalType: "bool";
|
|
110
|
+
readonly name: "";
|
|
111
|
+
readonly type: "bool";
|
|
112
|
+
}];
|
|
113
|
+
readonly stateMutability: "view";
|
|
114
|
+
readonly type: "function";
|
|
115
|
+
}, {
|
|
116
|
+
readonly inputs: readonly [{
|
|
117
|
+
readonly internalType: "address";
|
|
118
|
+
readonly name: "account";
|
|
119
|
+
readonly type: "address";
|
|
120
|
+
}];
|
|
121
|
+
readonly name: "observer";
|
|
122
|
+
readonly outputs: readonly [{
|
|
123
|
+
readonly internalType: "address";
|
|
124
|
+
readonly name: "";
|
|
125
|
+
readonly type: "address";
|
|
126
|
+
}];
|
|
127
|
+
readonly stateMutability: "view";
|
|
128
|
+
readonly type: "function";
|
|
129
|
+
}, {
|
|
130
|
+
readonly inputs: readonly [{
|
|
131
|
+
readonly internalType: "address";
|
|
132
|
+
readonly name: "account";
|
|
133
|
+
readonly type: "address";
|
|
134
|
+
}, {
|
|
135
|
+
readonly internalType: "address";
|
|
136
|
+
readonly name: "newObserver";
|
|
137
|
+
readonly type: "address";
|
|
138
|
+
}];
|
|
139
|
+
readonly name: "setObserver";
|
|
140
|
+
readonly outputs: readonly [];
|
|
141
|
+
readonly stateMutability: "nonpayable";
|
|
142
|
+
readonly type: "function";
|
|
143
|
+
}];
|
|
144
|
+
|
|
145
|
+
declare const confidentialPaymentTypes: {
|
|
146
|
+
readonly ConfidentialPayment: readonly [{
|
|
147
|
+
readonly name: "holder";
|
|
148
|
+
readonly type: "address";
|
|
149
|
+
}, {
|
|
150
|
+
readonly name: "payee";
|
|
151
|
+
readonly type: "address";
|
|
152
|
+
}, {
|
|
153
|
+
readonly name: "maxClearAmount";
|
|
154
|
+
readonly type: "uint256";
|
|
155
|
+
}, {
|
|
156
|
+
readonly name: "resourceHash";
|
|
157
|
+
readonly type: "bytes32";
|
|
158
|
+
}, {
|
|
159
|
+
readonly name: "validAfter";
|
|
160
|
+
readonly type: "uint48";
|
|
161
|
+
}, {
|
|
162
|
+
readonly name: "validBefore";
|
|
163
|
+
readonly type: "uint48";
|
|
164
|
+
}, {
|
|
165
|
+
readonly name: "nonce";
|
|
166
|
+
readonly type: "bytes32";
|
|
167
|
+
}, {
|
|
168
|
+
readonly name: "encryptedAmountHash";
|
|
169
|
+
readonly type: "bytes32";
|
|
170
|
+
}];
|
|
171
|
+
};
|
|
172
|
+
declare const confidentialErrorCodes: {
|
|
173
|
+
readonly observerNotAuthorized: "observer_not_authorized";
|
|
174
|
+
};
|
|
175
|
+
type ConfidentialErrorCode = (typeof confidentialErrorCodes)[keyof typeof confidentialErrorCodes];
|
|
176
|
+
|
|
177
|
+
declare function createNonce(): `0x${string}`;
|
|
178
|
+
declare function hashEncryptedAmountInput(encryptedAmountInput: `0x${string}`): `0x${string}`;
|
|
179
|
+
declare function normalizeAmount(amount: string | number | bigint): string;
|
|
180
|
+
|
|
181
|
+
type RelayerInstance = Awaited<ReturnType<typeof createInstance>>;
|
|
182
|
+
type RelayerSigner = {
|
|
183
|
+
address: string;
|
|
184
|
+
signTypedData: ((domain: Record<string, unknown>, types: Record<string, Array<{
|
|
185
|
+
name: string;
|
|
186
|
+
type: string;
|
|
187
|
+
}>>, message: Record<string, unknown>) => Promise<string>) | ((args: {
|
|
188
|
+
domain: Record<string, unknown>;
|
|
189
|
+
types: Record<string, Array<{
|
|
190
|
+
name: string;
|
|
191
|
+
type: string;
|
|
192
|
+
}>>;
|
|
193
|
+
primaryType: string;
|
|
194
|
+
message: Record<string, unknown>;
|
|
195
|
+
}) => Promise<string>);
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
declare function createRelayerInstance(config: FhevmInstanceConfig): Promise<RelayerInstance>;
|
|
199
|
+
|
|
200
|
+
declare function createEncryptedAmountInput(relayer: RelayerInstance, contractAddress: string, senderAddress: string, amount: number): Promise<{
|
|
201
|
+
handle: `0x${string}`;
|
|
202
|
+
inputProof: `0x${string}`;
|
|
203
|
+
}>;
|
|
204
|
+
declare function userDecryptEuint64(relayer: RelayerInstance, handle: string, contractAddress: string, signer: RelayerSigner, options?: {
|
|
205
|
+
durationDays?: string;
|
|
206
|
+
startTimestamp?: string;
|
|
207
|
+
}): Promise<bigint>;
|
|
208
|
+
declare function publicDecrypt(relayer: RelayerInstance, handles: string[]): Promise<{
|
|
209
|
+
clearValues: Record<string, bigint>;
|
|
210
|
+
decryptionProof: string;
|
|
211
|
+
}>;
|
|
212
|
+
|
|
213
|
+
type SetObserverOptions = {
|
|
214
|
+
rpcUrl: string;
|
|
215
|
+
tokenAddress: `0x${string}`;
|
|
216
|
+
account: `0x${string}`;
|
|
217
|
+
observer: `0x${string}`;
|
|
218
|
+
signer: RelayerSigner & {
|
|
219
|
+
writeContract: (args: {
|
|
220
|
+
address: `0x${string}`;
|
|
221
|
+
abi: typeof confidentialTokenAbi;
|
|
222
|
+
functionName: "setObserver";
|
|
223
|
+
args: [`0x${string}`, `0x${string}`];
|
|
224
|
+
}) => Promise<`0x${string}`>;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
declare function setObserver(options: SetObserverOptions): Promise<`0x${string}`>;
|
|
228
|
+
|
|
229
|
+
type ConfidentialPaymentAuthorization = {
|
|
230
|
+
holder: `0x${string}`;
|
|
231
|
+
payee: `0x${string}`;
|
|
232
|
+
maxClearAmount: string;
|
|
233
|
+
resourceHash: `0x${string}`;
|
|
234
|
+
validAfter: string;
|
|
235
|
+
validBefore: string;
|
|
236
|
+
nonce: `0x${string}`;
|
|
237
|
+
encryptedAmountHash: `0x${string}`;
|
|
238
|
+
};
|
|
239
|
+
type ConfidentialPaymentPayload = {
|
|
240
|
+
authorization: ConfidentialPaymentAuthorization;
|
|
241
|
+
signature: `0x${string}`;
|
|
242
|
+
encryptedAmountInput: `0x${string}`;
|
|
243
|
+
inputProof: `0x${string}`;
|
|
244
|
+
};
|
|
245
|
+
type ConfidentialRequirementsExtra = {
|
|
246
|
+
eip712: {
|
|
247
|
+
name: string;
|
|
248
|
+
version: string;
|
|
249
|
+
};
|
|
250
|
+
confidential?: {
|
|
251
|
+
maxClearAmount?: string;
|
|
252
|
+
resourceHash?: `0x${string}`;
|
|
253
|
+
batcherAddress?: `0x${string}`;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
type ConfidentialPaymentInput = {
|
|
257
|
+
encryptedAmountInput: `0x${string}`;
|
|
258
|
+
inputProof: `0x${string}`;
|
|
259
|
+
maxClearAmount?: string;
|
|
260
|
+
resourceHash?: `0x${string}`;
|
|
261
|
+
validAfter?: number;
|
|
262
|
+
validBefore?: number;
|
|
263
|
+
nonce?: `0x${string}`;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
export { type ConfidentialErrorCode as C, type RelayerInstance as R, type SetObserverOptions as S, type RelayerSigner as a, confidentialPaymentTypes as b, confidentialTokenAbi as c, confidentialErrorCodes as d, createNonce as e, createRelayerInstance as f, createEncryptedAmountInput as g, hashEncryptedAmountInput as h, type ConfidentialPaymentAuthorization as i, type ConfidentialPaymentPayload as j, type ConfidentialRequirementsExtra as k, type ConfidentialPaymentInput as l, normalizeAmount as n, publicDecrypt as p, setObserver as s, userDecryptEuint64 as u };
|