@zama-fhe/sdk 1.0.0-alpha.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.
@@ -0,0 +1,550 @@
1
+ import * as SDK from '@zama-fhe/relayer-sdk/bundle';
2
+ import { FhevmInstanceConfig, Address, ZKProofLike, KmsDelegatedUserDecryptEIP712Type, InputProofBytesType } from '@zama-fhe/relayer-sdk/bundle';
3
+
4
+ /**
5
+ * Optional logger for worker client observability.
6
+ * Pass to `WorkerClientConfig` or `NodeWorkerClientConfig` to observe
7
+ * request lifecycle (start, success, error, timeout).
8
+ */
9
+ interface GenericLogger {
10
+ info: (message: string, data?: Record<string, unknown>) => void;
11
+ debug: (message: string, data?: Record<string, unknown>) => void;
12
+ warn: (message: string, data?: Record<string, unknown>) => void;
13
+ error: (message: string, data?: Record<string, unknown>) => void;
14
+ }
15
+ type WorkerRequestType = "INIT" | "NODE_INIT" | "UPDATE_CSRF" | "ENCRYPT" | "USER_DECRYPT" | "PUBLIC_DECRYPT" | "GENERATE_KEYPAIR" | "CREATE_EIP712" | "CREATE_DELEGATED_EIP712" | "DELEGATED_USER_DECRYPT" | "REQUEST_ZK_PROOF_VERIFICATION" | "GET_PUBLIC_KEY" | "GET_PUBLIC_PARAMS";
16
+ interface BaseRequest {
17
+ id: string;
18
+ type: WorkerRequestType;
19
+ }
20
+ interface InitRequest extends BaseRequest {
21
+ type: "INIT";
22
+ payload: {
23
+ cdnUrl: string;
24
+ fhevmConfig: FhevmInstanceConfig;
25
+ csrfToken: string;
26
+ /** Expected SHA-384 hex digest for integrity verification. */
27
+ integrity?: string;
28
+ };
29
+ }
30
+ interface NodeInitRequest extends BaseRequest {
31
+ type: "NODE_INIT";
32
+ payload: {
33
+ fhevmConfig: FhevmInstanceConfig;
34
+ };
35
+ }
36
+ interface UpdateCsrfRequest extends BaseRequest {
37
+ type: "UPDATE_CSRF";
38
+ payload: {
39
+ csrfToken: string;
40
+ };
41
+ }
42
+ interface EncryptRequest extends BaseRequest {
43
+ type: "ENCRYPT";
44
+ payload: {
45
+ values: bigint[];
46
+ contractAddress: Address;
47
+ userAddress: Address;
48
+ };
49
+ }
50
+ interface UserDecryptRequest extends BaseRequest {
51
+ type: "USER_DECRYPT";
52
+ payload: {
53
+ handles: string[];
54
+ contractAddress: Address;
55
+ signedContractAddresses: Address[];
56
+ privateKey: string;
57
+ publicKey: string;
58
+ signature: string;
59
+ signerAddress: Address;
60
+ startTimestamp: number;
61
+ durationDays: number;
62
+ };
63
+ }
64
+ interface PublicDecryptRequest extends BaseRequest {
65
+ type: "PUBLIC_DECRYPT";
66
+ payload: {
67
+ handles: string[];
68
+ };
69
+ }
70
+ interface GenerateKeypairRequest extends BaseRequest {
71
+ type: "GENERATE_KEYPAIR";
72
+ payload: Record<string, never>;
73
+ }
74
+ interface CreateEIP712Request extends BaseRequest {
75
+ type: "CREATE_EIP712";
76
+ payload: {
77
+ publicKey: string;
78
+ contractAddresses: Address[];
79
+ startTimestamp: number;
80
+ durationDays: number;
81
+ };
82
+ }
83
+ interface CreateDelegatedEIP712Request extends BaseRequest {
84
+ type: "CREATE_DELEGATED_EIP712";
85
+ payload: {
86
+ publicKey: string;
87
+ contractAddresses: Address[];
88
+ delegatorAddress: string;
89
+ startTimestamp: number;
90
+ durationDays: number;
91
+ };
92
+ }
93
+ interface DelegatedUserDecryptRequest extends BaseRequest {
94
+ type: "DELEGATED_USER_DECRYPT";
95
+ payload: {
96
+ handles: string[];
97
+ contractAddress: Address;
98
+ signedContractAddresses: Address[];
99
+ privateKey: string;
100
+ publicKey: string;
101
+ signature: string;
102
+ delegatorAddress: Address;
103
+ delegateAddress: Address;
104
+ startTimestamp: number;
105
+ durationDays: number;
106
+ };
107
+ }
108
+ interface RequestZKProofVerificationRequest extends BaseRequest {
109
+ type: "REQUEST_ZK_PROOF_VERIFICATION";
110
+ payload: {
111
+ zkProof: ZKProofLike;
112
+ };
113
+ }
114
+ interface GetPublicKeyRequest extends BaseRequest {
115
+ type: "GET_PUBLIC_KEY";
116
+ payload: Record<string, never>;
117
+ }
118
+ interface GetPublicParamsRequest extends BaseRequest {
119
+ type: "GET_PUBLIC_PARAMS";
120
+ payload: {
121
+ bits: number;
122
+ };
123
+ }
124
+ type WorkerRequest = InitRequest | NodeInitRequest | UpdateCsrfRequest | EncryptRequest | UserDecryptRequest | PublicDecryptRequest | GenerateKeypairRequest | CreateEIP712Request | CreateDelegatedEIP712Request | DelegatedUserDecryptRequest | RequestZKProofVerificationRequest | GetPublicKeyRequest | GetPublicParamsRequest;
125
+ type EncryptPayload = EncryptRequest["payload"];
126
+ type UserDecryptPayload = UserDecryptRequest["payload"];
127
+ type DelegatedUserDecryptPayload = DelegatedUserDecryptRequest["payload"];
128
+ type CreateEIP712Payload = CreateEIP712Request["payload"];
129
+ type CreateDelegatedEIP712Payload = CreateDelegatedEIP712Request["payload"];
130
+ interface BaseResponse {
131
+ id: string;
132
+ type: WorkerRequestType;
133
+ }
134
+ interface SuccessResponse<T> extends BaseResponse {
135
+ success: true;
136
+ data: T;
137
+ }
138
+ interface ErrorResponse extends BaseResponse {
139
+ success: false;
140
+ error: string;
141
+ /** HTTP status code from the relayer, when available. */
142
+ statusCode?: number;
143
+ }
144
+ type WorkerResponse<T> = SuccessResponse<T> | ErrorResponse;
145
+ interface EncryptResponseData {
146
+ handles: Uint8Array[];
147
+ inputProof: Uint8Array;
148
+ }
149
+ interface UserDecryptResponseData {
150
+ clearValues: Record<string, bigint>;
151
+ }
152
+ interface PublicDecryptResponseData {
153
+ clearValues: Record<string, bigint>;
154
+ abiEncodedClearValues: string;
155
+ decryptionProof: Address;
156
+ }
157
+ interface GenerateKeypairResponseData {
158
+ publicKey: string;
159
+ privateKey: string;
160
+ }
161
+ interface CreateEIP712ResponseData {
162
+ domain: {
163
+ name: string;
164
+ version: string;
165
+ chainId: number;
166
+ verifyingContract: Address;
167
+ };
168
+ types: {
169
+ UserDecryptRequestVerification: Array<{
170
+ name: string;
171
+ type: string;
172
+ }>;
173
+ };
174
+ message: {
175
+ publicKey: string;
176
+ contractAddresses: string[];
177
+ startTimestamp: bigint;
178
+ durationDays: bigint;
179
+ extraData: string;
180
+ };
181
+ }
182
+ type CreateDelegatedEIP712ResponseData = KmsDelegatedUserDecryptEIP712Type;
183
+ interface DelegatedUserDecryptResponseData {
184
+ clearValues: Record<string, bigint>;
185
+ }
186
+ type RequestZKProofVerificationResponseData = InputProofBytesType;
187
+ interface GetPublicKeyResponseData {
188
+ result: {
189
+ publicKeyId: string;
190
+ publicKey: Uint8Array;
191
+ } | null;
192
+ }
193
+ interface GetPublicParamsResponseData {
194
+ result: {
195
+ publicParams: Uint8Array;
196
+ publicParamsId: string;
197
+ } | null;
198
+ }
199
+
200
+ /** Generic hex-encoded string (signatures, tx hashes, proofs, etc.). */
201
+ type Hex = `0x${string}`;
202
+ /** Network configuration for the Relayer SDK */
203
+ type NetworkType = "hardhat" | "sepolia" | "mainnet";
204
+ /** Security options for RelayerWeb. */
205
+ interface RelayerWebSecurityConfig {
206
+ /** Resolve the current CSRF token. Called before each authenticated network request. */
207
+ getCsrfToken?: () => string;
208
+ /** Verify SHA-384 integrity of the CDN bundle. Defaults to `true`. Set to `false` only in test environments with mocked SDK scripts. */
209
+ integrityCheck?: boolean;
210
+ }
211
+ /** Configuration for RelayerWeb (browser backend) initialization. */
212
+ interface RelayerWebConfig {
213
+ transports: Record<number, Partial<SDK.FhevmInstanceConfig>>;
214
+ /** Resolve the current chain ID. Called lazily before each operation; the worker is re-initialized when the value changes. */
215
+ getChainId: () => Promise<number>;
216
+ /** Security options (CSRF, CDN integrity). */
217
+ security?: RelayerWebSecurityConfig;
218
+ /** Optional logger for observing worker lifecycle and request timing. */
219
+ logger?: GenericLogger;
220
+ }
221
+ /** Result from encryption operation */
222
+ interface EncryptResult {
223
+ handles: Uint8Array[];
224
+ inputProof: Uint8Array;
225
+ }
226
+ /** Parameters for encryption */
227
+ interface EncryptParams {
228
+ values: bigint[];
229
+ contractAddress: Address;
230
+ userAddress: Address;
231
+ }
232
+ /** Parameters for user decryption */
233
+ interface UserDecryptParams {
234
+ handles: string[];
235
+ contractAddress: Address;
236
+ signedContractAddresses: Address[];
237
+ privateKey: string;
238
+ publicKey: string;
239
+ signature: string;
240
+ signerAddress: Address;
241
+ startTimestamp: number;
242
+ durationDays: number;
243
+ }
244
+ /** Result from public decryption */
245
+ interface PublicDecryptResult {
246
+ clearValues: Record<string, bigint>;
247
+ abiEncodedClearValues: string;
248
+ decryptionProof: Address;
249
+ }
250
+ /** Keypair for FHE operations */
251
+ interface FHEKeypair {
252
+ publicKey: string;
253
+ privateKey: string;
254
+ }
255
+ /** EIP712 typed data structure */
256
+ interface EIP712TypedData {
257
+ domain: {
258
+ name: string;
259
+ version: string;
260
+ chainId: number;
261
+ verifyingContract: Address;
262
+ };
263
+ types: {
264
+ [key: string]: Array<{
265
+ name: string;
266
+ type: string;
267
+ }>;
268
+ };
269
+ message: {
270
+ publicKey: string;
271
+ contractAddresses: string[];
272
+ startTimestamp: bigint;
273
+ durationDays: bigint;
274
+ extraData: string;
275
+ };
276
+ }
277
+ /** Parameters for delegated user decryption */
278
+ interface DelegatedUserDecryptParams {
279
+ handles: string[];
280
+ contractAddress: Address;
281
+ signedContractAddresses: Address[];
282
+ privateKey: string;
283
+ publicKey: string;
284
+ signature: string;
285
+ delegatorAddress: Address;
286
+ delegateAddress: Address;
287
+ startTimestamp: number;
288
+ durationDays: number;
289
+ }
290
+ /** SDK status */
291
+ type RelayerSDKStatus = "idle" | "initializing" | "ready" | "error";
292
+
293
+ /**
294
+ * Framework-agnostic event decoders for confidential token contracts.
295
+ * No viem/ethers dependency — works with raw log data from any provider.
296
+ */
297
+
298
+ /** Framework-agnostic log shape compatible with any Ethereum provider. */
299
+ interface RawLog {
300
+ /** Indexed event topics (topic[0] is the event signature hash). */
301
+ readonly topics: readonly string[];
302
+ /** ABI-encoded non-indexed event data. */
303
+ readonly data: string;
304
+ }
305
+ /**
306
+ * Event topic0 constants (keccak256 of the canonical Solidity signature).
307
+ * Pass to `getLogs({ topics: [Object.values(Topics)] })` to fetch all events.
308
+ */
309
+ declare const Topics: {
310
+ /** `ConfidentialTransfer(address indexed from, address indexed to, bytes32 indexed amount)` */
311
+ readonly ConfidentialTransfer: "0x67500e8d0ed826d2194f514dd0d8124f35648ab6e3fb5e6ed867134cffe661e9";
312
+ /** `Wrapped(uint64 mintAmount, uint256 amountIn, uint256 feeAmount, address indexed to_, uint256 indexed mintTxId)` */
313
+ readonly Wrapped: "0x1f7907f4d84043abe0fb7c74e8865ee5fe93fe4f691c54a7b8fa9d6fb17c7cba";
314
+ /** `UnwrapRequested(address indexed receiver, bytes32 amount)` */
315
+ readonly UnwrapRequested: "0x77d02d353c5629272875d11f1b34ec4c65d7430b075575b78cd2502034c469ee";
316
+ /** `UnwrappedFinalized(bytes32 indexed burntAmountHandle, ...)` */
317
+ readonly UnwrappedFinalized: "0xc64e7c81b18b674fc5b037d8a0041bfe3332d86c780a4688f404ee01fbabb152";
318
+ /** `UnwrappedStarted(bool returnVal, uint256 indexed requestId, ...)` */
319
+ readonly UnwrappedStarted: "0x3838891d4843c6d7f9f494570b6fd8843f4e3c3ddb817c1411760bd31b819806";
320
+ };
321
+ /** Decoded `ConfidentialTransfer` event — an encrypted token transfer. */
322
+ interface ConfidentialTransferEvent {
323
+ readonly eventName: "ConfidentialTransfer";
324
+ /** Sender address. */
325
+ readonly from: string;
326
+ /** Receiver address. */
327
+ readonly to: string;
328
+ /** FHE ciphertext handle for the transferred amount. */
329
+ readonly encryptedAmountHandle: string;
330
+ }
331
+ /** Decoded `Wrapped` event — an ERC-20 shield (wrap) operation. */
332
+ interface WrappedEvent {
333
+ readonly eventName: "Wrapped";
334
+ /** Confidential tokens minted. */
335
+ readonly mintAmount: bigint;
336
+ /** Underlying ERC-20 tokens deposited. */
337
+ readonly amountIn: bigint;
338
+ /** Fee deducted during wrapping. */
339
+ readonly feeAmount: bigint;
340
+ /** Receiver of the minted confidential tokens. */
341
+ readonly to: string;
342
+ /** On-chain mint transaction ID. */
343
+ readonly mintTxId: bigint;
344
+ }
345
+ /** Decoded `UnwrapRequested` event — an unshield request submitted. */
346
+ interface UnwrapRequestedEvent {
347
+ readonly eventName: "UnwrapRequested";
348
+ /** Address that will receive the unwrapped ERC-20 tokens. */
349
+ readonly receiver: string;
350
+ /** FHE ciphertext handle for the requested unshield amount. */
351
+ readonly encryptedAmount: Address;
352
+ }
353
+ /** Decoded `UnwrappedFinalized` event — an unshield completed on-chain. */
354
+ interface UnwrappedFinalizedEvent {
355
+ readonly eventName: "UnwrappedFinalized";
356
+ /** FHE handle of the burnt confidential balance. */
357
+ readonly burntAmountHandle: string;
358
+ /** Whether the finalization succeeded. */
359
+ readonly finalizeSuccess: boolean;
360
+ /** Whether the fee transfer succeeded. */
361
+ readonly feeTransferSuccess: boolean;
362
+ /** Amount of confidential tokens burnt. */
363
+ readonly burnAmount: bigint;
364
+ /** Amount of underlying ERC-20 tokens returned. */
365
+ readonly unwrapAmount: bigint;
366
+ /** Fee deducted during unwrapping. */
367
+ readonly feeAmount: bigint;
368
+ /** Next on-chain transaction ID. */
369
+ readonly nextTxId: bigint;
370
+ }
371
+ /** Decoded `UnwrappedStarted` event — the relayer began processing an unshield. */
372
+ interface UnwrappedStartedEvent {
373
+ readonly eventName: "UnwrappedStarted";
374
+ /** Whether the unwrap start succeeded. */
375
+ readonly returnVal: boolean;
376
+ /** On-chain request ID. */
377
+ readonly requestId: bigint;
378
+ /** On-chain transaction ID. */
379
+ readonly txId: bigint;
380
+ /** Receiver address. */
381
+ readonly to: string;
382
+ /** Refund address (if applicable). */
383
+ readonly refund: string;
384
+ /** FHE handle of the requested amount. */
385
+ readonly requestedAmount: string;
386
+ /** FHE handle of the burn amount. */
387
+ readonly burnAmount: string;
388
+ }
389
+ /** Union of all decoded confidential token event types. */
390
+ type OnChainEvent = ConfidentialTransferEvent | WrappedEvent | UnwrapRequestedEvent | UnwrappedFinalizedEvent | UnwrappedStartedEvent;
391
+ /**
392
+ * ConfidentialTransfer(address indexed from, address indexed to, bytes32 indexed amount)
393
+ * All 3 params indexed → topics[1..3], no data.
394
+ */
395
+ declare function decodeConfidentialTransfer(log: RawLog): ConfidentialTransferEvent | null;
396
+ /**
397
+ * Wrapped(uint64 mintAmount, uint256 amountIn, uint256 feeAmount, address indexed to_, uint256 indexed mintTxId)
398
+ * Indexed: to_ (topics[1]), mintTxId (topics[2])
399
+ * Data: mintAmount (uint64, abi-encoded as uint256), amountIn, feeAmount
400
+ */
401
+ declare function decodeWrapped(log: RawLog): WrappedEvent | null;
402
+ /**
403
+ * UnwrapRequested(address indexed receiver, bytes32 amount)
404
+ * Indexed: receiver (topics[1])
405
+ * Data: amount (bytes32)
406
+ */
407
+ declare function decodeUnwrapRequested(log: RawLog): UnwrapRequestedEvent | null;
408
+ /**
409
+ * UnwrappedFinalized(bytes32 indexed burntAmountHandle, bool finalizeSuccess, bool feeTransferSuccess,
410
+ * uint64 burnAmount, uint256 unwrapAmount, uint256 feeAmount, uint256 indexed nextTxId)
411
+ * Indexed: burntAmountHandle (topics[1]), nextTxId (topics[2])
412
+ * Data: finalizeSuccess, feeTransferSuccess, burnAmount, unwrapAmount, feeAmount
413
+ */
414
+ declare function decodeUnwrappedFinalized(log: RawLog): UnwrappedFinalizedEvent | null;
415
+ /**
416
+ * UnwrappedStarted(bool returnVal, uint256 indexed requestId, uint256 indexed txId, address indexed to,
417
+ * address refund, bytes32 requestedAmount, bytes32 burnAmount)
418
+ * Indexed: requestId (topics[1]), txId (topics[2]), to (topics[3])
419
+ * Data: returnVal, refund, requestedAmount, burnAmount
420
+ */
421
+ declare function decodeUnwrappedStarted(log: RawLog): UnwrappedStartedEvent | null;
422
+ /**
423
+ * Try all decoders on a single log and return the first match, or `null`.
424
+ *
425
+ * @example
426
+ * ```ts
427
+ * const event = decodeOnChainEvent(log);
428
+ * if (event?.eventName === "ConfidentialTransfer") {
429
+ * console.log(event.from, event.to);
430
+ * }
431
+ * ```
432
+ */
433
+ declare function decodeOnChainEvent(log: RawLog): OnChainEvent | null;
434
+ /**
435
+ * Batch-decode an array of logs, skipping unrecognized entries.
436
+ *
437
+ * @example
438
+ * ```ts
439
+ * const events = decodeOnChainEvents(receipt.logs);
440
+ * ```
441
+ */
442
+ declare function decodeOnChainEvents(logs: readonly RawLog[]): OnChainEvent[];
443
+ /**
444
+ * Find the first {@link UnwrapRequestedEvent} in a logs array.
445
+ *
446
+ * @example
447
+ * ```ts
448
+ * const event = findUnwrapRequested(receipt.logs);
449
+ * if (event) console.log(event.receiver, event.encryptedAmount);
450
+ * ```
451
+ */
452
+ declare function findUnwrapRequested(logs: readonly RawLog[]): UnwrapRequestedEvent | null;
453
+ /**
454
+ * Find the first {@link WrappedEvent} in a logs array.
455
+ *
456
+ * @example
457
+ * ```ts
458
+ * const event = findWrapped(receipt.logs);
459
+ * if (event) console.log(event.to, event.amountIn);
460
+ * ```
461
+ */
462
+ declare function findWrapped(logs: readonly RawLog[]): WrappedEvent | null;
463
+ /**
464
+ * All 5 confidential token event topic0 hashes.
465
+ * Pass to `getLogs({ topics: [TOKEN_TOPICS] })` to fetch
466
+ * all confidential token events in a single RPC call.
467
+ */
468
+ declare const TOKEN_TOPICS: readonly ["0x67500e8d0ed826d2194f514dd0d8124f35648ab6e3fb5e6ed867134cffe661e9", "0x1f7907f4d84043abe0fb7c74e8865ee5fe93fe4f691c54a7b8fa9d6fb17c7cba", "0x77d02d353c5629272875d11f1b34ec4c65d7430b075575b78cd2502034c469ee", "0xc64e7c81b18b674fc5b037d8a0041bfe3332d86c780a4688f404ee01fbabb152", "0x3838891d4843c6d7f9f494570b6fd8843f4e3c3ddb817c1411760bd31b819806"];
469
+
470
+ /** Framework-agnostic transaction receipt (only the fields the SDK needs). */
471
+ interface TransactionReceipt {
472
+ /** Event logs emitted during the transaction. */
473
+ readonly logs: readonly RawLog[];
474
+ }
475
+ /** Result of a write operation: the tx hash and its mined receipt. */
476
+ interface TransactionResult {
477
+ /** The transaction hash. */
478
+ txHash: Hex;
479
+ /** The mined transaction receipt. */
480
+ receipt: TransactionReceipt;
481
+ }
482
+ /**
483
+ * Minimal contract call configuration.
484
+ * Matches the shape returned by contract call builder functions in `src/contracts/`.
485
+ */
486
+ interface ContractCallConfig {
487
+ /** Target contract address. */
488
+ readonly address: Address;
489
+ /** ABI fragment for the function being called. */
490
+ readonly abi: readonly unknown[];
491
+ /** Solidity function name. */
492
+ readonly functionName: string;
493
+ /** Encoded function arguments. */
494
+ readonly args: readonly unknown[];
495
+ /** Native value to send with the transaction (for payable functions). */
496
+ readonly value?: bigint;
497
+ /** Gas limit override. */
498
+ readonly gas?: bigint;
499
+ }
500
+ /**
501
+ * Framework-agnostic signer interface.
502
+ * Wallet devs implement this with their library of choice.
503
+ * The React SDK ships pre-built adapters for wagmi/viem/ethers.
504
+ */
505
+ interface GenericSigner {
506
+ /** Return the chain ID of the connected network. */
507
+ getChainId(): Promise<number>;
508
+ /** The connected wallet address. */
509
+ getAddress: () => Promise<Address>;
510
+ /** Sign EIP-712 typed data (used for decrypt authorization). */
511
+ signTypedData(typedData: EIP712TypedData): Promise<Hex>;
512
+ /** Send a write transaction and return the tx hash. */
513
+ writeContract<C extends ContractCallConfig>(config: C): Promise<Hex>;
514
+ /** Execute a read-only call and return the decoded result. */
515
+ readContract<T = unknown, C extends ContractCallConfig = ContractCallConfig>(config: C): Promise<T>;
516
+ /** Wait for a transaction to be mined and return its receipt. */
517
+ waitForTransactionReceipt(hash: Hex): Promise<TransactionReceipt>;
518
+ }
519
+ /** Pluggable key-value store for persisting FHE credentials. */
520
+ interface GenericStringStorage {
521
+ getItem(key: string): Promise<string | null>;
522
+ setItem(key: string, value: string): Promise<void>;
523
+ removeItem(key: string): Promise<void>;
524
+ }
525
+ /** Stored FHE credential data (serialized as JSON in the credential store). */
526
+ interface StoredCredentials {
527
+ /** FHE public key (hex-encoded). */
528
+ publicKey: string;
529
+ /** FHE private key (hex-encoded, encrypted at rest via AES-GCM). */
530
+ privateKey: string;
531
+ /** EIP-712 signature authorizing decryption. */
532
+ signature: string;
533
+ /** Contract addresses this credential is authorized for. */
534
+ contractAddresses: Address[];
535
+ /** Unix timestamp (seconds) when the credential became valid. */
536
+ startTimestamp: number;
537
+ /** Number of days the credential remains valid. */
538
+ durationDays: number;
539
+ }
540
+ /** Progress callbacks for multi-step unshield operations. */
541
+ interface UnshieldCallbacks {
542
+ /** Fired after the unwrap transaction is submitted. */
543
+ onUnwrapSubmitted?: (txHash: Hex) => void;
544
+ /** Fired when the finalization step begins (receipt parsed, about to finalize). */
545
+ onFinalizing?: () => void;
546
+ /** Fired after the finalize transaction is submitted. */
547
+ onFinalizeSubmitted?: (txHash: Hex) => void;
548
+ }
549
+
550
+ export { findUnwrapRequested as $, TOKEN_TOPICS as A, Topics as B, type ContractCallConfig as C, type DelegatedUserDecryptParams as D, type EIP712TypedData as E, type FHEKeypair as F, type GenericSigner as G, type Hex as H, type UnwrapRequestedEvent as I, type UnwrappedFinalizedEvent as J, type UnwrappedStartedEvent as K, type WrappedEvent as L, decodeConfidentialTransfer as M, type NetworkType as N, type OnChainEvent as O, type PublicDecryptResult as P, decodeOnChainEvent as Q, type RequestZKProofVerificationResponseData as R, type StoredCredentials as S, type TransactionReceipt as T, type UserDecryptParams as U, decodeOnChainEvents as V, type WorkerRequest as W, decodeUnwrapRequested as X, decodeUnwrappedFinalized as Y, decodeUnwrappedStarted as Z, decodeWrapped as _, type EncryptParams as a, findWrapped as a0, type EncryptResult as b, type GenericLogger as c, type WorkerRequestType as d, type WorkerResponse as e, type GenerateKeypairResponseData as f, type CreateEIP712Payload as g, type CreateEIP712ResponseData as h, type EncryptPayload as i, type EncryptResponseData as j, type UserDecryptPayload as k, type UserDecryptResponseData as l, type PublicDecryptResponseData as m, type CreateDelegatedEIP712Payload as n, type CreateDelegatedEIP712ResponseData as o, type DelegatedUserDecryptPayload as p, type DelegatedUserDecryptResponseData as q, type GetPublicKeyResponseData as r, type GetPublicParamsResponseData as s, type GenericStringStorage as t, type RelayerWebConfig as u, type TransactionResult as v, type UnshieldCallbacks as w, type RawLog as x, type ConfidentialTransferEvent as y, type RelayerSDKStatus as z };