@zama-fhe/react-sdk 3.0.0-alpha.4 → 3.0.0-alpha.40
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 +94 -883
- package/dist/index.d.ts +249 -289
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/wagmi/index.d.ts +9 -27
- package/dist/wagmi/index.js +1 -1
- package/dist/wagmi/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as _$_zama_fhe_sdk0 from "@zama-fhe/sdk";
|
|
4
|
-
import {
|
|
5
|
-
import { ApproveUnderlyingParams,
|
|
4
|
+
import { Address, BatchBalancesResult, ClearValueType, EIP712TypedData, EncryptParams, PaginatedResult, PublicKeyData, Token, TokenWrapperPair, TokenWrapperPairWithMetadata, TransactionResult, WrappedToken, ZKProofLike, ZamaConfig, ZamaSDK } from "@zama-fhe/sdk";
|
|
5
|
+
import { ApproveUnderlyingParams, BatchDecryptBalancesAsParams, ConfidentialSetOperatorParams, ConfidentialTransferFromParams, ConfidentialTransferParams, CreateDelegatedUserDecryptEIP712Params, CreateEIP712Params, DecryptBalanceAsParams, DecryptResult, DelegateDecryptionParams, DelegatedDecryptMutationParams, DelegationStatusData, FinalizeUnwrapParams, ResumeUnshieldParams, RevokeDelegationParams, ShieldParams, TokenMetadata, UnshieldAllParams, UnshieldParams, UnwrapParams, UserDecryptQueryConfig } from "@zama-fhe/sdk/query";
|
|
6
6
|
import * as _$_tanstack_react_query0 from "@tanstack/react-query";
|
|
7
|
-
import {
|
|
7
|
+
import { UseMutationOptions, UseMutationResult, UseQueryOptions } from "@tanstack/react-query";
|
|
8
8
|
import { PropsWithChildren } from "react";
|
|
9
9
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
10
10
|
import * as _$_zama_fhe_relayer_sdk_web0 from "@zama-fhe/relayer-sdk/web";
|
|
@@ -12,75 +12,34 @@ import * as _$_zama_fhe_relayer_sdk_web0 from "@zama-fhe/relayer-sdk/web";
|
|
|
12
12
|
//#region src/provider.d.ts
|
|
13
13
|
/** Props for {@link ZamaProvider}. */
|
|
14
14
|
interface ZamaProviderProps extends PropsWithChildren {
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/** Wallet signer (`ViemSigner`, `EthersSigner`, or custom {@link GenericSigner}). */
|
|
18
|
-
signer: GenericSigner$1;
|
|
19
|
-
/** Credential storage backend (IndexedDBStorage for browser, MemoryStorage for tests). */
|
|
20
|
-
storage: GenericStorage$1;
|
|
21
|
-
/**
|
|
22
|
-
* Session storage for wallet signatures. Defaults to in-memory (lost on reload).
|
|
23
|
-
* Pass a `chrome.storage.session`-backed store for web extensions.
|
|
24
|
-
*/
|
|
25
|
-
sessionStorage?: GenericStorage$1;
|
|
26
|
-
/**
|
|
27
|
-
* How long the ML-KEM re-encryption keypair remains valid, in seconds.
|
|
28
|
-
* Default: `86400` (1 day). Must be positive — `0` is rejected.
|
|
29
|
-
*/
|
|
30
|
-
keypairTTL?: number;
|
|
31
|
-
/**
|
|
32
|
-
* Controls how long session signatures (EIP-712 wallet signatures) remain valid, in seconds.
|
|
33
|
-
* Default: `2592000` (30 days).
|
|
34
|
-
* - `0`: never persist — every operation triggers a signing prompt (high-security mode).
|
|
35
|
-
* - Positive number: seconds until the session signature expires and requires re-authentication.
|
|
36
|
-
*/
|
|
37
|
-
sessionTTL?: number;
|
|
38
|
-
/**
|
|
39
|
-
* Per-chain wrappers registry address overrides, merged on top of built-in defaults.
|
|
40
|
-
* Use this for custom or local chains (e.g. Hardhat) where no default registry exists.
|
|
41
|
-
*/
|
|
42
|
-
registryAddresses?: Record<number, Address$1>;
|
|
43
|
-
/**
|
|
44
|
-
* How long cached registry results remain valid, in seconds.
|
|
45
|
-
* Default: `86400` (24 hours).
|
|
46
|
-
*/
|
|
47
|
-
registryTTL?: number;
|
|
48
|
-
/** Callback invoked on SDK lifecycle events. */
|
|
49
|
-
onEvent?: ZamaSDKEventListener$1;
|
|
15
|
+
/** Configuration object created by {@link createConfig}. */
|
|
16
|
+
config: ZamaConfig;
|
|
50
17
|
}
|
|
51
18
|
/**
|
|
52
19
|
* Provides a {@link ZamaSDK} instance to all descendant hooks.
|
|
53
20
|
*
|
|
54
21
|
* @example
|
|
55
22
|
* ```tsx
|
|
56
|
-
* <ZamaProvider
|
|
23
|
+
* <ZamaProvider config={zamaConfig}>
|
|
57
24
|
* <App />
|
|
58
25
|
* </ZamaProvider>
|
|
59
26
|
* ```
|
|
60
27
|
*/
|
|
61
28
|
declare function ZamaProvider({
|
|
62
29
|
children,
|
|
63
|
-
|
|
64
|
-
signer,
|
|
65
|
-
storage,
|
|
66
|
-
sessionStorage,
|
|
67
|
-
keypairTTL,
|
|
68
|
-
sessionTTL,
|
|
69
|
-
registryAddresses,
|
|
70
|
-
registryTTL,
|
|
71
|
-
onEvent
|
|
30
|
+
config
|
|
72
31
|
}: ZamaProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
73
32
|
/**
|
|
74
33
|
* Access the {@link ZamaSDK} instance from context.
|
|
75
|
-
* Throws if called outside a {@link ZamaProvider}
|
|
34
|
+
* Throws if called outside a {@link ZamaProvider}.
|
|
76
35
|
*
|
|
77
36
|
* @example
|
|
78
37
|
* ```tsx
|
|
79
38
|
* const sdk = useZamaSDK();
|
|
80
|
-
* const token = sdk.
|
|
39
|
+
* const token = sdk.createToken("0x...");
|
|
81
40
|
* ```
|
|
82
41
|
*/
|
|
83
|
-
declare function useZamaSDK(): ZamaSDK
|
|
42
|
+
declare function useZamaSDK(): ZamaSDK;
|
|
84
43
|
//#endregion
|
|
85
44
|
//#region src/relayer/use-encrypt.d.ts
|
|
86
45
|
/**
|
|
@@ -101,18 +60,18 @@ declare function useZamaSDK(): ZamaSDK$1;
|
|
|
101
60
|
declare function useEncrypt(): _$_tanstack_react_query0.UseMutationResult<Readonly<{
|
|
102
61
|
handles: Uint8Array[];
|
|
103
62
|
inputProof: Uint8Array;
|
|
104
|
-
}>, Error, EncryptParams
|
|
63
|
+
}>, Error, EncryptParams, unknown>;
|
|
105
64
|
//#endregion
|
|
106
|
-
//#region src/
|
|
65
|
+
//#region src/decrypt/use-user-decrypt.d.ts
|
|
107
66
|
/**
|
|
108
67
|
* React hook for FHE user decryption. Thin wrapper around
|
|
109
68
|
* `userDecryptQueryOptions` with `useQuery` semantics.
|
|
110
69
|
*/
|
|
111
|
-
declare function useUserDecrypt(config: UserDecryptQueryConfig
|
|
70
|
+
declare function useUserDecrypt(config: UserDecryptQueryConfig, options?: Omit<UseQueryOptions<DecryptResult>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<Readonly<Record<`0x${string}`, _$_zama_fhe_sdk0.ClearValueType>>, Error>;
|
|
112
71
|
/** Return type of {@link useUserDecrypt}. */
|
|
113
72
|
type UseUserDecryptResult = ReturnType<typeof useUserDecrypt>;
|
|
114
73
|
//#endregion
|
|
115
|
-
//#region src/
|
|
74
|
+
//#region src/decrypt/use-public-decrypt.d.ts
|
|
116
75
|
/**
|
|
117
76
|
* Decrypt FHE ciphertext handles using the network public key (no credential needed).
|
|
118
77
|
* On success, results are available via `data.clearValues` and written to the
|
|
@@ -169,7 +128,7 @@ declare function useGenerateKeypair(): _$_tanstack_react_query0.UseMutationResul
|
|
|
169
128
|
* });
|
|
170
129
|
* ```
|
|
171
130
|
*/
|
|
172
|
-
declare function useCreateEIP712(): _$_tanstack_react_query0.UseMutationResult<EIP712TypedData
|
|
131
|
+
declare function useCreateEIP712(): _$_tanstack_react_query0.UseMutationResult<EIP712TypedData, Error, CreateEIP712Params, unknown>;
|
|
173
132
|
//#endregion
|
|
174
133
|
//#region src/relayer/use-create-delegated-user-decrypt-eip712.d.ts
|
|
175
134
|
/**
|
|
@@ -196,21 +155,21 @@ declare function useCreateDelegatedUserDecryptEIP712(): _$_tanstack_react_query0
|
|
|
196
155
|
message: _$_zama_fhe_relayer_sdk_web0.KmsDelegatedUserDecryptEIP712MessageType;
|
|
197
156
|
}>, Error, CreateDelegatedUserDecryptEIP712Params, unknown>;
|
|
198
157
|
//#endregion
|
|
199
|
-
//#region src/
|
|
158
|
+
//#region src/decrypt/use-delegated-decrypt.d.ts
|
|
200
159
|
/**
|
|
201
160
|
* Decrypt FHE ciphertext handles using delegated user credentials.
|
|
202
161
|
* Returns a map of handle → plaintext bigint.
|
|
203
162
|
*
|
|
204
|
-
* @returns A mutation whose `mutate` accepts {@link
|
|
163
|
+
* @returns A mutation whose `mutate` accepts {@link DelegatedDecryptMutationParams}.
|
|
205
164
|
*
|
|
206
165
|
* @example
|
|
207
166
|
* ```tsx
|
|
208
|
-
* const decrypt =
|
|
209
|
-
* decrypt.mutate({ handles: ["0xHandle1"], ...
|
|
167
|
+
* const decrypt = useDelegatedDecrypt();
|
|
168
|
+
* decrypt.mutate({ handles: [{ handle: "0xHandle1", contractAddress: "0x..." }], delegatorAddress: "0x..." });
|
|
210
169
|
* // decrypt.data => { "0xHandle1": 1000n }
|
|
211
170
|
* ```
|
|
212
171
|
*/
|
|
213
|
-
declare function
|
|
172
|
+
declare function useDelegatedDecrypt(): _$_tanstack_react_query0.UseMutationResult<Record<`0x${string}`, ClearValueType>, Error, DelegatedDecryptMutationParams, unknown>;
|
|
214
173
|
//#endregion
|
|
215
174
|
//#region src/relayer/use-request-zk-proof-verification.d.ts
|
|
216
175
|
/**
|
|
@@ -229,7 +188,7 @@ declare function useDelegatedUserDecrypt(): _$_tanstack_react_query0.UseMutation
|
|
|
229
188
|
declare function useRequestZKProofVerification(): _$_tanstack_react_query0.UseMutationResult<Readonly<{
|
|
230
189
|
handles: Uint8Array[];
|
|
231
190
|
inputProof: Uint8Array;
|
|
232
|
-
}>, Error, ZKProofLike
|
|
191
|
+
}>, Error, ZKProofLike, unknown>;
|
|
233
192
|
//#endregion
|
|
234
193
|
//#region src/relayer/use-public-key.d.ts
|
|
235
194
|
/**
|
|
@@ -265,7 +224,7 @@ declare function usePublicParams(bits: number): _$_tanstack_react_query0.UseQuer
|
|
|
265
224
|
publicParamsId: string;
|
|
266
225
|
} | null, Error>;
|
|
267
226
|
//#endregion
|
|
268
|
-
//#region src/
|
|
227
|
+
//#region src/permits/use-grant-permit.d.ts
|
|
269
228
|
/**
|
|
270
229
|
* Sign an EIP-712 message authorizing decryption of confidential handles
|
|
271
230
|
* for a list of contract addresses. This is not token-specific — any
|
|
@@ -279,151 +238,152 @@ declare function usePublicParams(bits: number): _$_tanstack_react_query0.UseQuer
|
|
|
279
238
|
*
|
|
280
239
|
* @example
|
|
281
240
|
* ```tsx
|
|
282
|
-
* const { mutateAsync:
|
|
241
|
+
* const { mutateAsync: grantPermit, isPending } = useGrantPermit();
|
|
283
242
|
*
|
|
284
243
|
* // Authorize decryption for any contracts with encrypted state:
|
|
285
244
|
* // confidential tokens, auction contracts, governance contracts, etc.
|
|
286
|
-
* await
|
|
245
|
+
* await grantPermit([tokenAddress, auctionAddress, governanceAddress]);
|
|
287
246
|
* ```
|
|
288
247
|
*/
|
|
289
|
-
declare function
|
|
248
|
+
declare function useGrantPermit(options?: UseMutationOptions<void, Error, Address[]>): _$_tanstack_react_query0.UseMutationResult<void, Error, `0x${string}`[], unknown>;
|
|
290
249
|
//#endregion
|
|
291
|
-
//#region src/
|
|
292
|
-
/** Configuration for {@link
|
|
293
|
-
interface
|
|
250
|
+
//#region src/permits/use-has-permit.d.ts
|
|
251
|
+
/** Configuration for {@link useHasPermit}. */
|
|
252
|
+
interface UseHasPermitConfig {
|
|
294
253
|
/** Contract addresses to check credentials against (at least one required). */
|
|
295
|
-
contractAddresses: [Address
|
|
254
|
+
contractAddresses: [Address, ...Address[]];
|
|
296
255
|
}
|
|
297
256
|
/**
|
|
298
|
-
* Check whether
|
|
299
|
-
*
|
|
300
|
-
*
|
|
257
|
+
* Check whether stored permits cover the given contract addresses for the
|
|
258
|
+
* connected signer. Returns `true` if decrypt operations can proceed without
|
|
259
|
+
* a wallet prompt.
|
|
260
|
+
*
|
|
261
|
+
* @returns Query result with `data: boolean` — `true` if a stored permit covers
|
|
262
|
+
* every entry in `contractAddresses`. The query auto-disables when no signer is configured
|
|
263
|
+
* (`data` stays `undefined`, `status` stays `"pending"`).
|
|
264
|
+
* @throws if the query runs without a signer configured (the `enabled` guard normally
|
|
265
|
+
* prevents this; only reachable if the caller forces `query: { enabled: true }`). {@link SignerNotConfiguredError}
|
|
301
266
|
*
|
|
302
267
|
* @example
|
|
303
268
|
* ```tsx
|
|
304
|
-
* const { data:
|
|
269
|
+
* const { data: hasPermit } = useHasPermit({ contractAddresses: ["0xToken"] });
|
|
305
270
|
* ```
|
|
306
271
|
*/
|
|
307
|
-
declare function
|
|
272
|
+
declare function useHasPermit(config: UseHasPermitConfig): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
308
273
|
//#endregion
|
|
309
|
-
//#region src/
|
|
274
|
+
//#region src/permits/use-revoke-permits.d.ts
|
|
310
275
|
/**
|
|
311
|
-
* Revoke
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
276
|
+
* Revoke FHE permits for the current signer.
|
|
277
|
+
*
|
|
278
|
+
* - Called with no arguments: every permit is removed across all chains and
|
|
279
|
+
* delegators. The keypair survives — use {@link useClearCredentials} to also
|
|
280
|
+
* wipe the keypair.
|
|
281
|
+
* - Called with a contract list: only direct-decrypt permits on the current
|
|
282
|
+
* chain whose payload touches a listed address are removed. Delegated
|
|
283
|
+
* permits are not touched in this mode.
|
|
315
284
|
*
|
|
316
285
|
* @example
|
|
317
286
|
* ```tsx
|
|
318
|
-
* const { mutate:
|
|
319
|
-
*
|
|
320
|
-
* //
|
|
321
|
-
* revoke([tokenAddress, auctionAddress]);
|
|
287
|
+
* const { mutate: revokePermits } = useRevokePermits();
|
|
288
|
+
* revokePermits([tokenAddress]); // direct-decrypt scope, current chain
|
|
289
|
+
* revokePermits(); // every permit, all chains, all delegators
|
|
322
290
|
* ```
|
|
323
291
|
*/
|
|
324
|
-
declare function
|
|
292
|
+
declare function useRevokePermits(options?: UseMutationOptions<void, Error, Address[] | void>): _$_tanstack_react_query0.UseMutationResult<void, Error, void | `0x${string}`[], unknown>;
|
|
325
293
|
//#endregion
|
|
326
|
-
//#region src/
|
|
294
|
+
//#region src/permits/use-clear-credentials.d.ts
|
|
327
295
|
/**
|
|
328
|
-
*
|
|
329
|
-
*
|
|
296
|
+
* Wipe the keypair for the current signer and cascade-delete every permit
|
|
297
|
+
* (across chains and delegators) referencing it. Useful for "log out"
|
|
298
|
+
* handlers that should leave no trace.
|
|
330
299
|
*
|
|
331
300
|
* @example
|
|
332
301
|
* ```tsx
|
|
333
|
-
* const { mutate:
|
|
334
|
-
*
|
|
302
|
+
* const { mutate: clearCredentials } = useClearCredentials();
|
|
303
|
+
* clearCredentials();
|
|
335
304
|
* ```
|
|
336
305
|
*/
|
|
337
|
-
declare function
|
|
306
|
+
declare function useClearCredentials(options?: UseMutationOptions<void>): _$_tanstack_react_query0.UseMutationResult<void, Error, void, unknown>;
|
|
338
307
|
//#endregion
|
|
339
308
|
//#region src/token/use-token.d.ts
|
|
340
|
-
/** Base configuration shared by all mutation hooks that need a Token instance. */
|
|
341
|
-
interface UseZamaConfig {
|
|
342
|
-
/** Address of the confidential token contract. */
|
|
343
|
-
tokenAddress: Address$1;
|
|
344
|
-
/** Address of the wrapper contract (required for shield/unshield operations). */
|
|
345
|
-
wrapperAddress?: Address$1;
|
|
346
|
-
}
|
|
347
309
|
/**
|
|
348
|
-
* Get a {@link Token} instance, memoized by address
|
|
349
|
-
*
|
|
310
|
+
* Get a {@link Token} instance for an ERC-7984 confidential token, memoized by address.
|
|
311
|
+
* Supports balance queries, transfers, and operator approval.
|
|
312
|
+
*
|
|
313
|
+
* For ERC-7984 wrappers (shield/unshield), use {@link useWrappedToken} instead.
|
|
350
314
|
*
|
|
351
|
-
* @param
|
|
315
|
+
* @param address - The confidential token contract address.
|
|
352
316
|
* @returns A memoized `Token` instance.
|
|
353
317
|
*
|
|
354
318
|
* @example
|
|
355
319
|
* ```tsx
|
|
356
|
-
* const token = useToken(
|
|
320
|
+
* const token = useToken("0xToken");
|
|
321
|
+
* // token.balanceOf(), token.confidentialTransfer(), etc.
|
|
357
322
|
* ```
|
|
358
323
|
*/
|
|
359
|
-
declare function useToken(
|
|
324
|
+
declare function useToken(address: Address): Token;
|
|
360
325
|
//#endregion
|
|
361
|
-
//#region src/token/use-
|
|
326
|
+
//#region src/token/use-wrapped-token.d.ts
|
|
362
327
|
/**
|
|
363
|
-
* Get a {@link
|
|
364
|
-
*
|
|
365
|
-
*
|
|
328
|
+
* Get a {@link WrappedToken} instance for an ERC-7984 ERC-20 wrapper,
|
|
329
|
+
* memoized by address. Adds wrapper-specific operations (shield, unshield,
|
|
330
|
+
* underlying, allowance) on top of the base {@link useToken} API.
|
|
366
331
|
*
|
|
367
|
-
*
|
|
368
|
-
*
|
|
332
|
+
* The address is the wrapper contract address itself — the wrapper IS the
|
|
333
|
+
* confidential token.
|
|
334
|
+
*
|
|
335
|
+
* @param address - The confidential wrapper contract address.
|
|
336
|
+
* @returns A memoized `WrappedToken` instance.
|
|
369
337
|
*
|
|
370
338
|
* @example
|
|
371
339
|
* ```tsx
|
|
372
|
-
* const
|
|
373
|
-
* //
|
|
340
|
+
* const wrapped = useWrappedToken("0xWrapper");
|
|
341
|
+
* // wrapped.shield(1000n), wrapped.unshield(500n), etc.
|
|
374
342
|
* ```
|
|
375
343
|
*/
|
|
376
|
-
declare function
|
|
344
|
+
declare function useWrappedToken(address: Address): WrappedToken;
|
|
377
345
|
//#endregion
|
|
378
346
|
//#region src/balance/use-confidential-balance.d.ts
|
|
379
|
-
/** Configuration for {@link useConfidentialBalance}. */
|
|
380
347
|
interface UseConfidentialBalanceConfig {
|
|
381
348
|
/** Address of the confidential token contract. */
|
|
382
|
-
|
|
349
|
+
address: Address;
|
|
350
|
+
/** Account to fetch balance for. The query is disabled while `undefined`. */
|
|
351
|
+
account: Address | undefined;
|
|
383
352
|
}
|
|
384
|
-
/** Query options for {@link useConfidentialBalance}. */
|
|
385
353
|
interface UseConfidentialBalanceOptions extends Omit<UseQueryOptions<bigint>, "queryKey" | "queryFn" | "enabled"> {
|
|
386
|
-
/**
|
|
354
|
+
/** Set this to `false` to disable this query from automatically running. */
|
|
387
355
|
enabled?: boolean;
|
|
388
356
|
}
|
|
389
357
|
/**
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
* when the handle changes.
|
|
394
|
-
*
|
|
395
|
-
* @param config - Token address configuration.
|
|
396
|
-
* @param options - React Query options forwarded to the balance query.
|
|
397
|
-
* @returns The balance query result.
|
|
358
|
+
* Hook for fetching a confidential token balance. Reads the on-chain handle and
|
|
359
|
+
* decrypts via the SDK; cached values are returned instantly and the relayer is
|
|
360
|
+
* only hit when the handle changes.
|
|
398
361
|
*
|
|
399
362
|
* @example
|
|
400
363
|
* ```tsx
|
|
401
|
-
* const { data: balance
|
|
402
|
-
*
|
|
364
|
+
* const { data: balance } = useConfidentialBalance({
|
|
365
|
+
* address: "0xToken",
|
|
366
|
+
* account: "0xAccount",
|
|
403
367
|
* });
|
|
404
368
|
* ```
|
|
405
369
|
*/
|
|
406
370
|
declare function useConfidentialBalance(config: UseConfidentialBalanceConfig, options?: UseConfidentialBalanceOptions): _$_tanstack_react_query0.UseQueryResult<bigint, Error>;
|
|
407
371
|
//#endregion
|
|
408
372
|
//#region src/balance/use-confidential-balances.d.ts
|
|
409
|
-
/** Configuration for {@link useConfidentialBalances}. */
|
|
410
373
|
interface UseConfidentialBalancesConfig {
|
|
411
|
-
/** Addresses of the confidential token contracts to batch-query. */
|
|
412
|
-
|
|
374
|
+
/** Addresses of the confidential token contracts to batch-query. The query is disabled while empty. */
|
|
375
|
+
addresses: Address[];
|
|
376
|
+
/** Account to fetch balances for. The query is disabled while `undefined`. */
|
|
377
|
+
account: Address | undefined;
|
|
413
378
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
/** Whether the query is enabled. Callback form is not supported in composite hooks. */
|
|
379
|
+
interface UseConfidentialBalancesOptions extends Omit<UseQueryOptions<BatchBalancesResult>, "queryKey" | "queryFn" | "enabled"> {
|
|
380
|
+
/** Set this to `false` to disable this query from automatically running. */
|
|
417
381
|
enabled?: boolean;
|
|
418
382
|
}
|
|
419
383
|
/**
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
* changed handles.
|
|
424
|
-
*
|
|
425
|
-
* Returns partial results when some tokens fail — successful balances are
|
|
426
|
-
* always returned alongside per-token error information.
|
|
384
|
+
* Hook for fetching multiple confidential token balances in batch. Returns
|
|
385
|
+
* partial results when some tokens fail — successful balances are available
|
|
386
|
+
* alongside per-token error information.
|
|
427
387
|
*
|
|
428
388
|
* @param config - Token addresses configuration.
|
|
429
389
|
* @param options - React Query options forwarded to the balance query.
|
|
@@ -432,7 +392,8 @@ interface UseConfidentialBalancesOptions extends Omit<UseQueryOptions<BatchBalan
|
|
|
432
392
|
* @example
|
|
433
393
|
* ```tsx
|
|
434
394
|
* const { data } = useConfidentialBalances({
|
|
435
|
-
*
|
|
395
|
+
* addresses: ["0xTokenA", "0xTokenB"],
|
|
396
|
+
* account: "0xAccount",
|
|
436
397
|
* });
|
|
437
398
|
* const balance = data?.results.get("0xTokenA");
|
|
438
399
|
* if (data && data.errors.size > 0) {
|
|
@@ -440,11 +401,13 @@ interface UseConfidentialBalancesOptions extends Omit<UseQueryOptions<BatchBalan
|
|
|
440
401
|
* }
|
|
441
402
|
* ```
|
|
442
403
|
*/
|
|
443
|
-
declare function useConfidentialBalances(config: UseConfidentialBalancesConfig, options?: UseConfidentialBalancesOptions): _$_tanstack_react_query0.UseQueryResult<BatchBalancesResult
|
|
404
|
+
declare function useConfidentialBalances(config: UseConfidentialBalancesConfig, options?: UseConfidentialBalancesOptions): _$_tanstack_react_query0.UseQueryResult<BatchBalancesResult, Error>;
|
|
444
405
|
//#endregion
|
|
445
406
|
//#region src/transfer/use-confidential-transfer.d.ts
|
|
446
407
|
/** Configuration for {@link useConfidentialTransfer}. */
|
|
447
|
-
interface UseConfidentialTransferConfig
|
|
408
|
+
interface UseConfidentialTransferConfig {
|
|
409
|
+
/** Address of the confidential token contract. */
|
|
410
|
+
address: Address;
|
|
448
411
|
/**
|
|
449
412
|
* When `true`, optimistically subtracts the transfer amount from cached balance
|
|
450
413
|
* before the transaction confirms. Rolls back on error.
|
|
@@ -467,7 +430,7 @@ interface UseConfidentialTransferConfig extends UseZamaConfig {
|
|
|
467
430
|
* @example
|
|
468
431
|
* ```tsx
|
|
469
432
|
* const transfer = useConfidentialTransfer({
|
|
470
|
-
*
|
|
433
|
+
* address: "0xToken",
|
|
471
434
|
* optimistic: true,
|
|
472
435
|
* });
|
|
473
436
|
* transfer.mutate(
|
|
@@ -482,7 +445,7 @@ interface UseConfidentialTransferConfig extends UseZamaConfig {
|
|
|
482
445
|
* );
|
|
483
446
|
* ```
|
|
484
447
|
*/
|
|
485
|
-
declare function useConfidentialTransfer<TContext = unknown>(config: UseConfidentialTransferConfig, options?: UseMutationOptions<TransactionResult
|
|
448
|
+
declare function useConfidentialTransfer<TContext = unknown>(config: UseConfidentialTransferConfig, options?: UseMutationOptions<TransactionResult, Error, ConfidentialTransferParams, TContext>): UseMutationResult<TransactionResult, Error, ConfidentialTransferParams, TContext>;
|
|
486
449
|
//#endregion
|
|
487
450
|
//#region src/transfer/use-confidential-transfer-from.d.ts
|
|
488
451
|
/**
|
|
@@ -494,18 +457,18 @@ declare function useConfidentialTransfer<TContext = unknown>(config: UseConfiden
|
|
|
494
457
|
* - {@link EncryptionFailedError} — FHE encryption of the transfer amount failed
|
|
495
458
|
* - {@link TransactionRevertedError} — on-chain transaction reverted
|
|
496
459
|
*
|
|
497
|
-
* @param
|
|
460
|
+
* @param address - Address of the confidential token contract.
|
|
498
461
|
* @param options - React Query mutation options.
|
|
499
462
|
*
|
|
500
463
|
* @example
|
|
501
464
|
* ```tsx
|
|
502
|
-
* const transferFrom = useConfidentialTransferFrom(
|
|
465
|
+
* const transferFrom = useConfidentialTransferFrom("0xToken");
|
|
503
466
|
* transferFrom.mutate({ from: "0xOwner", to: "0xRecipient", amount: 500n });
|
|
504
467
|
* ```
|
|
505
468
|
*/
|
|
506
|
-
declare function useConfidentialTransferFrom(
|
|
469
|
+
declare function useConfidentialTransferFrom(address: Address, options?: UseMutationOptions<TransactionResult, Error, ConfidentialTransferFromParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ConfidentialTransferFromParams, `0x${string}`>;
|
|
507
470
|
//#endregion
|
|
508
|
-
//#region src/
|
|
471
|
+
//#region src/operator/use-confidential-set-operator.d.ts
|
|
509
472
|
/**
|
|
510
473
|
* Set operator approval for a confidential token. Defaults to 1 hour.
|
|
511
474
|
*
|
|
@@ -513,72 +476,71 @@ declare function useConfidentialTransferFrom(config: UseZamaConfig, options?: Us
|
|
|
513
476
|
* - {@link SigningRejectedError} — user rejected the wallet prompt
|
|
514
477
|
* - {@link TransactionRevertedError} — on-chain transaction reverted
|
|
515
478
|
*
|
|
516
|
-
* @param
|
|
479
|
+
* @param address - Address of the confidential token contract.
|
|
517
480
|
* @param options - React Query mutation options.
|
|
518
481
|
*
|
|
519
482
|
* @example
|
|
520
483
|
* ```tsx
|
|
521
|
-
* const
|
|
522
|
-
*
|
|
484
|
+
* const setOperator = useConfidentialSetOperator("0xToken");
|
|
485
|
+
* setOperator.mutate({ operator: "0xOperator" });
|
|
523
486
|
* ```
|
|
524
487
|
*/
|
|
525
|
-
declare function
|
|
488
|
+
declare function useConfidentialSetOperator(address: Address, options?: UseMutationOptions<TransactionResult, Error, ConfidentialSetOperatorParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ConfidentialSetOperatorParams, `0x${string}`>;
|
|
526
489
|
//#endregion
|
|
527
|
-
//#region src/
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
holder?: Address$1;
|
|
490
|
+
//#region src/operator/use-confidential-is-operator.d.ts
|
|
491
|
+
interface UseConfidentialIsOperatorConfig {
|
|
492
|
+
/** Address of the confidential token contract. The query is disabled while `undefined`. */
|
|
493
|
+
address: Address | undefined;
|
|
494
|
+
/** Address to check operator status for. The query is disabled while `undefined`. */
|
|
495
|
+
spender: Address | undefined;
|
|
496
|
+
/** Token holder address. The query is disabled while `undefined`. */
|
|
497
|
+
holder: Address | undefined;
|
|
536
498
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
holder
|
|
499
|
+
interface UseConfidentialIsOperatorSuspenseConfig {
|
|
500
|
+
/** Address of the confidential token contract. */
|
|
501
|
+
address: Address;
|
|
502
|
+
/** Address to check operator status for. */
|
|
503
|
+
spender: Address;
|
|
504
|
+
/** Token holder address. */
|
|
505
|
+
holder: Address;
|
|
543
506
|
}
|
|
544
507
|
/**
|
|
545
|
-
* Check if a spender is an approved operator for a
|
|
508
|
+
* Check if a spender is an approved operator for a holder.
|
|
546
509
|
*
|
|
547
|
-
* @param config - Token address, spender, and
|
|
510
|
+
* @param config - Token address, spender, and holder to check.
|
|
548
511
|
* @param options - React Query options (forwarded to `useQuery`).
|
|
549
512
|
* @returns Query result with `data: boolean`.
|
|
550
513
|
*
|
|
551
514
|
* @example
|
|
552
515
|
* ```tsx
|
|
553
|
-
* const { data:
|
|
554
|
-
*
|
|
516
|
+
* const { data: isOperator } = useConfidentialIsOperator({
|
|
517
|
+
* address: "0xToken",
|
|
555
518
|
* spender: "0xSpender",
|
|
556
|
-
* holder: "0xHolder",
|
|
519
|
+
* holder: "0xHolder",
|
|
557
520
|
* });
|
|
558
521
|
* ```
|
|
559
522
|
*/
|
|
560
|
-
declare function
|
|
523
|
+
declare function useConfidentialIsOperator(config: UseConfidentialIsOperatorConfig, options?: Omit<UseQueryOptions<boolean>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
561
524
|
/**
|
|
562
|
-
* Suspense variant of {@link
|
|
563
|
-
*
|
|
564
|
-
*
|
|
565
|
-
* @param config - Token address, spender, and optional holder to check.
|
|
566
|
-
* @returns Suspense query result with `data: boolean`.
|
|
525
|
+
* Suspense variant of {@link useConfidentialIsOperator}. Suspends rendering
|
|
526
|
+
* until the operator check resolves.
|
|
567
527
|
*
|
|
568
528
|
* @example
|
|
569
529
|
* ```tsx
|
|
570
|
-
* const { data:
|
|
571
|
-
*
|
|
530
|
+
* const { data: isOperator } = useConfidentialIsOperatorSuspense({
|
|
531
|
+
* address: "0xToken",
|
|
572
532
|
* spender: "0xSpender",
|
|
573
|
-
* holder: "0xHolder",
|
|
533
|
+
* holder: "0xHolder",
|
|
574
534
|
* });
|
|
575
535
|
* ```
|
|
576
536
|
*/
|
|
577
|
-
declare function
|
|
537
|
+
declare function useConfidentialIsOperatorSuspense(config: UseConfidentialIsOperatorSuspenseConfig): _$_tanstack_react_query0.UseSuspenseQueryResult<boolean, Error>;
|
|
578
538
|
//#endregion
|
|
579
539
|
//#region src/shield/use-shield.d.ts
|
|
580
540
|
/** Configuration for {@link useShield}. */
|
|
581
|
-
interface UseShieldConfig
|
|
541
|
+
interface UseShieldConfig {
|
|
542
|
+
/** Address of the confidential wrapper contract. */
|
|
543
|
+
address: Address;
|
|
582
544
|
/**
|
|
583
545
|
* When `true`, optimistically adds the wrap amount to the cached confidential balance
|
|
584
546
|
* before the transaction confirms. Rolls back on error.
|
|
@@ -592,20 +554,18 @@ interface UseShieldConfig extends UseZamaConfig {
|
|
|
592
554
|
*
|
|
593
555
|
* Errors are {@link ZamaError} subclasses — use `instanceof` to handle specific failures:
|
|
594
556
|
* - {@link SigningRejectedError} — user rejected the wallet prompt
|
|
595
|
-
* - {@link
|
|
596
|
-
* - {@link TransactionRevertedError} — shield transaction reverted
|
|
557
|
+
* - {@link TransactionRevertedError} — approval or shield transaction reverted
|
|
597
558
|
*
|
|
598
|
-
* @param config -
|
|
599
|
-
* Set `optimistic: true` to add the amount to the cached balance immediately.
|
|
559
|
+
* @param config - Wrapper address (and optional `optimistic` flag).
|
|
600
560
|
* @param options - React Query mutation options.
|
|
601
561
|
*
|
|
602
562
|
* @example
|
|
603
563
|
* ```tsx
|
|
604
|
-
* const shield = useShield({
|
|
564
|
+
* const shield = useShield({ address: "0xWrapper", optimistic: true });
|
|
605
565
|
* shield.mutate({ amount: 1000n });
|
|
606
566
|
* ```
|
|
607
567
|
*/
|
|
608
|
-
declare function useShield<TContext = unknown>(config: UseShieldConfig, options?: UseMutationOptions<TransactionResult
|
|
568
|
+
declare function useShield<TContext = unknown>(config: UseShieldConfig, options?: UseMutationOptions<TransactionResult, Error, ShieldParams, TContext>): UseMutationResult<TransactionResult, Error, ShieldParams, TContext>;
|
|
609
569
|
//#endregion
|
|
610
570
|
//#region src/unwrap/use-unwrap.d.ts
|
|
611
571
|
/**
|
|
@@ -618,16 +578,16 @@ declare function useShield<TContext = unknown>(config: UseShieldConfig, options?
|
|
|
618
578
|
* - {@link EncryptionFailedError} — FHE encryption of the unwrap amount failed
|
|
619
579
|
* - {@link TransactionRevertedError} — on-chain transaction reverted
|
|
620
580
|
*
|
|
621
|
-
* @param
|
|
581
|
+
* @param address - Address of the confidential wrapper contract.
|
|
622
582
|
* @param options - React Query mutation options.
|
|
623
583
|
*
|
|
624
584
|
* @example
|
|
625
585
|
* ```tsx
|
|
626
|
-
* const unwrap = useUnwrap(
|
|
586
|
+
* const unwrap = useUnwrap("0xWrapper");
|
|
627
587
|
* unwrap.mutate({ amount: 500n });
|
|
628
588
|
* ```
|
|
629
589
|
*/
|
|
630
|
-
declare function useUnwrap(
|
|
590
|
+
declare function useUnwrap(address: Address, options?: UseMutationOptions<TransactionResult, Error, UnwrapParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, UnwrapParams, `0x${string}`>;
|
|
631
591
|
//#endregion
|
|
632
592
|
//#region src/unwrap/use-unwrap-all.d.ts
|
|
633
593
|
/**
|
|
@@ -639,16 +599,16 @@ declare function useUnwrap(config: UseZamaConfig, options?: UseMutationOptions<T
|
|
|
639
599
|
* - {@link SigningRejectedError} — user rejected the wallet prompt
|
|
640
600
|
* - {@link TransactionRevertedError} — on-chain transaction reverted
|
|
641
601
|
*
|
|
642
|
-
* @param
|
|
602
|
+
* @param address - Address of the confidential wrapper contract.
|
|
643
603
|
* @param options - React Query mutation options.
|
|
644
604
|
*
|
|
645
605
|
* @example
|
|
646
606
|
* ```tsx
|
|
647
|
-
* const unwrapAll = useUnwrapAll(
|
|
607
|
+
* const unwrapAll = useUnwrapAll("0xWrapper");
|
|
648
608
|
* unwrapAll.mutate();
|
|
649
609
|
* ```
|
|
650
610
|
*/
|
|
651
|
-
declare function useUnwrapAll(
|
|
611
|
+
declare function useUnwrapAll(address: Address, options?: UseMutationOptions<TransactionResult, Error, void, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, void, `0x${string}`>;
|
|
652
612
|
//#endregion
|
|
653
613
|
//#region src/unwrap/use-finalize-unwrap.d.ts
|
|
654
614
|
/**
|
|
@@ -660,16 +620,22 @@ declare function useUnwrapAll(config: UseZamaConfig, options?: UseMutationOption
|
|
|
660
620
|
* - {@link DecryptionFailedError} — public decryption of the burn amount failed
|
|
661
621
|
* - {@link TransactionRevertedError} — on-chain finalize transaction reverted
|
|
662
622
|
*
|
|
663
|
-
* @param
|
|
623
|
+
* @param address - Address of the confidential wrapper contract.
|
|
664
624
|
* @param options - React Query mutation options.
|
|
665
625
|
*
|
|
666
626
|
* @example
|
|
667
627
|
* ```tsx
|
|
668
|
-
* const finalize = useFinalizeUnwrap(
|
|
669
|
-
*
|
|
628
|
+
* const finalize = useFinalizeUnwrap("0xWrapper");
|
|
629
|
+
* const event = findUnwrapRequested(receipt.logs);
|
|
630
|
+
* // Pass unwrapRequestId from upgraded events, or fall back to encryptedAmount for legacy ones.
|
|
631
|
+
* finalize.mutate(
|
|
632
|
+
* event.unwrapRequestId
|
|
633
|
+
* ? { unwrapRequestId: event.unwrapRequestId }
|
|
634
|
+
* : { burnAmountHandle: event.encryptedAmount },
|
|
635
|
+
* );
|
|
670
636
|
* ```
|
|
671
637
|
*/
|
|
672
|
-
declare function useFinalizeUnwrap(
|
|
638
|
+
declare function useFinalizeUnwrap(address: Address, options?: UseMutationOptions<TransactionResult, Error, FinalizeUnwrapParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, FinalizeUnwrapParams, `0x${string}`>;
|
|
673
639
|
//#endregion
|
|
674
640
|
//#region src/unshield/use-unshield.d.ts
|
|
675
641
|
/**
|
|
@@ -682,16 +648,16 @@ declare function useFinalizeUnwrap(config: UseZamaConfig, options?: UseMutationO
|
|
|
682
648
|
* - {@link DecryptionFailedError} — public decryption failed during finalize
|
|
683
649
|
* - {@link TransactionRevertedError} — on-chain transaction reverted
|
|
684
650
|
*
|
|
685
|
-
* @param
|
|
651
|
+
* @param address - Address of the confidential wrapper contract.
|
|
686
652
|
* @param options - React Query mutation options.
|
|
687
653
|
*
|
|
688
654
|
* @example
|
|
689
655
|
* ```tsx
|
|
690
|
-
* const unshield = useUnshield(
|
|
656
|
+
* const unshield = useUnshield("0xWrapper");
|
|
691
657
|
* unshield.mutate({ amount: 500n });
|
|
692
658
|
* ```
|
|
693
659
|
*/
|
|
694
|
-
declare function useUnshield(
|
|
660
|
+
declare function useUnshield(address: Address, options?: UseMutationOptions<TransactionResult, Error, UnshieldParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, UnshieldParams, `0x${string}`>;
|
|
695
661
|
//#endregion
|
|
696
662
|
//#region src/unshield/use-unshield-all.d.ts
|
|
697
663
|
/**
|
|
@@ -703,16 +669,16 @@ declare function useUnshield(config: UseZamaConfig, options?: UseMutationOptions
|
|
|
703
669
|
* - {@link DecryptionFailedError} — public decryption failed during finalize
|
|
704
670
|
* - {@link TransactionRevertedError} — on-chain transaction reverted
|
|
705
671
|
*
|
|
706
|
-
* @param
|
|
672
|
+
* @param address - Address of the confidential wrapper contract.
|
|
707
673
|
* @param options - React Query mutation options.
|
|
708
674
|
*
|
|
709
675
|
* @example
|
|
710
676
|
* ```tsx
|
|
711
|
-
* const unshieldAll = useUnshieldAll(
|
|
677
|
+
* const unshieldAll = useUnshieldAll("0xWrapper");
|
|
712
678
|
* unshieldAll.mutate();
|
|
713
679
|
* ```
|
|
714
680
|
*/
|
|
715
|
-
declare function useUnshieldAll(
|
|
681
|
+
declare function useUnshieldAll(address: Address, options?: UseMutationOptions<TransactionResult, Error, UnshieldAllParams | void, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, void | UnshieldAllParams, `0x${string}`>;
|
|
716
682
|
//#endregion
|
|
717
683
|
//#region src/unshield/use-resume-unshield.d.ts
|
|
718
684
|
/**
|
|
@@ -724,58 +690,56 @@ declare function useUnshieldAll(config: UseZamaConfig, options?: UseMutationOpti
|
|
|
724
690
|
* - {@link DecryptionFailedError} — public decryption failed during finalize
|
|
725
691
|
* - {@link TransactionRevertedError} — on-chain transaction reverted
|
|
726
692
|
*
|
|
727
|
-
* @param
|
|
693
|
+
* @param address - Address of the confidential wrapper contract.
|
|
728
694
|
* @param options - React Query mutation options.
|
|
729
695
|
*
|
|
730
696
|
* @example
|
|
731
697
|
* ```tsx
|
|
732
|
-
* const resumeUnshield = useResumeUnshield(
|
|
698
|
+
* const resumeUnshield = useResumeUnshield("0xWrapper");
|
|
733
699
|
* resumeUnshield.mutate({ unwrapTxHash: "0xabc..." });
|
|
734
700
|
* ```
|
|
735
701
|
*/
|
|
736
|
-
declare function useResumeUnshield(
|
|
702
|
+
declare function useResumeUnshield(address: Address, options?: UseMutationOptions<TransactionResult, Error, ResumeUnshieldParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ResumeUnshieldParams, `0x${string}`>;
|
|
737
703
|
//#endregion
|
|
738
704
|
//#region src/shield/use-underlying-allowance.d.ts
|
|
739
|
-
/** Configuration for {@link useUnderlyingAllowance}. */
|
|
740
705
|
interface UseUnderlyingAllowanceConfig {
|
|
741
|
-
/** Address of the confidential
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
|
|
706
|
+
/** Address of the confidential wrapper contract. */
|
|
707
|
+
address: Address;
|
|
708
|
+
/** Owner to fetch allowance for. The query is disabled while `undefined`. */
|
|
709
|
+
owner: Address | undefined;
|
|
710
|
+
}
|
|
711
|
+
interface UseUnderlyingAllowanceSuspenseConfig {
|
|
712
|
+
/** Address of the confidential wrapper contract. */
|
|
713
|
+
address: Address;
|
|
714
|
+
/** Owner to fetch allowance for. */
|
|
715
|
+
owner: Address;
|
|
745
716
|
}
|
|
746
717
|
/**
|
|
747
|
-
*
|
|
748
|
-
* Useful to check if an approval is needed before shielding.
|
|
749
|
-
*
|
|
750
|
-
* @param config - Token and wrapper addresses.
|
|
751
|
-
* @param options - React Query options (forwarded to `useQuery`).
|
|
752
|
-
* @returns Query result with `data: bigint` (current allowance).
|
|
718
|
+
* Hook for fetching the underlying ERC-20 allowance granted to the wrapper
|
|
719
|
+
* contract. Useful to check if an approval is needed before shielding.
|
|
753
720
|
*
|
|
754
721
|
* @example
|
|
755
722
|
* ```tsx
|
|
756
723
|
* const { data: allowance } = useUnderlyingAllowance({
|
|
757
|
-
*
|
|
758
|
-
*
|
|
724
|
+
* address: "0xWrapper",
|
|
725
|
+
* owner: "0xOwner",
|
|
759
726
|
* });
|
|
760
727
|
* ```
|
|
761
728
|
*/
|
|
762
729
|
declare function useUnderlyingAllowance(config: UseUnderlyingAllowanceConfig, options?: Omit<UseQueryOptions<bigint>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<bigint, Error>;
|
|
763
730
|
/**
|
|
764
|
-
* Suspense variant of {@link useUnderlyingAllowance}.
|
|
765
|
-
*
|
|
766
|
-
*
|
|
767
|
-
* @param config - Token and wrapper addresses.
|
|
768
|
-
* @returns Suspense query result with `data: bigint`.
|
|
731
|
+
* Suspense variant of {@link useUnderlyingAllowance}. Suspends rendering until
|
|
732
|
+
* the allowance resolves.
|
|
769
733
|
*
|
|
770
734
|
* @example
|
|
771
735
|
* ```tsx
|
|
772
736
|
* const { data: allowance } = useUnderlyingAllowanceSuspense({
|
|
773
|
-
*
|
|
774
|
-
*
|
|
737
|
+
* address: "0xWrapper",
|
|
738
|
+
* owner: "0xOwner",
|
|
775
739
|
* });
|
|
776
740
|
* ```
|
|
777
741
|
*/
|
|
778
|
-
declare function useUnderlyingAllowanceSuspense(config:
|
|
742
|
+
declare function useUnderlyingAllowanceSuspense(config: UseUnderlyingAllowanceSuspenseConfig): _$_tanstack_react_query0.UseSuspenseQueryResult<bigint, Error>;
|
|
779
743
|
//#endregion
|
|
780
744
|
//#region src/token/use-wrapper-discovery.d.ts
|
|
781
745
|
/** Configuration for {@link useWrapperDiscovery}. */
|
|
@@ -785,9 +749,9 @@ interface UseWrapperDiscoveryConfig {
|
|
|
785
749
|
* Used only to derive the signer context and to scope the query cache key —
|
|
786
750
|
* it does not affect which wrapper the registry returns.
|
|
787
751
|
*/
|
|
788
|
-
tokenAddress: Address
|
|
752
|
+
tokenAddress: Address;
|
|
789
753
|
/** ERC-20 address to discover the wrapper for. Pass `undefined` to disable the query. */
|
|
790
|
-
erc20Address: Address
|
|
754
|
+
erc20Address: Address | undefined;
|
|
791
755
|
}
|
|
792
756
|
/** Configuration for {@link useWrapperDiscoverySuspense}. */
|
|
793
757
|
interface UseWrapperDiscoverySuspenseConfig {
|
|
@@ -796,9 +760,9 @@ interface UseWrapperDiscoverySuspenseConfig {
|
|
|
796
760
|
* Used only to derive the signer context and to scope the query cache key —
|
|
797
761
|
* it does not affect which wrapper the registry returns.
|
|
798
762
|
*/
|
|
799
|
-
tokenAddress: Address
|
|
763
|
+
tokenAddress: Address;
|
|
800
764
|
/** ERC-20 address to discover the wrapper for. */
|
|
801
|
-
erc20Address: Address
|
|
765
|
+
erc20Address: Address;
|
|
802
766
|
}
|
|
803
767
|
/**
|
|
804
768
|
* Discover the confidential wrapper for an ERC-20 token via the on-chain registry.
|
|
@@ -817,7 +781,7 @@ interface UseWrapperDiscoverySuspenseConfig {
|
|
|
817
781
|
* });
|
|
818
782
|
* ```
|
|
819
783
|
*/
|
|
820
|
-
declare function useWrapperDiscovery(config: UseWrapperDiscoveryConfig, options?: Omit<UseQueryOptions<Address
|
|
784
|
+
declare function useWrapperDiscovery(config: UseWrapperDiscoveryConfig, options?: Omit<UseQueryOptions<Address | null>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<`0x${string}` | null, Error>;
|
|
821
785
|
/**
|
|
822
786
|
* Suspense variant of {@link useWrapperDiscovery}.
|
|
823
787
|
* Suspends rendering until the wrapper address is resolved.
|
|
@@ -850,7 +814,7 @@ declare function useWrapperDiscoverySuspense(config: UseWrapperDiscoverySuspense
|
|
|
850
814
|
* // metadata?.name, metadata?.symbol, metadata?.decimals
|
|
851
815
|
* ```
|
|
852
816
|
*/
|
|
853
|
-
declare function useMetadata(tokenAddress: Address
|
|
817
|
+
declare function useMetadata(tokenAddress: Address, options?: Omit<UseQueryOptions<TokenMetadata>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<TokenMetadata, Error>;
|
|
854
818
|
/**
|
|
855
819
|
* Suspense variant of {@link useMetadata}.
|
|
856
820
|
* Suspends rendering until metadata is loaded.
|
|
@@ -863,71 +827,72 @@ declare function useMetadata(tokenAddress: Address$1, options?: Omit<UseQueryOpt
|
|
|
863
827
|
* const { data: metadata } = useMetadataSuspense("0xToken");
|
|
864
828
|
* ```
|
|
865
829
|
*/
|
|
866
|
-
declare function useMetadataSuspense(tokenAddress: Address
|
|
830
|
+
declare function useMetadataSuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<TokenMetadata, Error>;
|
|
867
831
|
//#endregion
|
|
868
|
-
//#region src/
|
|
832
|
+
//#region src/delegations/use-delegate-decryption.d.ts
|
|
869
833
|
/**
|
|
870
|
-
* Delegate FHE decryption rights for a
|
|
834
|
+
* Delegate FHE decryption rights for a confidential contract to another address
|
|
835
|
+
* via the on-chain ACL.
|
|
871
836
|
*
|
|
872
|
-
* @param
|
|
837
|
+
* @param address - Confidential contract address to delegate on.
|
|
873
838
|
* @param options - React Query mutation options.
|
|
874
839
|
*
|
|
875
840
|
* @example
|
|
876
841
|
* ```tsx
|
|
877
|
-
* const delegate = useDelegateDecryption(
|
|
842
|
+
* const delegate = useDelegateDecryption("0xToken");
|
|
878
843
|
* delegate.mutate({ delegateAddress: "0xDelegate" });
|
|
879
844
|
* ```
|
|
880
845
|
*/
|
|
881
|
-
declare function useDelegateDecryption(
|
|
846
|
+
declare function useDelegateDecryption(address: Address, options?: UseMutationOptions<TransactionResult, Error, DelegateDecryptionParams>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, DelegateDecryptionParams, unknown>;
|
|
882
847
|
//#endregion
|
|
883
|
-
//#region src/
|
|
848
|
+
//#region src/delegations/use-revoke-delegation.d.ts
|
|
884
849
|
/**
|
|
885
|
-
* Revoke FHE decryption delegation for a
|
|
850
|
+
* Revoke FHE decryption delegation for a confidential contract from a delegate address.
|
|
886
851
|
*
|
|
887
|
-
* @param
|
|
852
|
+
* @param address - Confidential contract address to revoke delegation on.
|
|
888
853
|
* @param options - React Query mutation options.
|
|
889
854
|
*
|
|
890
855
|
* @example
|
|
891
856
|
* ```tsx
|
|
892
|
-
* const revoke = useRevokeDelegation(
|
|
857
|
+
* const revoke = useRevokeDelegation("0xToken");
|
|
893
858
|
* revoke.mutate({ delegateAddress: "0xDelegate" });
|
|
894
859
|
* ```
|
|
895
860
|
*/
|
|
896
|
-
declare function useRevokeDelegation(
|
|
861
|
+
declare function useRevokeDelegation(address: Address, options?: UseMutationOptions<TransactionResult, Error, RevokeDelegationParams>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, RevokeDelegationParams, unknown>;
|
|
897
862
|
//#endregion
|
|
898
|
-
//#region src/
|
|
863
|
+
//#region src/delegations/use-delegation-status.d.ts
|
|
899
864
|
interface UseDelegationStatusConfig {
|
|
900
|
-
/** Address of the confidential
|
|
901
|
-
|
|
865
|
+
/** Address of the confidential contract. Pass `undefined` to disable the query. */
|
|
866
|
+
contractAddress: Address | undefined;
|
|
902
867
|
/** The address that granted the delegation. */
|
|
903
|
-
delegatorAddress?: Address
|
|
868
|
+
delegatorAddress?: Address;
|
|
904
869
|
/** The address that received delegation rights. */
|
|
905
|
-
delegateAddress?: Address
|
|
870
|
+
delegateAddress?: Address;
|
|
906
871
|
}
|
|
907
872
|
/**
|
|
908
873
|
* Query delegation status between a delegator and delegate for a token.
|
|
909
874
|
*
|
|
910
875
|
* @param config - Token address, delegator, and delegate addresses.
|
|
911
876
|
* @param options - React Query options (forwarded to `useQuery`).
|
|
912
|
-
* @returns `{
|
|
877
|
+
* @returns `{ isActive, expiryTimestamp, isLoading, error }`.
|
|
913
878
|
*
|
|
914
879
|
* @example
|
|
915
880
|
* ```tsx
|
|
916
881
|
* const { data } = useDelegationStatus({
|
|
917
|
-
*
|
|
882
|
+
* contractAddress: "0xToken",
|
|
918
883
|
* delegatorAddress: "0xDelegator",
|
|
919
884
|
* delegateAddress: "0xDelegate",
|
|
920
885
|
* });
|
|
921
|
-
* // data?.
|
|
886
|
+
* // data?.isActive, data?.expiryTimestamp
|
|
922
887
|
* ```
|
|
923
888
|
*/
|
|
924
|
-
declare function useDelegationStatus(config: UseDelegationStatusConfig, options?: Omit<UseQueryOptions<DelegationStatusData
|
|
889
|
+
declare function useDelegationStatus(config: UseDelegationStatusConfig, options?: Omit<UseQueryOptions<DelegationStatusData>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<DelegationStatusData, Error>;
|
|
925
890
|
//#endregion
|
|
926
|
-
//#region src/
|
|
891
|
+
//#region src/delegations/use-decrypt-balance-as.d.ts
|
|
927
892
|
/**
|
|
928
893
|
* Decrypt another user's confidential balance as a delegate.
|
|
929
894
|
*
|
|
930
|
-
* @param
|
|
895
|
+
* @param address - Address of the confidential token contract.
|
|
931
896
|
* @param options - React Query mutation options.
|
|
932
897
|
*
|
|
933
898
|
* @example
|
|
@@ -937,13 +902,13 @@ declare function useDelegationStatus(config: UseDelegationStatusConfig, options?
|
|
|
937
902
|
* // decryptAs.data => 1000n
|
|
938
903
|
* ```
|
|
939
904
|
*/
|
|
940
|
-
declare function useDecryptBalanceAs(
|
|
905
|
+
declare function useDecryptBalanceAs(address: Address, options?: UseMutationOptions<bigint, Error, DecryptBalanceAsParams>): _$_tanstack_react_query0.UseMutationResult<bigint, Error, DecryptBalanceAsParams, unknown>;
|
|
941
906
|
//#endregion
|
|
942
|
-
//#region src/
|
|
907
|
+
//#region src/delegations/use-batch-decrypt-balances-as.d.ts
|
|
943
908
|
/**
|
|
944
909
|
* Batch decrypt confidential balances as a delegate across multiple tokens.
|
|
945
910
|
*
|
|
946
|
-
* @param tokens -
|
|
911
|
+
* @param tokens - {@link Token} instances to decrypt balances for.
|
|
947
912
|
* @param options - React Query mutation options.
|
|
948
913
|
*
|
|
949
914
|
* @example
|
|
@@ -955,7 +920,7 @@ declare function useDecryptBalanceAs(tokenAddress: Address$1, options?: UseMutat
|
|
|
955
920
|
* // batchDecryptAs.data => Map { "0xTokenA" => 100n, "0xTokenB" => 200n }
|
|
956
921
|
* ```
|
|
957
922
|
*/
|
|
958
|
-
declare function useBatchDecryptBalancesAs(tokens:
|
|
923
|
+
declare function useBatchDecryptBalancesAs(tokens: Token[], options?: UseMutationOptions<Map<Address, bigint>, Error, BatchDecryptBalancesAsParams>): _$_tanstack_react_query0.UseMutationResult<Map<`0x${string}`, bigint>, Error, _$_zama_fhe_sdk0.BatchDecryptAsOptions, unknown>;
|
|
959
924
|
//#endregion
|
|
960
925
|
//#region src/shield/use-approve-underlying.d.ts
|
|
961
926
|
/**
|
|
@@ -967,17 +932,17 @@ declare function useBatchDecryptBalancesAs(tokens: ReadonlyToken$1[], options?:
|
|
|
967
932
|
* - {@link SigningRejectedError} — user rejected the wallet prompt
|
|
968
933
|
* - {@link TransactionRevertedError} — approval transaction reverted
|
|
969
934
|
*
|
|
970
|
-
* @param
|
|
935
|
+
* @param address - Address of the confidential wrapper contract.
|
|
971
936
|
* @param options - React Query mutation options.
|
|
972
937
|
*
|
|
973
938
|
* @example
|
|
974
939
|
* ```tsx
|
|
975
|
-
* const approve = useApproveUnderlying(
|
|
940
|
+
* const approve = useApproveUnderlying("0xWrapper");
|
|
976
941
|
* approve.mutate({}); // max approval
|
|
977
942
|
* approve.mutate({ amount: 1000n }); // exact amount
|
|
978
943
|
* ```
|
|
979
944
|
*/
|
|
980
|
-
declare function useApproveUnderlying(
|
|
945
|
+
declare function useApproveUnderlying(address: Address, options?: UseMutationOptions<TransactionResult, Error, ApproveUnderlyingParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ApproveUnderlyingParams, `0x${string}`>;
|
|
981
946
|
//#endregion
|
|
982
947
|
//#region src/token/use-is-confidential.d.ts
|
|
983
948
|
/**
|
|
@@ -993,7 +958,7 @@ declare function useApproveUnderlying(config: UseZamaConfig, options?: UseMutati
|
|
|
993
958
|
* const { data: isConfidential } = useIsConfidential("0xToken");
|
|
994
959
|
* ```
|
|
995
960
|
*/
|
|
996
|
-
declare function useIsConfidential(tokenAddress: Address
|
|
961
|
+
declare function useIsConfidential(tokenAddress: Address, options?: Omit<UseQueryOptions<boolean>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
997
962
|
/**
|
|
998
963
|
* Suspense variant of {@link useIsConfidential}.
|
|
999
964
|
* Suspends rendering until the ERC-165 check resolves.
|
|
@@ -1006,7 +971,7 @@ declare function useIsConfidential(tokenAddress: Address$1, options?: Omit<UseQu
|
|
|
1006
971
|
* const { data: isConfidential } = useIsConfidentialSuspense("0xToken");
|
|
1007
972
|
* ```
|
|
1008
973
|
*/
|
|
1009
|
-
declare function useIsConfidentialSuspense(tokenAddress: Address
|
|
974
|
+
declare function useIsConfidentialSuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<boolean, Error>;
|
|
1010
975
|
/**
|
|
1011
976
|
* Check if a token supports the ERC-7984 wrapper interface via ERC-165.
|
|
1012
977
|
* Result is cached indefinitely since interface support does not change.
|
|
@@ -1020,7 +985,7 @@ declare function useIsConfidentialSuspense(tokenAddress: Address$1): _$_tanstack
|
|
|
1020
985
|
* const { data: isWrapper } = useIsWrapper("0xToken");
|
|
1021
986
|
* ```
|
|
1022
987
|
*/
|
|
1023
|
-
declare function useIsWrapper(tokenAddress: Address
|
|
988
|
+
declare function useIsWrapper(tokenAddress: Address, options?: Omit<UseQueryOptions<boolean>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
1024
989
|
/**
|
|
1025
990
|
* Suspense variant of {@link useIsWrapper}.
|
|
1026
991
|
* Suspends rendering until the ERC-165 check resolves.
|
|
@@ -1033,7 +998,7 @@ declare function useIsWrapper(tokenAddress: Address$1, options?: Omit<UseQueryOp
|
|
|
1033
998
|
* const { data: isWrapper } = useIsWrapperSuspense("0xToken");
|
|
1034
999
|
* ```
|
|
1035
1000
|
*/
|
|
1036
|
-
declare function useIsWrapperSuspense(tokenAddress: Address
|
|
1001
|
+
declare function useIsWrapperSuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<boolean, Error>;
|
|
1037
1002
|
//#endregion
|
|
1038
1003
|
//#region src/token/use-total-supply.d.ts
|
|
1039
1004
|
/**
|
|
@@ -1043,32 +1008,35 @@ declare function useIsWrapperSuspense(tokenAddress: Address$1): _$_tanstack_reac
|
|
|
1043
1008
|
* @param tokenAddress - Address of the token contract.
|
|
1044
1009
|
* @param options - React Query options (forwarded to `useQuery`).
|
|
1045
1010
|
* @returns Query result with `data: bigint`.
|
|
1011
|
+
* Uses ERC-165 to call `inferredTotalSupply()` on upgraded wrappers and
|
|
1012
|
+
* legacy `totalSupply()` on pre-upgrade wrappers.
|
|
1046
1013
|
*
|
|
1047
1014
|
* @example
|
|
1048
1015
|
* ```tsx
|
|
1049
1016
|
* const { data: totalSupply } = useTotalSupply("0xToken");
|
|
1050
1017
|
* ```
|
|
1051
1018
|
*/
|
|
1052
|
-
declare function useTotalSupply(tokenAddress: Address
|
|
1019
|
+
declare function useTotalSupply(tokenAddress: Address, options?: Omit<UseQueryOptions<bigint>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<bigint, Error>;
|
|
1053
1020
|
/**
|
|
1054
1021
|
* Suspense variant of {@link useTotalSupply}.
|
|
1055
1022
|
* Suspends rendering until the total supply is loaded.
|
|
1056
1023
|
*
|
|
1057
1024
|
* @param tokenAddress - Address of the token contract.
|
|
1058
1025
|
* @returns Suspense query result with `data: bigint`.
|
|
1026
|
+
* Uses ERC-165 to call `inferredTotalSupply()` on upgraded wrappers and
|
|
1027
|
+
* legacy `totalSupply()` on pre-upgrade wrappers.
|
|
1059
1028
|
*
|
|
1060
1029
|
* @example
|
|
1061
1030
|
* ```tsx
|
|
1062
1031
|
* const { data: totalSupply } = useTotalSupplySuspense("0xToken");
|
|
1063
1032
|
* ```
|
|
1064
1033
|
*/
|
|
1065
|
-
declare function useTotalSupplySuspense(tokenAddress: Address
|
|
1034
|
+
declare function useTotalSupplySuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<bigint, Error>;
|
|
1066
1035
|
//#endregion
|
|
1067
1036
|
//#region src/wrappers-registry/use-wrappers-registry-address.d.ts
|
|
1068
1037
|
/**
|
|
1069
1038
|
* Resolves the wrappers registry address for the current chain.
|
|
1070
|
-
* Uses the
|
|
1071
|
-
* plus any `registryAddresses` overrides passed to `ZamaSDKConfig`).
|
|
1039
|
+
* Uses the registry addresses from `sdk.registry` (built-in defaults from chain configs).
|
|
1072
1040
|
*
|
|
1073
1041
|
* Returns `undefined` when the chain ID hasn't been fetched yet
|
|
1074
1042
|
* or when no registry is configured for the connected chain.
|
|
@@ -1076,14 +1044,14 @@ declare function useTotalSupplySuspense(tokenAddress: Address$1): _$_tanstack_re
|
|
|
1076
1044
|
* The chain ID is cached for 30 seconds (`staleTime`), so chain
|
|
1077
1045
|
* switches may take up to 30s to reflect.
|
|
1078
1046
|
*/
|
|
1079
|
-
declare function useWrappersRegistryAddress(): Address
|
|
1047
|
+
declare function useWrappersRegistryAddress(): Address | undefined;
|
|
1080
1048
|
//#endregion
|
|
1081
1049
|
//#region src/wrappers-registry/use-token-pairs-registry.d.ts
|
|
1082
1050
|
/**
|
|
1083
1051
|
* Fetches all token wrapper pairs from the ConfidentialTokenWrappersRegistry
|
|
1084
1052
|
* contract on the current chain.
|
|
1085
1053
|
*/
|
|
1086
|
-
declare function useTokenPairsRegistry(): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair
|
|
1054
|
+
declare function useTokenPairsRegistry(): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair[], Error>;
|
|
1087
1055
|
//#endregion
|
|
1088
1056
|
//#region src/wrappers-registry/use-token-pairs-length.d.ts
|
|
1089
1057
|
/**
|
|
@@ -1104,7 +1072,7 @@ declare function useTokenPairsSlice({
|
|
|
1104
1072
|
}: {
|
|
1105
1073
|
fromIndex: bigint | undefined;
|
|
1106
1074
|
toIndex: bigint | undefined;
|
|
1107
|
-
}): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair
|
|
1075
|
+
}): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair[], Error>;
|
|
1108
1076
|
//#endregion
|
|
1109
1077
|
//#region src/wrappers-registry/use-token-pair.d.ts
|
|
1110
1078
|
/**
|
|
@@ -1116,7 +1084,7 @@ declare function useTokenPair({
|
|
|
1116
1084
|
index
|
|
1117
1085
|
}: {
|
|
1118
1086
|
index: bigint | undefined;
|
|
1119
|
-
}): _$_tanstack_react_query0.UseQueryResult<TokenWrapperPair
|
|
1087
|
+
}): _$_tanstack_react_query0.UseQueryResult<TokenWrapperPair, Error>;
|
|
1120
1088
|
//#endregion
|
|
1121
1089
|
//#region src/wrappers-registry/use-confidential-token-address.d.ts
|
|
1122
1090
|
/**
|
|
@@ -1125,7 +1093,7 @@ declare function useTokenPair({
|
|
|
1125
1093
|
declare function useConfidentialTokenAddress({
|
|
1126
1094
|
tokenAddress
|
|
1127
1095
|
}: {
|
|
1128
|
-
tokenAddress: Address
|
|
1096
|
+
tokenAddress: Address | undefined;
|
|
1129
1097
|
}): _$_tanstack_react_query0.UseQueryResult<readonly [boolean, `0x${string}`], Error>;
|
|
1130
1098
|
//#endregion
|
|
1131
1099
|
//#region src/wrappers-registry/use-token-address.d.ts
|
|
@@ -1135,7 +1103,7 @@ declare function useConfidentialTokenAddress({
|
|
|
1135
1103
|
declare function useTokenAddress({
|
|
1136
1104
|
confidentialTokenAddress
|
|
1137
1105
|
}: {
|
|
1138
|
-
confidentialTokenAddress: Address
|
|
1106
|
+
confidentialTokenAddress: Address | undefined;
|
|
1139
1107
|
}): _$_tanstack_react_query0.UseQueryResult<readonly [boolean, `0x${string}`], Error>;
|
|
1140
1108
|
//#endregion
|
|
1141
1109
|
//#region src/wrappers-registry/use-is-confidential-token-valid.d.ts
|
|
@@ -1148,7 +1116,7 @@ declare function useTokenAddress({
|
|
|
1148
1116
|
declare function useIsConfidentialTokenValid({
|
|
1149
1117
|
confidentialTokenAddress
|
|
1150
1118
|
}: {
|
|
1151
|
-
confidentialTokenAddress: Address
|
|
1119
|
+
confidentialTokenAddress: Address | undefined;
|
|
1152
1120
|
}): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
1153
1121
|
//#endregion
|
|
1154
1122
|
//#region src/wrappers-registry/use-list-pairs.d.ts
|
|
@@ -1173,15 +1141,7 @@ declare function useListPairs({
|
|
|
1173
1141
|
page?: number;
|
|
1174
1142
|
pageSize?: number;
|
|
1175
1143
|
metadata?: boolean;
|
|
1176
|
-
}): _$_tanstack_react_query0.UseQueryResult<PaginatedResult
|
|
1177
|
-
//#endregion
|
|
1178
|
-
//#region src/balance/optimistic-balance-update.d.ts
|
|
1179
|
-
type OptimisticBalanceSnapshot = [QueryKey, bigint | undefined][];
|
|
1180
|
-
/** Combined context returned by optimistic `onMutate`. */
|
|
1181
|
-
interface OptimisticMutateContext {
|
|
1182
|
-
snapshot: OptimisticBalanceSnapshot;
|
|
1183
|
-
callerContext?: unknown;
|
|
1184
|
-
}
|
|
1144
|
+
}): _$_tanstack_react_query0.UseQueryResult<PaginatedResult<TokenWrapperPair | TokenWrapperPairWithMetadata>, Error>;
|
|
1185
1145
|
//#endregion
|
|
1186
|
-
export {
|
|
1146
|
+
export { type UseConfidentialBalanceConfig, type UseConfidentialBalanceOptions, type UseConfidentialBalancesConfig, type UseConfidentialBalancesOptions, type UseConfidentialIsOperatorConfig, type UseConfidentialIsOperatorSuspenseConfig, type UseConfidentialTransferConfig, type UseDelegationStatusConfig, type UseHasPermitConfig, type UseShieldConfig, type UseUnderlyingAllowanceConfig, type UseUnderlyingAllowanceSuspenseConfig, type UseUserDecryptResult, type UseWrapperDiscoveryConfig, type UseWrapperDiscoverySuspenseConfig, ZamaProvider, type ZamaProviderProps, useApproveUnderlying, useBatchDecryptBalancesAs, useClearCredentials, useConfidentialBalance, useConfidentialBalances, useConfidentialIsOperator, useConfidentialIsOperatorSuspense, useConfidentialSetOperator, useConfidentialTokenAddress, useConfidentialTransfer, useConfidentialTransferFrom, useCreateDelegatedUserDecryptEIP712, useCreateEIP712, useDecryptBalanceAs, useDelegateDecryption, useDelegatedDecrypt, useDelegationStatus, useEncrypt, useFinalizeUnwrap, useGenerateKeypair, useGrantPermit, useHasPermit, useIsConfidential, useIsConfidentialSuspense, useIsConfidentialTokenValid, useIsWrapper, useIsWrapperSuspense, useListPairs, useMetadata, useMetadataSuspense, usePublicDecrypt, usePublicKey, usePublicParams, useRequestZKProofVerification, useResumeUnshield, useRevokeDelegation, useRevokePermits, useShield, useToken, useTokenAddress, useTokenPair, useTokenPairsLength, useTokenPairsRegistry, useTokenPairsSlice, useTotalSupply, useTotalSupplySuspense, useUnderlyingAllowance, useUnderlyingAllowanceSuspense, useUnshield, useUnshieldAll, useUnwrap, useUnwrapAll, useUserDecrypt, useWrappedToken, useWrapperDiscovery, useWrapperDiscoverySuspense, useWrappersRegistryAddress, useZamaSDK };
|
|
1187
1147
|
//# sourceMappingURL=index.d.ts.map
|