@zama-fhe/sdk 3.0.0-alpha.2 → 3.0.0-alpha.21
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/README.md +207 -122
- package/dist/cjs/build.cjs +2 -0
- package/dist/cjs/build.cjs.map +1 -0
- package/dist/cjs/chains/index.cjs +1 -0
- package/dist/cjs/chains.cjs +2 -0
- package/dist/cjs/chains.cjs.map +1 -0
- package/dist/cjs/cleartext/index.cjs +1 -1
- package/dist/cjs/eip1193-subscribe.cjs +1 -1
- package/dist/cjs/eip1193-subscribe.cjs.map +1 -1
- package/dist/cjs/encryption.cjs +2 -0
- package/dist/cjs/encryption.cjs.map +1 -0
- package/dist/cjs/ethers/index.cjs +1 -1
- package/dist/cjs/ethers/index.cjs.map +1 -1
- package/dist/cjs/index.cjs +73 -73
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/query/index.cjs +1 -1
- package/dist/cjs/query/index.cjs.map +1 -1
- package/dist/cjs/readonly-token.cjs +1 -1
- package/dist/cjs/readonly-token.cjs.map +1 -1
- package/dist/cjs/relayer-cleartext.cjs +2 -0
- package/dist/cjs/relayer-cleartext.cjs.map +1 -0
- package/dist/cjs/relayer-sdk.worker.js +71 -71
- package/dist/cjs/relayer.cjs +1 -1
- package/dist/cjs/relayer.cjs.map +1 -1
- package/dist/cjs/viem/index.cjs +1 -1
- package/dist/cjs/viem/index.cjs.map +1 -1
- package/dist/cjs/wrappers-registry.cjs +1 -1
- package/dist/cjs/wrappers-registry.cjs.map +1 -1
- package/dist/esm/{assertions-BARApuMj.js → assertions-CfqI3AJv.js} +1 -1
- package/dist/esm/{assertions-BARApuMj.js.map → assertions-CfqI3AJv.js.map} +1 -1
- package/dist/esm/build-CvenCk6R.js +2 -0
- package/dist/esm/build-CvenCk6R.js.map +1 -0
- package/dist/esm/chains/index.d.ts +3 -0
- package/dist/esm/chains/index.js +1 -0
- package/dist/esm/chains-aHmrozPh.js +2 -0
- package/dist/esm/chains-aHmrozPh.js.map +1 -0
- package/dist/esm/cleartext/index.d.ts +2 -86
- package/dist/esm/cleartext/index.js +1 -1
- package/dist/esm/cleartext-BHu6-LCv.d.ts +19 -0
- package/dist/esm/cleartext-I-etE_7S.js +2 -0
- package/dist/esm/cleartext-I-etE_7S.js.map +1 -0
- package/dist/esm/eip1193-subscribe-CcotSOIm.js +2 -0
- package/dist/esm/eip1193-subscribe-CcotSOIm.js.map +1 -0
- package/dist/esm/{encryption-CmIPBcfP.js → encryption-YS-Kb7qm.js} +2 -2
- package/dist/esm/{encryption-CmIPBcfP.js.map → encryption-YS-Kb7qm.js.map} +1 -1
- package/dist/esm/ethers/index.d.ts +53 -8
- package/dist/esm/ethers/index.js +1 -1
- package/dist/esm/ethers/index.js.map +1 -1
- package/dist/esm/{hex-D_B-zoId.js → hex-BZVTzEK6.js} +2 -2
- package/dist/esm/{hex-D_B-zoId.js.map → hex-BZVTzEK6.js.map} +1 -1
- package/dist/esm/{relayer-utils-iSPis4x-.d.ts → index-BTY0MxOt.d.ts} +50 -23
- package/dist/esm/{onchain-events-2VNiL78c.d.ts → index-BdyljG1F.d.ts} +387 -1505
- package/dist/esm/index.d.ts +61 -93
- package/dist/esm/index.js +73 -73
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/memory-storage-CFXqXUcm.js +2 -0
- package/dist/esm/memory-storage-CFXqXUcm.js.map +1 -0
- package/dist/esm/node/index.d.ts +88 -110
- package/dist/esm/node/index.js +1 -1
- package/dist/esm/node/index.js.map +1 -1
- package/dist/esm/node/relayer-sdk.node-worker.js +1 -1
- package/dist/esm/node/relayer-sdk.node-worker.js.map +1 -1
- package/dist/esm/query/index.d.ts +40 -50
- package/dist/esm/query/index.js +1 -1
- package/dist/esm/query/index.js.map +1 -1
- package/dist/esm/readonly-token-DCLOYhws.js +2 -0
- package/dist/esm/readonly-token-DCLOYhws.js.map +1 -0
- package/dist/esm/{relayer-C6u3eOlN.js → relayer-7Hd00A6X.js} +2 -2
- package/dist/esm/relayer-7Hd00A6X.js.map +1 -0
- package/dist/esm/{relayer-sdk.types-CGfXwKcB.d.ts → relayer-cleartext-DJkSUlZ2.d.ts} +263 -106
- package/dist/esm/relayer-cleartext-SZCM9wTx.js +2 -0
- package/dist/esm/relayer-cleartext-SZCM9wTx.js.map +1 -0
- package/dist/esm/relayer-sdk.worker.js +71 -71
- package/dist/esm/types-C1S426x4.d.ts +48 -0
- package/dist/esm/types-CVyJHEya.d.ts +14 -0
- package/dist/esm/types-DePjTTbo.d.ts +30 -0
- package/dist/esm/types-FY7ciI37.d.ts +615 -0
- package/dist/esm/viem/index.d.ts +39 -11
- package/dist/esm/viem/index.js +1 -1
- package/dist/esm/viem/index.js.map +1 -1
- package/dist/esm/wrappers-registry-CXNs4eR0.js +2 -0
- package/dist/esm/wrappers-registry-CXNs4eR0.js.map +1 -0
- package/package.json +17 -3
- package/dist/cjs/cleartext.cjs +0 -2
- package/dist/cjs/cleartext.cjs.map +0 -1
- package/dist/esm/cleartext-Cs28cTsa.js +0 -2
- package/dist/esm/cleartext-Cs28cTsa.js.map +0 -1
- package/dist/esm/eip1193-subscribe-Cl_wlVuQ.js +0 -2
- package/dist/esm/eip1193-subscribe-Cl_wlVuQ.js.map +0 -1
- package/dist/esm/memory-storage-F8xjMzVy.js +0 -2
- package/dist/esm/memory-storage-F8xjMzVy.js.map +0 -1
- package/dist/esm/readonly-token-D4GjTj0q.js +0 -2
- package/dist/esm/readonly-token-D4GjTj0q.js.map +0 -1
- package/dist/esm/relayer-C6u3eOlN.js.map +0 -1
- package/dist/esm/relayer-sdk-DPqytEbO.d.ts +0 -44
- package/dist/esm/relayer-utils-BeoTNDM4.js +0 -2
- package/dist/esm/relayer-utils-BeoTNDM4.js.map +0 -1
- package/dist/esm/wrappers-registry-ydyySM9g.js +0 -2
- package/dist/esm/wrappers-registry-ydyySM9g.js.map +0 -1
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
import { n as FheChain, t as AtLeastOneChain } from "./types-C1S426x4.js";
|
|
2
|
+
import { A as GenericSigner, O as GenericStorage, P as RawLog, _ as UserDecryptParams, a as EIP712TypedData, c as EncryptResult, d as PublicDecryptResult, f as PublicKeyData, h as RelayerWebConfig, i as DelegatedUserDecryptParams, k as GenericProvider, l as Handle, n as RelayerSDK, p as PublicParamsData, r as ClearValueType, s as EncryptParams, t as RelayerCleartext, v as RelayerWorkerClient } from "./relayer-cleartext-DJkSUlZ2.js";
|
|
3
|
+
import { Address, Hex } from "viem";
|
|
4
|
+
import { InputProofBytesType, KeypairType, KmsDelegatedUserDecryptEIP712Type, ZKProofLike } from "@zama-fhe/relayer-sdk/bundle";
|
|
5
|
+
|
|
6
|
+
//#region src/events/onchain-events.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Event topic0 constants (keccak256 of the canonical Solidity signature).
|
|
9
|
+
* Pass to `getLogs({ topics: [Object.values(Topics)] })` to fetch all events.
|
|
10
|
+
*/
|
|
11
|
+
declare const Topics: {
|
|
12
|
+
/** `ConfidentialTransfer(address indexed from, address indexed to, bytes32 indexed amount)` */readonly ConfidentialTransfer: `0x${string}`; /** `Wrapped(address indexed to, uint256 amountIn)` */
|
|
13
|
+
readonly Wrapped: `0x${string}`; /** `UnwrapRequested(address indexed receiver, bytes32 indexed unwrapRequestId, bytes32 amount)` */
|
|
14
|
+
readonly UnwrapRequested: `0x${string}`; /** `UnwrapRequested(address indexed receiver, bytes32 amount)` */
|
|
15
|
+
readonly UnwrapRequestedLegacy: `0x${string}`; /** `UnwrapFinalized(address indexed receiver, bytes32 indexed unwrapRequestId, bytes32 encryptedAmount, uint64 cleartextAmount)` */
|
|
16
|
+
readonly UnwrapFinalized: `0x${string}`; /** `UnwrapFinalized(address indexed receiver, bytes32 encryptedAmount, uint64 cleartextAmount)` */
|
|
17
|
+
readonly UnwrapFinalizedLegacy: `0x${string}`; /** @deprecated Use `Topics.UnwrapFinalized`. */
|
|
18
|
+
readonly UnwrappedFinalized: `0x${string}`; /** `UnwrappedStarted(bool returnVal, uint256 indexed requestId, ...)` */
|
|
19
|
+
readonly UnwrappedStarted: `0x${string}`;
|
|
20
|
+
};
|
|
21
|
+
/** Decoded `ConfidentialTransfer` event — an encrypted token transfer. */
|
|
22
|
+
interface ConfidentialTransferEvent {
|
|
23
|
+
readonly eventName: "ConfidentialTransfer";
|
|
24
|
+
/** Sender address. */
|
|
25
|
+
readonly from: Address;
|
|
26
|
+
/** Receiver address. */
|
|
27
|
+
readonly to: Address;
|
|
28
|
+
/** FHE ciphertext handle for the transferred amount. */
|
|
29
|
+
readonly encryptedAmountHandle: Handle;
|
|
30
|
+
}
|
|
31
|
+
/** Decoded `Wrapped` event — an ERC-20 shield (wrap) operation. */
|
|
32
|
+
interface WrappedEvent {
|
|
33
|
+
readonly eventName: "Wrapped";
|
|
34
|
+
/** Receiver of the minted confidential tokens. */
|
|
35
|
+
readonly to: Address;
|
|
36
|
+
/** Underlying ERC-20 tokens deposited. */
|
|
37
|
+
readonly amountIn: bigint;
|
|
38
|
+
}
|
|
39
|
+
/** Decoded `UnwrapRequested` event — an unshield request submitted. */
|
|
40
|
+
interface UnwrapRequestedEvent {
|
|
41
|
+
readonly eventName: "UnwrapRequested";
|
|
42
|
+
/** Address that will receive the unwrapped ERC-20 tokens. */
|
|
43
|
+
readonly receiver: Address;
|
|
44
|
+
/** FHE ciphertext handle for the requested unshield amount. */
|
|
45
|
+
readonly encryptedAmount: Handle;
|
|
46
|
+
/** Request identifier emitted by upgraded wrapper contracts. */
|
|
47
|
+
readonly unwrapRequestId?: Handle;
|
|
48
|
+
}
|
|
49
|
+
/** Decoded `UnwrapFinalized` event — an unshield completed on-chain. */
|
|
50
|
+
interface UnwrapFinalizedEvent {
|
|
51
|
+
readonly eventName: "UnwrapFinalized";
|
|
52
|
+
/** Address receiving the unwrapped ERC-20 tokens. */
|
|
53
|
+
readonly receiver: Address;
|
|
54
|
+
/** FHE ciphertext handle of the burnt confidential balance. */
|
|
55
|
+
readonly encryptedAmount: Handle;
|
|
56
|
+
/** Cleartext amount of underlying ERC-20 tokens returned. */
|
|
57
|
+
readonly cleartextAmount: bigint;
|
|
58
|
+
/** Request identifier emitted by upgraded wrapper contracts. */
|
|
59
|
+
readonly unwrapRequestId?: Handle;
|
|
60
|
+
}
|
|
61
|
+
/** @deprecated Use `UnwrapFinalizedEvent`. */
|
|
62
|
+
interface UnwrappedFinalizedEvent {
|
|
63
|
+
readonly eventName: "UnwrappedFinalized";
|
|
64
|
+
readonly receiver: Address;
|
|
65
|
+
readonly encryptedAmount: Handle;
|
|
66
|
+
readonly cleartextAmount: bigint;
|
|
67
|
+
readonly unwrapRequestId?: Handle;
|
|
68
|
+
}
|
|
69
|
+
/** Decoded `UnwrappedStarted` event — the relayer began processing an unshield. */
|
|
70
|
+
interface UnwrappedStartedEvent {
|
|
71
|
+
readonly eventName: "UnwrappedStarted";
|
|
72
|
+
/** Whether the unwrap start succeeded. */
|
|
73
|
+
readonly returnVal: boolean;
|
|
74
|
+
/** On-chain request ID. */
|
|
75
|
+
readonly requestId: bigint;
|
|
76
|
+
/** On-chain transaction ID. */
|
|
77
|
+
readonly txId: bigint;
|
|
78
|
+
/** Receiver address. */
|
|
79
|
+
readonly to: Address;
|
|
80
|
+
/** Refund address (if applicable). */
|
|
81
|
+
readonly refund: Address;
|
|
82
|
+
/** FHE handle of the requested amount. */
|
|
83
|
+
readonly requestedAmount: Handle;
|
|
84
|
+
/** FHE handle of the burn amount. */
|
|
85
|
+
readonly burnAmount: Handle;
|
|
86
|
+
}
|
|
87
|
+
/** Union of all decoded confidential token event types. */
|
|
88
|
+
type OnChainEvent = ConfidentialTransferEvent | WrappedEvent | UnwrapRequestedEvent | UnwrapFinalizedEvent | UnwrappedFinalizedEvent | UnwrappedStartedEvent;
|
|
89
|
+
/**
|
|
90
|
+
* ConfidentialTransfer(address indexed from, address indexed to, bytes32 indexed amount)
|
|
91
|
+
* All 3 params indexed → topics[1..3], no data.
|
|
92
|
+
*/
|
|
93
|
+
declare function decodeConfidentialTransfer(log: RawLog): ConfidentialTransferEvent | null;
|
|
94
|
+
/**
|
|
95
|
+
* Wrapped(address indexed to, uint256 amountIn)
|
|
96
|
+
* Indexed: to (topics[1])
|
|
97
|
+
* Data: amountIn (uint256)
|
|
98
|
+
*/
|
|
99
|
+
declare function decodeWrapped(log: RawLog): WrappedEvent | null;
|
|
100
|
+
/**
|
|
101
|
+
* UnwrapRequested(address indexed receiver, bytes32 amount)
|
|
102
|
+
* UnwrapRequested(address indexed receiver, bytes32 indexed unwrapRequestId, bytes32 amount)
|
|
103
|
+
*/
|
|
104
|
+
declare function decodeUnwrapRequested(log: RawLog): UnwrapRequestedEvent | null;
|
|
105
|
+
/**
|
|
106
|
+
* UnwrapFinalized(address indexed receiver, bytes32 encryptedAmount, uint64 cleartextAmount)
|
|
107
|
+
* UnwrapFinalized(address indexed receiver, bytes32 indexed unwrapRequestId, bytes32 encryptedAmount, uint64 cleartextAmount)
|
|
108
|
+
*/
|
|
109
|
+
declare function decodeUnwrapFinalized(log: RawLog): UnwrapFinalizedEvent | null;
|
|
110
|
+
/** @deprecated Use `decodeUnwrapFinalized`. */
|
|
111
|
+
declare function decodeUnwrappedFinalized(log: RawLog): UnwrappedFinalizedEvent | null;
|
|
112
|
+
/**
|
|
113
|
+
* UnwrappedStarted(bool returnVal, uint256 indexed requestId, uint256 indexed txId, address indexed to,
|
|
114
|
+
* address refund, bytes32 requestedAmount, bytes32 burnAmount)
|
|
115
|
+
* Indexed: requestId (topics[1]), txId (topics[2]), to (topics[3])
|
|
116
|
+
* Data: returnVal, refund, requestedAmount, burnAmount
|
|
117
|
+
*/
|
|
118
|
+
declare function decodeUnwrappedStarted(log: RawLog): UnwrappedStartedEvent | null;
|
|
119
|
+
/**
|
|
120
|
+
* Try all decoders on a single log and return the first match, or `null`.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* const event = decodeOnChainEvent(log);
|
|
125
|
+
* if (event?.eventName === "ConfidentialTransfer") {
|
|
126
|
+
* console.log(event.from, event.to);
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
declare function decodeOnChainEvent(log: RawLog): OnChainEvent | null;
|
|
131
|
+
/**
|
|
132
|
+
* Batch-decode an array of logs, skipping unrecognized entries.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* const events = decodeOnChainEvents(receipt.logs);
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
declare function decodeOnChainEvents(logs: readonly RawLog[]): OnChainEvent[];
|
|
140
|
+
/**
|
|
141
|
+
* Find the first {@link UnwrapRequestedEvent} in a logs array.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```ts
|
|
145
|
+
* const event = findUnwrapRequested(receipt.logs);
|
|
146
|
+
* if (event) console.log(event.receiver, event.encryptedAmount);
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
declare function findUnwrapRequested(logs: readonly RawLog[]): UnwrapRequestedEvent | null;
|
|
150
|
+
/**
|
|
151
|
+
* Find the first {@link WrappedEvent} in a logs array.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```ts
|
|
155
|
+
* const event = findWrapped(receipt.logs);
|
|
156
|
+
* if (event) console.log(event.to, event.amountIn);
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
declare function findWrapped(logs: readonly RawLog[]): WrappedEvent | null;
|
|
160
|
+
/**
|
|
161
|
+
* All confidential token event topic0 hashes.
|
|
162
|
+
* Pass to `getLogs({ topics: [TOKEN_TOPICS] })` to fetch
|
|
163
|
+
* all confidential token events in a single RPC call.
|
|
164
|
+
*/
|
|
165
|
+
declare const TOKEN_TOPICS: readonly [`0x${string}`, `0x${string}`, `0x${string}`, `0x${string}`, `0x${string}`, `0x${string}`, `0x${string}`];
|
|
166
|
+
/**
|
|
167
|
+
* ACL delegation event topic0 constants (keccak256 of the canonical Solidity signature).
|
|
168
|
+
* These are ACL events, NOT token events — they are emitted by the ACL contract.
|
|
169
|
+
*/
|
|
170
|
+
declare const AclTopics: {
|
|
171
|
+
/** `DelegatedForUserDecryption(address indexed delegator, address indexed delegate, address contractAddress, uint64 delegationCounter, uint64 oldExpirationDate, uint64 newExpirationDate)` */readonly DelegatedForUserDecryption: `0x${string}`; /** `RevokedDelegationForUserDecryption(address indexed delegator, address indexed delegate, address contractAddress, uint64 delegationCounter, uint64 oldExpirationDate)` */
|
|
172
|
+
readonly RevokedDelegationForUserDecryption: `0x${string}`;
|
|
173
|
+
};
|
|
174
|
+
/** Decoded `DelegatedForUserDecryption` event — a delegation was created or renewed. */
|
|
175
|
+
interface DelegatedForUserDecryptionEvent {
|
|
176
|
+
readonly eventName: "DelegatedForUserDecryption";
|
|
177
|
+
/** Address of the delegator (the account granting access). */
|
|
178
|
+
readonly delegator: Address;
|
|
179
|
+
/** Address of the delegate (the account receiving access). */
|
|
180
|
+
readonly delegate: Address;
|
|
181
|
+
/** Contract address the delegation applies to. */
|
|
182
|
+
readonly contractAddress: Address;
|
|
183
|
+
/** Monotonic delegation counter. */
|
|
184
|
+
readonly delegationCounter: bigint;
|
|
185
|
+
/** Previous expiration timestamp (0 if first delegation). */
|
|
186
|
+
readonly oldExpirationDate: bigint;
|
|
187
|
+
/** New expiration timestamp. */
|
|
188
|
+
readonly newExpirationDate: bigint;
|
|
189
|
+
}
|
|
190
|
+
/** Decoded `RevokedDelegationForUserDecryption` event — a delegation was revoked. */
|
|
191
|
+
interface RevokedDelegationForUserDecryptionEvent {
|
|
192
|
+
readonly eventName: "RevokedDelegationForUserDecryption";
|
|
193
|
+
/** Address of the delegator. */
|
|
194
|
+
readonly delegator: Address;
|
|
195
|
+
/** Address of the delegate. */
|
|
196
|
+
readonly delegate: Address;
|
|
197
|
+
/** Contract address the revocation applies to. */
|
|
198
|
+
readonly contractAddress: Address;
|
|
199
|
+
/** Monotonic delegation counter. */
|
|
200
|
+
readonly delegationCounter: bigint;
|
|
201
|
+
/** Expiration date that was active before revocation. */
|
|
202
|
+
readonly oldExpirationDate: bigint;
|
|
203
|
+
}
|
|
204
|
+
/** Union of all decoded ACL delegation event types. */
|
|
205
|
+
type AclEvent = DelegatedForUserDecryptionEvent | RevokedDelegationForUserDecryptionEvent;
|
|
206
|
+
/**
|
|
207
|
+
* DelegatedForUserDecryption(address indexed delegator, address indexed delegate,
|
|
208
|
+
* address contractAddress, uint64 delegationCounter, uint64 oldExpirationDate, uint64 newExpirationDate)
|
|
209
|
+
* Indexed: delegator (topics[1]), delegate (topics[2])
|
|
210
|
+
* Data: contractAddress, delegationCounter, oldExpirationDate, newExpirationDate
|
|
211
|
+
*/
|
|
212
|
+
declare function decodeDelegatedForUserDecryption(log: RawLog): DelegatedForUserDecryptionEvent | null;
|
|
213
|
+
/**
|
|
214
|
+
* RevokedDelegationForUserDecryption(address indexed delegator, address indexed delegate,
|
|
215
|
+
* address contractAddress, uint64 delegationCounter, uint64 oldExpirationDate)
|
|
216
|
+
* Indexed: delegator (topics[1]), delegate (topics[2])
|
|
217
|
+
* Data: contractAddress, delegationCounter, oldExpirationDate
|
|
218
|
+
*/
|
|
219
|
+
declare function decodeRevokedDelegationForUserDecryption(log: RawLog): RevokedDelegationForUserDecryptionEvent | null;
|
|
220
|
+
/**
|
|
221
|
+
* Try all ACL delegation decoders on a single log and return the first match, or `null`.
|
|
222
|
+
*/
|
|
223
|
+
declare function decodeAclEvent(log: RawLog): AclEvent | null;
|
|
224
|
+
/**
|
|
225
|
+
* Batch-decode an array of logs for ACL delegation events, skipping unrecognized entries.
|
|
226
|
+
*/
|
|
227
|
+
declare function decodeAclEvents(logs: readonly RawLog[]): AclEvent[];
|
|
228
|
+
/**
|
|
229
|
+
* Find the first {@link DelegatedForUserDecryptionEvent} in a logs array.
|
|
230
|
+
*/
|
|
231
|
+
declare function findDelegatedForUserDecryption(logs: readonly RawLog[]): DelegatedForUserDecryptionEvent | null;
|
|
232
|
+
/**
|
|
233
|
+
* Find the first {@link RevokedDelegationForUserDecryptionEvent} in a logs array.
|
|
234
|
+
*/
|
|
235
|
+
declare function findRevokedDelegationForUserDecryption(logs: readonly RawLog[]): RevokedDelegationForUserDecryptionEvent | null;
|
|
236
|
+
/**
|
|
237
|
+
* Both ACL delegation event topic0 hashes.
|
|
238
|
+
* Pass to `getLogs({ topics: [ACL_TOPICS] })` to fetch
|
|
239
|
+
* all delegation events in a single RPC call.
|
|
240
|
+
*/
|
|
241
|
+
declare const ACL_TOPICS: readonly [`0x${string}`, `0x${string}`];
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/events/sdk-events.d.ts
|
|
244
|
+
/**
|
|
245
|
+
* All SDK event keys, accessible as `ZamaSDKEvents.EncryptStart` etc.
|
|
246
|
+
*/
|
|
247
|
+
declare const ZamaSDKEvents: {
|
|
248
|
+
readonly CredentialsLoading: "credentials:loading";
|
|
249
|
+
readonly CredentialsCached: "credentials:cached";
|
|
250
|
+
readonly CredentialsExpired: "credentials:expired";
|
|
251
|
+
readonly CredentialsCreating: "credentials:creating";
|
|
252
|
+
readonly CredentialsCreated: "credentials:created";
|
|
253
|
+
readonly CredentialsRevoked: "credentials:revoked";
|
|
254
|
+
readonly CredentialsPersistFailed: "credentials:persist_failed";
|
|
255
|
+
readonly CredentialsAllowed: "credentials:allowed";
|
|
256
|
+
readonly CredentialsCorrupted: "credentials:corrupted";
|
|
257
|
+
readonly SessionExpired: "session:expired";
|
|
258
|
+
readonly EncryptStart: "encrypt:start";
|
|
259
|
+
readonly EncryptEnd: "encrypt:end";
|
|
260
|
+
readonly EncryptError: "encrypt:error";
|
|
261
|
+
readonly DecryptStart: "decrypt:start";
|
|
262
|
+
readonly DecryptEnd: "decrypt:end";
|
|
263
|
+
readonly DecryptError: "decrypt:error";
|
|
264
|
+
readonly TransactionError: "transaction:error";
|
|
265
|
+
readonly ShieldSubmitted: "shield:submitted";
|
|
266
|
+
readonly TransferSubmitted: "transfer:submitted";
|
|
267
|
+
readonly TransferFromSubmitted: "transferFrom:submitted";
|
|
268
|
+
readonly ApproveSubmitted: "approve:submitted";
|
|
269
|
+
readonly ApproveUnderlyingSubmitted: "approveUnderlying:submitted";
|
|
270
|
+
readonly UnwrapSubmitted: "unwrap:submitted";
|
|
271
|
+
readonly FinalizeUnwrapSubmitted: "finalizeUnwrap:submitted";
|
|
272
|
+
readonly DelegationSubmitted: "delegation:submitted";
|
|
273
|
+
readonly RevokeDelegationSubmitted: "revokeDelegation:submitted";
|
|
274
|
+
readonly UnshieldPhase1Submitted: "unshield:phase1_submitted";
|
|
275
|
+
readonly UnshieldPhase2Started: "unshield:phase2_started";
|
|
276
|
+
readonly UnshieldPhase2Submitted: "unshield:phase2_submitted";
|
|
277
|
+
};
|
|
278
|
+
/** Union of all SDK event type strings. */
|
|
279
|
+
type ZamaSDKEventType = (typeof ZamaSDKEvents)[keyof typeof ZamaSDKEvents];
|
|
280
|
+
interface BaseEvent {
|
|
281
|
+
tokenAddress?: Address;
|
|
282
|
+
timestamp: number;
|
|
283
|
+
/** Shared identifier linking related events in multi-phase operations (e.g. unshield). */
|
|
284
|
+
operationId?: string;
|
|
285
|
+
}
|
|
286
|
+
interface CredentialsLoadingEvent extends BaseEvent {
|
|
287
|
+
type: typeof ZamaSDKEvents.CredentialsLoading;
|
|
288
|
+
/** Contract addresses being requested. */
|
|
289
|
+
contractAddresses?: Address[];
|
|
290
|
+
}
|
|
291
|
+
interface CredentialsCachedEvent extends BaseEvent {
|
|
292
|
+
type: typeof ZamaSDKEvents.CredentialsCached;
|
|
293
|
+
/** Contract addresses covered by the cached credentials. */
|
|
294
|
+
contractAddresses?: Address[];
|
|
295
|
+
}
|
|
296
|
+
interface CredentialsExpiredEvent extends BaseEvent {
|
|
297
|
+
type: typeof ZamaSDKEvents.CredentialsExpired;
|
|
298
|
+
/** Contract addresses that need re-authorization. */
|
|
299
|
+
contractAddresses?: Address[];
|
|
300
|
+
}
|
|
301
|
+
interface CredentialsCreatingEvent extends BaseEvent {
|
|
302
|
+
type: typeof ZamaSDKEvents.CredentialsCreating;
|
|
303
|
+
/** Contract addresses being authorized. */
|
|
304
|
+
contractAddresses?: Address[];
|
|
305
|
+
}
|
|
306
|
+
interface CredentialsCreatedEvent extends BaseEvent {
|
|
307
|
+
type: typeof ZamaSDKEvents.CredentialsCreated;
|
|
308
|
+
/** Contract addresses covered by the new credentials. */
|
|
309
|
+
contractAddresses?: Address[];
|
|
310
|
+
}
|
|
311
|
+
interface CredentialsRevokedEvent extends BaseEvent {
|
|
312
|
+
type: typeof ZamaSDKEvents.CredentialsRevoked;
|
|
313
|
+
contractAddresses?: Address[];
|
|
314
|
+
}
|
|
315
|
+
interface CredentialsPersistFailedEvent extends BaseEvent {
|
|
316
|
+
type: typeof ZamaSDKEvents.CredentialsPersistFailed;
|
|
317
|
+
/** The error that caused the persist failure. */
|
|
318
|
+
error: Error;
|
|
319
|
+
}
|
|
320
|
+
interface CredentialsAllowedEvent extends BaseEvent {
|
|
321
|
+
type: typeof ZamaSDKEvents.CredentialsAllowed;
|
|
322
|
+
/** Contract addresses covered by the authorized credentials. */
|
|
323
|
+
contractAddresses?: Address[];
|
|
324
|
+
}
|
|
325
|
+
interface CredentialsCorruptedEvent extends BaseEvent {
|
|
326
|
+
type: typeof ZamaSDKEvents.CredentialsCorrupted;
|
|
327
|
+
/** The error that revealed storage corruption. */
|
|
328
|
+
error: Error;
|
|
329
|
+
}
|
|
330
|
+
interface SessionExpiredEvent extends BaseEvent {
|
|
331
|
+
type: typeof ZamaSDKEvents.SessionExpired;
|
|
332
|
+
/** Why the session expired. Currently always `"ttl"`, extensible for future inactivity timeout. */
|
|
333
|
+
reason: "ttl";
|
|
334
|
+
}
|
|
335
|
+
interface EncryptStartEvent extends BaseEvent {
|
|
336
|
+
type: typeof ZamaSDKEvents.EncryptStart;
|
|
337
|
+
}
|
|
338
|
+
interface EncryptEndEvent extends BaseEvent {
|
|
339
|
+
type: typeof ZamaSDKEvents.EncryptEnd;
|
|
340
|
+
durationMs: number;
|
|
341
|
+
}
|
|
342
|
+
interface EncryptErrorEvent extends BaseEvent {
|
|
343
|
+
type: typeof ZamaSDKEvents.EncryptError;
|
|
344
|
+
/** The error that caused the encryption to fail. */
|
|
345
|
+
error: Error;
|
|
346
|
+
durationMs: number;
|
|
347
|
+
}
|
|
348
|
+
interface DecryptStartEvent extends BaseEvent {
|
|
349
|
+
type: typeof ZamaSDKEvents.DecryptStart;
|
|
350
|
+
/** Handles being decrypted — correlate with matching DecryptEnd/DecryptError. */
|
|
351
|
+
handles: Handle[];
|
|
352
|
+
}
|
|
353
|
+
interface DecryptEndEvent extends BaseEvent {
|
|
354
|
+
type: typeof ZamaSDKEvents.DecryptEnd;
|
|
355
|
+
durationMs: number;
|
|
356
|
+
/** Handles that were decrypted. */
|
|
357
|
+
handles: Handle[];
|
|
358
|
+
/** Decrypted values keyed by handle — use this to correlate events to specific handles. */
|
|
359
|
+
result: Record<Handle, ClearValueType>;
|
|
360
|
+
}
|
|
361
|
+
interface DecryptErrorEvent extends BaseEvent {
|
|
362
|
+
type: typeof ZamaSDKEvents.DecryptError;
|
|
363
|
+
/** The error that caused the decryption to fail. */
|
|
364
|
+
error: Error;
|
|
365
|
+
durationMs: number;
|
|
366
|
+
/** Handles that were being decrypted when the error occurred. */
|
|
367
|
+
handles: Handle[];
|
|
368
|
+
}
|
|
369
|
+
interface TransactionErrorEvent extends BaseEvent {
|
|
370
|
+
type: typeof ZamaSDKEvents.TransactionError;
|
|
371
|
+
/** Which write operation failed. */
|
|
372
|
+
operation: string;
|
|
373
|
+
/** The error that caused the transaction to fail. */
|
|
374
|
+
error: Error;
|
|
375
|
+
}
|
|
376
|
+
interface ShieldSubmittedEvent extends BaseEvent {
|
|
377
|
+
type: typeof ZamaSDKEvents.ShieldSubmitted;
|
|
378
|
+
txHash: Hex;
|
|
379
|
+
}
|
|
380
|
+
interface TransferSubmittedEvent extends BaseEvent {
|
|
381
|
+
type: typeof ZamaSDKEvents.TransferSubmitted;
|
|
382
|
+
txHash: Hex;
|
|
383
|
+
}
|
|
384
|
+
interface TransferFromSubmittedEvent extends BaseEvent {
|
|
385
|
+
type: typeof ZamaSDKEvents.TransferFromSubmitted;
|
|
386
|
+
txHash: Hex;
|
|
387
|
+
}
|
|
388
|
+
interface ApproveSubmittedEvent extends BaseEvent {
|
|
389
|
+
type: typeof ZamaSDKEvents.ApproveSubmitted;
|
|
390
|
+
txHash: Hex;
|
|
391
|
+
}
|
|
392
|
+
interface ApproveUnderlyingSubmittedEvent extends BaseEvent {
|
|
393
|
+
type: typeof ZamaSDKEvents.ApproveUnderlyingSubmitted;
|
|
394
|
+
txHash: Hex;
|
|
395
|
+
}
|
|
396
|
+
interface UnwrapSubmittedEvent extends BaseEvent {
|
|
397
|
+
type: typeof ZamaSDKEvents.UnwrapSubmitted;
|
|
398
|
+
txHash: Hex;
|
|
399
|
+
}
|
|
400
|
+
interface FinalizeUnwrapSubmittedEvent extends BaseEvent {
|
|
401
|
+
type: typeof ZamaSDKEvents.FinalizeUnwrapSubmitted;
|
|
402
|
+
txHash: Hex;
|
|
403
|
+
}
|
|
404
|
+
interface DelegationSubmittedEvent extends BaseEvent {
|
|
405
|
+
type: typeof ZamaSDKEvents.DelegationSubmitted;
|
|
406
|
+
txHash: Hex;
|
|
407
|
+
}
|
|
408
|
+
interface RevokeDelegationSubmittedEvent extends BaseEvent {
|
|
409
|
+
type: typeof ZamaSDKEvents.RevokeDelegationSubmitted;
|
|
410
|
+
txHash: Hex;
|
|
411
|
+
}
|
|
412
|
+
interface UnshieldPhase1SubmittedEvent extends BaseEvent {
|
|
413
|
+
type: typeof ZamaSDKEvents.UnshieldPhase1Submitted;
|
|
414
|
+
txHash: Hex;
|
|
415
|
+
}
|
|
416
|
+
interface UnshieldPhase2StartedEvent extends BaseEvent {
|
|
417
|
+
type: typeof ZamaSDKEvents.UnshieldPhase2Started;
|
|
418
|
+
}
|
|
419
|
+
interface UnshieldPhase2SubmittedEvent extends BaseEvent {
|
|
420
|
+
type: typeof ZamaSDKEvents.UnshieldPhase2Submitted;
|
|
421
|
+
txHash: Hex;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Discriminated union of all SDK events.
|
|
425
|
+
*
|
|
426
|
+
* Decrypt events carry handles and decrypted clear-text values so event
|
|
427
|
+
* subscribers can correlate and bind them in UI layers. Events never carry
|
|
428
|
+
* private keys, session signatures, or ZK proofs.
|
|
429
|
+
*/
|
|
430
|
+
type ZamaSDKEvent = CredentialsLoadingEvent | CredentialsCachedEvent | CredentialsExpiredEvent | CredentialsCreatingEvent | CredentialsCreatedEvent | CredentialsRevokedEvent | CredentialsPersistFailedEvent | CredentialsAllowedEvent | CredentialsCorruptedEvent | SessionExpiredEvent | EncryptStartEvent | EncryptEndEvent | EncryptErrorEvent | DecryptStartEvent | DecryptEndEvent | DecryptErrorEvent | TransactionErrorEvent | ShieldSubmittedEvent | TransferSubmittedEvent | TransferFromSubmittedEvent | ApproveSubmittedEvent | ApproveUnderlyingSubmittedEvent | UnwrapSubmittedEvent | FinalizeUnwrapSubmittedEvent | DelegationSubmittedEvent | RevokeDelegationSubmittedEvent | UnshieldPhase1SubmittedEvent | UnshieldPhase2StartedEvent | UnshieldPhase2SubmittedEvent;
|
|
431
|
+
type ZamaSDKEventListener = (event: ZamaSDKEvent) => void;
|
|
432
|
+
/** Distributive Omit that preserves the discriminated union. */
|
|
433
|
+
type ZamaSDKEventInput = ZamaSDKEvent extends infer E ? E extends ZamaSDKEvent ? Omit<E, "timestamp" | "tokenAddress"> : never : never;
|
|
434
|
+
//#endregion
|
|
435
|
+
//#region src/relayer/relayer-dispatcher.d.ts
|
|
436
|
+
/** Anything with a synchronous `terminate()` method (workers, pools). */
|
|
437
|
+
interface WorkerLike {
|
|
438
|
+
terminate(): void;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Owns chain management (chains / activeChain / switchChain) and delegates
|
|
442
|
+
* every {@link RelayerSDK} operation to the relayer for the currently active
|
|
443
|
+
* chain.
|
|
444
|
+
*
|
|
445
|
+
* Groups chains by relayer config reference identity, calls `createWorker`
|
|
446
|
+
* once per group with all chain configs, then calls `createRelayer`
|
|
447
|
+
* per chain with the shared worker.
|
|
448
|
+
*
|
|
449
|
+
* Workers/pools are held separately from relayers so the dispatcher can
|
|
450
|
+
* terminate them directly — relayers never own worker lifecycle.
|
|
451
|
+
*/
|
|
452
|
+
declare class RelayerDispatcher implements RelayerSDK, Disposable {
|
|
453
|
+
#private;
|
|
454
|
+
constructor(chains: readonly [FheChain, ...FheChain[]], configs: Readonly<Record<number, RelayerConfig>>);
|
|
455
|
+
get chains(): readonly FheChain[];
|
|
456
|
+
get chain(): FheChain;
|
|
457
|
+
switchChain(chainId: number): void;
|
|
458
|
+
generateKeypair(): Promise<KeypairType<Hex>>;
|
|
459
|
+
createEIP712(publicKey: Hex, contractAddresses: Address[], startTimestamp: number, durationDays?: number): Promise<EIP712TypedData>;
|
|
460
|
+
encrypt(params: EncryptParams): Promise<EncryptResult>;
|
|
461
|
+
userDecrypt(params: UserDecryptParams): Promise<Readonly<Record<Handle, ClearValueType>>>;
|
|
462
|
+
publicDecrypt(handles: Handle[]): Promise<PublicDecryptResult>;
|
|
463
|
+
createDelegatedUserDecryptEIP712(publicKey: Hex, contractAddresses: Address[], delegatorAddress: Address, startTimestamp: number, durationDays?: number): Promise<KmsDelegatedUserDecryptEIP712Type>;
|
|
464
|
+
delegatedUserDecrypt(params: DelegatedUserDecryptParams): Promise<Readonly<Record<Handle, ClearValueType>>>;
|
|
465
|
+
requestZKProofVerification(zkProof: ZKProofLike): Promise<InputProofBytesType>;
|
|
466
|
+
getPublicKey(): Promise<PublicKeyData | null>;
|
|
467
|
+
getPublicParams(bits: number): Promise<PublicParamsData | null>;
|
|
468
|
+
getAclAddress(): Promise<Address>;
|
|
469
|
+
terminate(): void;
|
|
470
|
+
[Symbol.dispose](): void;
|
|
471
|
+
}
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region src/relayer/base-relayer.d.ts
|
|
474
|
+
declare abstract class BaseRelayer {
|
|
475
|
+
#private;
|
|
476
|
+
protected abstract readonly chain: FheChain;
|
|
477
|
+
protected abstract init(): Promise<void>;
|
|
478
|
+
protected ensureInit(): Promise<void>;
|
|
479
|
+
protected resetInit(): void;
|
|
480
|
+
getAclAddress(): Promise<Address>;
|
|
481
|
+
}
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/relayer/relayer-web.d.ts
|
|
484
|
+
/**
|
|
485
|
+
* RelayerWeb — single-chain browser encryption/decryption layer.
|
|
486
|
+
* The worker is injected at construction time; the relayer does not own its lifecycle.
|
|
487
|
+
*/
|
|
488
|
+
declare class RelayerWeb extends BaseRelayer implements RelayerSDK, Disposable {
|
|
489
|
+
#private;
|
|
490
|
+
constructor(config: RelayerWebConfig);
|
|
491
|
+
protected get chain(): FheChain;
|
|
492
|
+
protected init(): Promise<void>;
|
|
493
|
+
/**
|
|
494
|
+
* Terminate clears the artifact cache only.
|
|
495
|
+
* The worker is externally owned — the relayer does not terminate it.
|
|
496
|
+
*/
|
|
497
|
+
terminate(): void;
|
|
498
|
+
/** Calls {@link terminate}. */
|
|
499
|
+
[Symbol.dispose](): void;
|
|
500
|
+
/**
|
|
501
|
+
* Generate a keypair for FHE operations.
|
|
502
|
+
*/
|
|
503
|
+
generateKeypair(): Promise<KeypairType<Hex>>;
|
|
504
|
+
/**
|
|
505
|
+
* Create EIP712 typed data for user decryption authorization.
|
|
506
|
+
*/
|
|
507
|
+
createEIP712(publicKey: Hex, contractAddresses: Address[], startTimestamp: number, durationDays?: number): Promise<EIP712TypedData>;
|
|
508
|
+
/**
|
|
509
|
+
* Encrypt values for use in smart contract calls.
|
|
510
|
+
* Each value must specify its FHE type (ebool, euint8–256, eaddress).
|
|
511
|
+
*/
|
|
512
|
+
encrypt(params: EncryptParams): Promise<EncryptResult>;
|
|
513
|
+
/**
|
|
514
|
+
* Decrypt ciphertexts using user's private key.
|
|
515
|
+
* Requires a valid EIP712 signature.
|
|
516
|
+
*/
|
|
517
|
+
userDecrypt(params: UserDecryptParams): Promise<Readonly<Record<Handle, ClearValueType>>>;
|
|
518
|
+
/**
|
|
519
|
+
* Public decryption - no authorization needed.
|
|
520
|
+
* Used for publicly visible encrypted values.
|
|
521
|
+
*/
|
|
522
|
+
publicDecrypt(handles: Handle[]): Promise<PublicDecryptResult>;
|
|
523
|
+
/**
|
|
524
|
+
* Create EIP712 typed data for delegated user decryption authorization.
|
|
525
|
+
*/
|
|
526
|
+
createDelegatedUserDecryptEIP712(publicKey: Hex, contractAddresses: Address[], delegatorAddress: Address, startTimestamp: number, durationDays?: number): Promise<KmsDelegatedUserDecryptEIP712Type>;
|
|
527
|
+
/**
|
|
528
|
+
* Decrypt ciphertexts via delegation.
|
|
529
|
+
* Requires a valid EIP712 signature from the delegator.
|
|
530
|
+
*/
|
|
531
|
+
delegatedUserDecrypt(params: DelegatedUserDecryptParams): Promise<Readonly<Record<Handle, ClearValueType>>>;
|
|
532
|
+
/**
|
|
533
|
+
* Submit a ZK proof to the relayer for verification.
|
|
534
|
+
*/
|
|
535
|
+
requestZKProofVerification(zkProof: ZKProofLike): Promise<InputProofBytesType>;
|
|
536
|
+
/**
|
|
537
|
+
* Get the TFHE compact public key.
|
|
538
|
+
* When storage is configured, the result is cached persistently.
|
|
539
|
+
*/
|
|
540
|
+
getPublicKey(): Promise<PublicKeyData | null>;
|
|
541
|
+
/**
|
|
542
|
+
* Get public parameters for encryption capacity.
|
|
543
|
+
* When storage is configured, the result is cached persistently.
|
|
544
|
+
*/
|
|
545
|
+
getPublicParams(bits: number): Promise<PublicParamsData | null>;
|
|
546
|
+
}
|
|
547
|
+
//#endregion
|
|
548
|
+
//#region src/config/types.d.ts
|
|
549
|
+
/** Options for web() relayer (threads, security, logger, storage). */
|
|
550
|
+
type WebRelayerOptions = Partial<Pick<RelayerWebConfig, "threads" | "security" | "logger">>;
|
|
551
|
+
/**
|
|
552
|
+
* Base relayer config.
|
|
553
|
+
*
|
|
554
|
+
* Groups chains by config reference identity, calls `createWorker`
|
|
555
|
+
* once per group with all chain configs, then calls `createRelayer`
|
|
556
|
+
* per chain with the shared worker.
|
|
557
|
+
*/
|
|
558
|
+
interface RelayerConfig {
|
|
559
|
+
readonly type: string;
|
|
560
|
+
/** Create a shared worker/pool for all chains in this relayer group. */
|
|
561
|
+
readonly createWorker?: (chains: FheChain[]) => any;
|
|
562
|
+
/** Create a single-chain relayer. `worker` is the return value of `createWorker`. */
|
|
563
|
+
readonly createRelayer: (chain: FheChain, worker: any) => RelayerSDK;
|
|
564
|
+
}
|
|
565
|
+
/** Web relayer config — narrows worker type to `RelayerWorkerClient`. */
|
|
566
|
+
interface WebRelayerConfig extends RelayerConfig {
|
|
567
|
+
readonly type: "web";
|
|
568
|
+
readonly createWorker: (chains: FheChain[]) => RelayerWorkerClient;
|
|
569
|
+
readonly createRelayer: (chain: FheChain, worker: RelayerWorkerClient) => RelayerWeb;
|
|
570
|
+
}
|
|
571
|
+
/** Cleartext relayer config — no worker, returns `RelayerCleartext`. */
|
|
572
|
+
interface CleartextRelayerConfig extends RelayerConfig {
|
|
573
|
+
readonly type: "cleartext";
|
|
574
|
+
readonly createRelayer: (chain: FheChain, worker: unknown) => RelayerCleartext;
|
|
575
|
+
}
|
|
576
|
+
/** Shared options across all adapter paths. */
|
|
577
|
+
interface ZamaConfigBase<TChains extends AtLeastOneChain = AtLeastOneChain> {
|
|
578
|
+
/** FHE chain configurations. Defines which chains support FHE operations. */
|
|
579
|
+
chains: TChains;
|
|
580
|
+
/** Per-chain relayer configuration. Every chain must have a relayer entry. */
|
|
581
|
+
relayers: { [K in TChains[number]["id"]]: RelayerConfig };
|
|
582
|
+
/** Credential storage. Default: IndexedDB in browser, memory in Node. */
|
|
583
|
+
storage?: GenericStorage;
|
|
584
|
+
/** Session storage. Default: IndexedDB in browser, memory in Node. */
|
|
585
|
+
sessionStorage?: GenericStorage;
|
|
586
|
+
/** ML-KEM keypair TTL in seconds. Default: 2592000 (30 days). */
|
|
587
|
+
keypairTTL?: number;
|
|
588
|
+
/** Session signature TTL in seconds. Default: 2592000 (30 days). */
|
|
589
|
+
sessionTTL?: number | "infinite";
|
|
590
|
+
/** Registry cache TTL in seconds. Default: 86400 (24h). */
|
|
591
|
+
registryTTL?: number;
|
|
592
|
+
/** SDK lifecycle event listener. */
|
|
593
|
+
onEvent?: ZamaSDKEventListener;
|
|
594
|
+
}
|
|
595
|
+
/** Generic config — pass any {@link GenericSigner} and {@link GenericProvider} directly. */
|
|
596
|
+
interface ZamaConfigGeneric<TChains extends AtLeastOneChain = AtLeastOneChain> extends ZamaConfigBase<TChains> {
|
|
597
|
+
signer: GenericSigner;
|
|
598
|
+
provider: GenericProvider;
|
|
599
|
+
}
|
|
600
|
+
/** Resolved config object returned by `createConfig`. */
|
|
601
|
+
interface ZamaConfig {
|
|
602
|
+
readonly chains: readonly FheChain[];
|
|
603
|
+
readonly relayer: RelayerDispatcher;
|
|
604
|
+
readonly provider: GenericProvider;
|
|
605
|
+
readonly signer: GenericSigner;
|
|
606
|
+
readonly storage: GenericStorage;
|
|
607
|
+
readonly sessionStorage: GenericStorage;
|
|
608
|
+
readonly keypairTTL: number | undefined;
|
|
609
|
+
readonly sessionTTL: number | "infinite" | undefined;
|
|
610
|
+
readonly registryTTL: number | undefined;
|
|
611
|
+
readonly onEvent: ZamaSDKEventListener | undefined;
|
|
612
|
+
}
|
|
613
|
+
//#endregion
|
|
614
|
+
export { RevokedDelegationForUserDecryptionEvent as $, EncryptStartEvent as A, UnshieldPhase2SubmittedEvent as B, CredentialsRevokedEvent as C, DelegationSubmittedEvent as D, DecryptStartEvent as E, TransactionErrorEvent as F, ZamaSDKEventType as G, ZamaSDKEvent as H, TransferFromSubmittedEvent as I, AclEvent as J, ZamaSDKEvents as K, TransferSubmittedEvent as L, RevokeDelegationSubmittedEvent as M, SessionExpiredEvent as N, EncryptEndEvent as O, ShieldSubmittedEvent as P, OnChainEvent as Q, UnshieldPhase1SubmittedEvent as R, CredentialsPersistFailedEvent as S, findWrapped as St, DecryptErrorEvent as T, ZamaSDKEventInput as U, UnwrapSubmittedEvent as V, ZamaSDKEventListener as W, ConfidentialTransferEvent as X, AclTopics as Y, DelegatedForUserDecryptionEvent as Z, CredentialsCorruptedEvent as _, decodeUnwrappedStarted as _t, ZamaConfig as a, UnwrappedStartedEvent as at, CredentialsExpiredEvent as b, findRevokedDelegationForUserDecryption as bt, RelayerWeb as c, decodeAclEvents as ct, WorkerLike as d, decodeOnChainEvent as dt, TOKEN_TOPICS as et, ApproveSubmittedEvent as f, decodeOnChainEvents as ft, CredentialsCachedEvent as g, decodeUnwrappedFinalized as gt, CredentialsAllowedEvent as h, decodeUnwrapRequested as ht, WebRelayerOptions as i, UnwrappedFinalizedEvent as it, FinalizeUnwrapSubmittedEvent as j, EncryptErrorEvent as k, BaseRelayer as l, decodeConfidentialTransfer as lt, BaseEvent as m, decodeUnwrapFinalized as mt, RelayerConfig as n, UnwrapFinalizedEvent as nt, ZamaConfigBase as o, WrappedEvent as ot, ApproveUnderlyingSubmittedEvent as p, decodeRevokedDelegationForUserDecryption as pt, ACL_TOPICS as q, WebRelayerConfig as r, UnwrapRequestedEvent as rt, ZamaConfigGeneric as s, decodeAclEvent as st, CleartextRelayerConfig as t, Topics as tt, RelayerDispatcher as u, decodeDelegatedForUserDecryption as ut, CredentialsCreatedEvent as v, decodeWrapped as vt, DecryptEndEvent as w, CredentialsLoadingEvent as x, findUnwrapRequested as xt, CredentialsCreatingEvent as y, findDelegatedForUserDecryption as yt, UnshieldPhase2StartedEvent as z };
|
|
615
|
+
//# sourceMappingURL=types-FY7ciI37.d.ts.map
|