@zama-fhe/react-sdk 3.0.0-alpha.3 → 3.0.0-alpha.30
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 +89 -883
- package/dist/index.d.ts +165 -212
- 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 +3 -3
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, ReadonlyToken, Token, TokenWrapperPair, TokenWrapperPairWithMetadata, TransactionResult, ZKProofLike, ZamaConfig, ZamaSDK } from "@zama-fhe/sdk";
|
|
5
|
+
import { ApproveUnderlyingParams, BatchDecryptBalancesAsParams, ConfidentialSetOperatorParams, ConfidentialTransferFromParams, ConfidentialTransferParams, CreateDelegatedUserDecryptEIP712Params, CreateEIP712Params, DecryptBalanceAsParams, DecryptResult, DelegateDecryptionParams, DelegatedUserDecryptMutationParams, 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...", "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
|
/**
|
|
@@ -98,14 +57,17 @@ declare function useZamaSDK(): ZamaSDK$1;
|
|
|
98
57
|
* encrypt.mutate({ values: [{ value: 1000n, type: "euint64" }], contractAddress: "0x...", userAddress: "0x..." });
|
|
99
58
|
* ```
|
|
100
59
|
*/
|
|
101
|
-
declare function useEncrypt(): _$_tanstack_react_query0.UseMutationResult<
|
|
60
|
+
declare function useEncrypt(): _$_tanstack_react_query0.UseMutationResult<Readonly<{
|
|
61
|
+
handles: Uint8Array[];
|
|
62
|
+
inputProof: Uint8Array;
|
|
63
|
+
}>, Error, EncryptParams, unknown>;
|
|
102
64
|
//#endregion
|
|
103
65
|
//#region src/relayer/use-user-decrypt.d.ts
|
|
104
66
|
/**
|
|
105
67
|
* React hook for FHE user decryption. Thin wrapper around
|
|
106
68
|
* `userDecryptQueryOptions` with `useQuery` semantics.
|
|
107
69
|
*/
|
|
108
|
-
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>;
|
|
109
71
|
/** Return type of {@link useUserDecrypt}. */
|
|
110
72
|
type UseUserDecryptResult = ReturnType<typeof useUserDecrypt>;
|
|
111
73
|
//#endregion
|
|
@@ -124,7 +86,11 @@ type UseUserDecryptResult = ReturnType<typeof useUserDecrypt>;
|
|
|
124
86
|
* // publicDecrypt.data?.clearValues => { "0xHandle1": 500n, ... }
|
|
125
87
|
* ```
|
|
126
88
|
*/
|
|
127
|
-
declare function usePublicDecrypt(): _$_tanstack_react_query0.UseMutationResult<
|
|
89
|
+
declare function usePublicDecrypt(): _$_tanstack_react_query0.UseMutationResult<Readonly<{
|
|
90
|
+
clearValues: _$_zama_fhe_relayer_sdk_web0.ClearValues;
|
|
91
|
+
abiEncodedClearValues: `0x${string}`;
|
|
92
|
+
decryptionProof: `0x${string}`;
|
|
93
|
+
}>, Error, `0x${string}`[], unknown>;
|
|
128
94
|
//#endregion
|
|
129
95
|
//#region src/relayer/use-generate-keypair.d.ts
|
|
130
96
|
/**
|
|
@@ -162,7 +128,7 @@ declare function useGenerateKeypair(): _$_tanstack_react_query0.UseMutationResul
|
|
|
162
128
|
* });
|
|
163
129
|
* ```
|
|
164
130
|
*/
|
|
165
|
-
declare function useCreateEIP712(): _$_tanstack_react_query0.UseMutationResult<EIP712TypedData
|
|
131
|
+
declare function useCreateEIP712(): _$_tanstack_react_query0.UseMutationResult<EIP712TypedData, Error, CreateEIP712Params, unknown>;
|
|
166
132
|
//#endregion
|
|
167
133
|
//#region src/relayer/use-create-delegated-user-decrypt-eip712.d.ts
|
|
168
134
|
/**
|
|
@@ -194,16 +160,16 @@ declare function useCreateDelegatedUserDecryptEIP712(): _$_tanstack_react_query0
|
|
|
194
160
|
* Decrypt FHE ciphertext handles using delegated user credentials.
|
|
195
161
|
* Returns a map of handle → plaintext bigint.
|
|
196
162
|
*
|
|
197
|
-
* @returns A mutation whose `mutate` accepts {@link
|
|
163
|
+
* @returns A mutation whose `mutate` accepts {@link DelegatedUserDecryptMutationParams}.
|
|
198
164
|
*
|
|
199
165
|
* @example
|
|
200
166
|
* ```tsx
|
|
201
167
|
* const decrypt = useDelegatedUserDecrypt();
|
|
202
|
-
* decrypt.mutate({ handles: ["0xHandle1"], ...
|
|
168
|
+
* decrypt.mutate({ handles: [{ handle: "0xHandle1", contractAddress: "0x..." }], delegatorAddress: "0x..." });
|
|
203
169
|
* // decrypt.data => { "0xHandle1": 1000n }
|
|
204
170
|
* ```
|
|
205
171
|
*/
|
|
206
|
-
declare function useDelegatedUserDecrypt(): _$_tanstack_react_query0.UseMutationResult<Record<`0x${string}`, ClearValueType
|
|
172
|
+
declare function useDelegatedUserDecrypt(): _$_tanstack_react_query0.UseMutationResult<Record<`0x${string}`, ClearValueType>, Error, DelegatedUserDecryptMutationParams, unknown>;
|
|
207
173
|
//#endregion
|
|
208
174
|
//#region src/relayer/use-request-zk-proof-verification.d.ts
|
|
209
175
|
/**
|
|
@@ -222,16 +188,9 @@ declare function useDelegatedUserDecrypt(): _$_tanstack_react_query0.UseMutation
|
|
|
222
188
|
declare function useRequestZKProofVerification(): _$_tanstack_react_query0.UseMutationResult<Readonly<{
|
|
223
189
|
handles: Uint8Array[];
|
|
224
190
|
inputProof: Uint8Array;
|
|
225
|
-
}>, Error, ZKProofLike
|
|
191
|
+
}>, Error, ZKProofLike, unknown>;
|
|
226
192
|
//#endregion
|
|
227
193
|
//#region src/relayer/use-public-key.d.ts
|
|
228
|
-
/** Shape of the FHE public key data returned by the relayer. */
|
|
229
|
-
interface PublicKeyData {
|
|
230
|
-
/** Unique identifier for this public key version. */
|
|
231
|
-
publicKeyId: string;
|
|
232
|
-
/** The raw FHE public key bytes. */
|
|
233
|
-
publicKey: Uint8Array;
|
|
234
|
-
}
|
|
235
194
|
/**
|
|
236
195
|
* Fetch the FHE network public key from the relayer.
|
|
237
196
|
* Cached indefinitely since the key does not change during a session.
|
|
@@ -247,13 +206,6 @@ interface PublicKeyData {
|
|
|
247
206
|
declare function usePublicKey(): _$_tanstack_react_query0.UseQueryResult<PublicKeyData | null, Error>;
|
|
248
207
|
//#endregion
|
|
249
208
|
//#region src/relayer/use-public-params.d.ts
|
|
250
|
-
/** Shape of the FHE public parameters returned by the relayer. */
|
|
251
|
-
interface PublicParamsData {
|
|
252
|
-
/** The raw public parameters bytes (WASM-ready). */
|
|
253
|
-
publicParams: Uint8Array;
|
|
254
|
-
/** Unique identifier for this public params version. */
|
|
255
|
-
publicParamsId: string;
|
|
256
|
-
}
|
|
257
209
|
/**
|
|
258
210
|
* Fetch FHE public parameters for a given bit size from the relayer.
|
|
259
211
|
* Cached indefinitely since parameters do not change during a session.
|
|
@@ -267,7 +219,10 @@ interface PublicParamsData {
|
|
|
267
219
|
* // params?.publicParams, params?.publicParamsId
|
|
268
220
|
* ```
|
|
269
221
|
*/
|
|
270
|
-
declare function usePublicParams(bits: number): _$_tanstack_react_query0.UseQueryResult<
|
|
222
|
+
declare function usePublicParams(bits: number): _$_tanstack_react_query0.UseQueryResult<{
|
|
223
|
+
publicParams: Uint8Array<ArrayBufferLike>;
|
|
224
|
+
publicParamsId: string;
|
|
225
|
+
} | null, Error>;
|
|
271
226
|
//#endregion
|
|
272
227
|
//#region src/authorization/use-allow.d.ts
|
|
273
228
|
/**
|
|
@@ -290,18 +245,24 @@ declare function usePublicParams(bits: number): _$_tanstack_react_query0.UseQuer
|
|
|
290
245
|
* await allow([tokenAddress, auctionAddress, governanceAddress]);
|
|
291
246
|
* ```
|
|
292
247
|
*/
|
|
293
|
-
declare function useAllow(options?: UseMutationOptions<void, Error, Address
|
|
248
|
+
declare function useAllow(options?: UseMutationOptions<void, Error, Address[]>): _$_tanstack_react_query0.UseMutationResult<void, Error, `0x${string}`[], unknown>;
|
|
294
249
|
//#endregion
|
|
295
250
|
//#region src/authorization/use-is-allowed.d.ts
|
|
296
251
|
/** Configuration for {@link useIsAllowed}. */
|
|
297
252
|
interface UseIsAllowedConfig {
|
|
298
253
|
/** Contract addresses to check credentials against (at least one required). */
|
|
299
|
-
contractAddresses: [Address
|
|
254
|
+
contractAddresses: [Address, ...Address[]];
|
|
300
255
|
}
|
|
301
256
|
/**
|
|
302
|
-
* Check whether a session signature is cached for the connected
|
|
303
|
-
*
|
|
304
|
-
*
|
|
257
|
+
* Check whether a session signature is cached for the connected signer and
|
|
258
|
+
* covers the given contract addresses. Returns `true` if decrypt operations
|
|
259
|
+
* can proceed without a wallet prompt.
|
|
260
|
+
*
|
|
261
|
+
* @returns Query result with `data: boolean` — `true` if a session signature is cached
|
|
262
|
+
* and covers all `contractAddresses`. The query auto-disables when no signer is configured
|
|
263
|
+
* (`data` stays `undefined`, `status` stays `"pending"`).
|
|
264
|
+
* @throws {@link SignerRequiredError} if the query runs without a signer configured
|
|
265
|
+
* (the `enabled` guard normally prevents this; only reachable if the caller forces `query: { enabled: true }`).
|
|
305
266
|
*
|
|
306
267
|
* @example
|
|
307
268
|
* ```tsx
|
|
@@ -325,7 +286,7 @@ declare function useIsAllowed(config: UseIsAllowedConfig): _$_tanstack_react_que
|
|
|
325
286
|
* revoke([tokenAddress, auctionAddress]);
|
|
326
287
|
* ```
|
|
327
288
|
*/
|
|
328
|
-
declare function useRevoke(options?: UseMutationOptions<void, Error, Address
|
|
289
|
+
declare function useRevoke(options?: UseMutationOptions<void, Error, Address[]>): _$_tanstack_react_query0.UseMutationResult<void, Error, `0x${string}`[], unknown>;
|
|
329
290
|
//#endregion
|
|
330
291
|
//#region src/authorization/use-revoke-session.d.ts
|
|
331
292
|
/**
|
|
@@ -344,13 +305,12 @@ declare function useRevokeSession(options?: UseMutationOptions<void>): _$_tansta
|
|
|
344
305
|
/** Base configuration shared by all mutation hooks that need a Token instance. */
|
|
345
306
|
interface UseZamaConfig {
|
|
346
307
|
/** Address of the confidential token contract. */
|
|
347
|
-
tokenAddress: Address
|
|
308
|
+
tokenAddress: Address;
|
|
348
309
|
/** Address of the wrapper contract (required for shield/unshield operations). */
|
|
349
|
-
wrapperAddress?: Address
|
|
310
|
+
wrapperAddress?: Address;
|
|
350
311
|
}
|
|
351
312
|
/**
|
|
352
313
|
* Get a {@link Token} instance, memoized by address pair.
|
|
353
|
-
* Reads signer and storage from the nearest {@link ZamaProvider}.
|
|
354
314
|
*
|
|
355
315
|
* @param config - Token and optional wrapper addresses.
|
|
356
316
|
* @returns A memoized `Token` instance.
|
|
@@ -360,7 +320,7 @@ interface UseZamaConfig {
|
|
|
360
320
|
* const token = useToken({ tokenAddress: "0xToken", wrapperAddress: "0xWrapper" });
|
|
361
321
|
* ```
|
|
362
322
|
*/
|
|
363
|
-
declare function useToken(config: UseZamaConfig):
|
|
323
|
+
declare function useToken(config: UseZamaConfig): Token;
|
|
364
324
|
//#endregion
|
|
365
325
|
//#region src/token/use-readonly-token.d.ts
|
|
366
326
|
/**
|
|
@@ -377,58 +337,49 @@ declare function useToken(config: UseZamaConfig): _$_zama_fhe_sdk0.Token;
|
|
|
377
337
|
* // token.balanceOf(), token.isConfidential(), etc.
|
|
378
338
|
* ```
|
|
379
339
|
*/
|
|
380
|
-
declare function useReadonlyToken(address: Address
|
|
340
|
+
declare function useReadonlyToken(address: Address): _$_zama_fhe_sdk0.ReadonlyToken;
|
|
381
341
|
//#endregion
|
|
382
342
|
//#region src/balance/use-confidential-balance.d.ts
|
|
383
|
-
/** Configuration for {@link useConfidentialBalance}. */
|
|
384
343
|
interface UseConfidentialBalanceConfig {
|
|
385
344
|
/** Address of the confidential token contract. */
|
|
386
|
-
tokenAddress: Address
|
|
345
|
+
tokenAddress: Address;
|
|
346
|
+
/** Account to fetch balance for. The query is disabled while `undefined`. */
|
|
347
|
+
account: Address | undefined;
|
|
387
348
|
}
|
|
388
|
-
/** Query options for {@link useConfidentialBalance}. */
|
|
389
349
|
interface UseConfidentialBalanceOptions extends Omit<UseQueryOptions<bigint>, "queryKey" | "queryFn" | "enabled"> {
|
|
390
|
-
/**
|
|
350
|
+
/** Set this to `false` to disable this query from automatically running. */
|
|
391
351
|
enabled?: boolean;
|
|
392
352
|
}
|
|
393
353
|
/**
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
* when the handle changes.
|
|
398
|
-
*
|
|
399
|
-
* @param config - Token address configuration.
|
|
400
|
-
* @param options - React Query options forwarded to the balance query.
|
|
401
|
-
* @returns The balance query result.
|
|
354
|
+
* Hook for fetching a confidential token balance. Reads the on-chain handle and
|
|
355
|
+
* decrypts via the SDK; cached values are returned instantly and the relayer is
|
|
356
|
+
* only hit when the handle changes.
|
|
402
357
|
*
|
|
403
358
|
* @example
|
|
404
359
|
* ```tsx
|
|
405
|
-
* const { data: balance
|
|
406
|
-
* tokenAddress: "
|
|
360
|
+
* const { data: balance } = useConfidentialBalance({
|
|
361
|
+
* tokenAddress: "0xToken",
|
|
362
|
+
* account: "0xAccount",
|
|
407
363
|
* });
|
|
408
364
|
* ```
|
|
409
365
|
*/
|
|
410
366
|
declare function useConfidentialBalance(config: UseConfidentialBalanceConfig, options?: UseConfidentialBalanceOptions): _$_tanstack_react_query0.UseQueryResult<bigint, Error>;
|
|
411
367
|
//#endregion
|
|
412
368
|
//#region src/balance/use-confidential-balances.d.ts
|
|
413
|
-
/** Configuration for {@link useConfidentialBalances}. */
|
|
414
369
|
interface UseConfidentialBalancesConfig {
|
|
415
|
-
/** Addresses of the confidential token contracts to batch-query. */
|
|
416
|
-
tokenAddresses: Address
|
|
370
|
+
/** Addresses of the confidential token contracts to batch-query. The query is disabled while empty. */
|
|
371
|
+
tokenAddresses: Address[];
|
|
372
|
+
/** Account to fetch balances for. The query is disabled while `undefined`. */
|
|
373
|
+
account: Address | undefined;
|
|
417
374
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
/** Whether the query is enabled. Callback form is not supported in composite hooks. */
|
|
375
|
+
interface UseConfidentialBalancesOptions extends Omit<UseQueryOptions<BatchBalancesResult>, "queryKey" | "queryFn" | "enabled"> {
|
|
376
|
+
/** Set this to `false` to disable this query from automatically running. */
|
|
421
377
|
enabled?: boolean;
|
|
422
378
|
}
|
|
423
379
|
/**
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
* changed handles.
|
|
428
|
-
*
|
|
429
|
-
* Returns partial results when some tokens fail — successful balances are
|
|
430
|
-
* always returned alongside per-token error information.
|
|
431
|
-
*
|
|
380
|
+
* Hook for fetching multiple confidential token balances in batch. Returns
|
|
381
|
+
* partial results when some tokens fail — successful balances are available
|
|
382
|
+
* alongside per-token error information.
|
|
432
383
|
* @param config - Token addresses configuration.
|
|
433
384
|
* @param options - React Query options forwarded to the balance query.
|
|
434
385
|
* @returns The balance query result.
|
|
@@ -437,6 +388,7 @@ interface UseConfidentialBalancesOptions extends Omit<UseQueryOptions<BatchBalan
|
|
|
437
388
|
* ```tsx
|
|
438
389
|
* const { data } = useConfidentialBalances({
|
|
439
390
|
* tokenAddresses: ["0xTokenA", "0xTokenB"],
|
|
391
|
+
* account: "0xAccount",
|
|
440
392
|
* });
|
|
441
393
|
* const balance = data?.results.get("0xTokenA");
|
|
442
394
|
* if (data && data.errors.size > 0) {
|
|
@@ -444,7 +396,7 @@ interface UseConfidentialBalancesOptions extends Omit<UseQueryOptions<BatchBalan
|
|
|
444
396
|
* }
|
|
445
397
|
* ```
|
|
446
398
|
*/
|
|
447
|
-
declare function useConfidentialBalances(config: UseConfidentialBalancesConfig, options?: UseConfidentialBalancesOptions): _$_tanstack_react_query0.UseQueryResult<BatchBalancesResult
|
|
399
|
+
declare function useConfidentialBalances(config: UseConfidentialBalancesConfig, options?: UseConfidentialBalancesOptions): _$_tanstack_react_query0.UseQueryResult<BatchBalancesResult, Error>;
|
|
448
400
|
//#endregion
|
|
449
401
|
//#region src/transfer/use-confidential-transfer.d.ts
|
|
450
402
|
/** Configuration for {@link useConfidentialTransfer}. */
|
|
@@ -486,7 +438,7 @@ interface UseConfidentialTransferConfig extends UseZamaConfig {
|
|
|
486
438
|
* );
|
|
487
439
|
* ```
|
|
488
440
|
*/
|
|
489
|
-
declare function useConfidentialTransfer<TContext = unknown>(config: UseConfidentialTransferConfig, options?: UseMutationOptions<TransactionResult
|
|
441
|
+
declare function useConfidentialTransfer<TContext = unknown>(config: UseConfidentialTransferConfig, options?: UseMutationOptions<TransactionResult, Error, ConfidentialTransferParams, TContext>): UseMutationResult<TransactionResult, Error, ConfidentialTransferParams, TContext>;
|
|
490
442
|
//#endregion
|
|
491
443
|
//#region src/transfer/use-confidential-transfer-from.d.ts
|
|
492
444
|
/**
|
|
@@ -507,9 +459,9 @@ declare function useConfidentialTransfer<TContext = unknown>(config: UseConfiden
|
|
|
507
459
|
* transferFrom.mutate({ from: "0xOwner", to: "0xRecipient", amount: 500n });
|
|
508
460
|
* ```
|
|
509
461
|
*/
|
|
510
|
-
declare function useConfidentialTransferFrom(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
462
|
+
declare function useConfidentialTransferFrom(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ConfidentialTransferFromParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ConfidentialTransferFromParams, `0x${string}`>;
|
|
511
463
|
//#endregion
|
|
512
|
-
//#region src/
|
|
464
|
+
//#region src/operator/use-confidential-set-operator.d.ts
|
|
513
465
|
/**
|
|
514
466
|
* Set operator approval for a confidential token. Defaults to 1 hour.
|
|
515
467
|
*
|
|
@@ -522,63 +474,59 @@ declare function useConfidentialTransferFrom(config: UseZamaConfig, options?: Us
|
|
|
522
474
|
*
|
|
523
475
|
* @example
|
|
524
476
|
* ```tsx
|
|
525
|
-
* const
|
|
526
|
-
*
|
|
477
|
+
* const setOperator = useConfidentialSetOperator({ tokenAddress: "0x..." });
|
|
478
|
+
* setOperator.mutate({ operator: "0xOperator" });
|
|
527
479
|
* ```
|
|
528
480
|
*/
|
|
529
|
-
declare function
|
|
481
|
+
declare function useConfidentialSetOperator(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ConfidentialSetOperatorParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ConfidentialSetOperatorParams, `0x${string}`>;
|
|
530
482
|
//#endregion
|
|
531
|
-
//#region src/
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
holder?: Address$1;
|
|
483
|
+
//#region src/operator/use-confidential-is-operator.d.ts
|
|
484
|
+
interface UseConfidentialIsOperatorConfig {
|
|
485
|
+
/** Address of the confidential token contract. The query is disabled while `undefined`. */
|
|
486
|
+
tokenAddress: Address | undefined;
|
|
487
|
+
/** Address to check operator status for. The query is disabled while `undefined`. */
|
|
488
|
+
spender: Address | undefined;
|
|
489
|
+
/** Token holder address. The query is disabled while `undefined`. */
|
|
490
|
+
holder: Address | undefined;
|
|
540
491
|
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
holder
|
|
492
|
+
interface UseConfidentialIsOperatorSuspenseConfig {
|
|
493
|
+
/** Address of the confidential token contract. */
|
|
494
|
+
tokenAddress: Address;
|
|
495
|
+
/** Address to check operator status for. */
|
|
496
|
+
spender: Address;
|
|
497
|
+
/** Token holder address. */
|
|
498
|
+
holder: Address;
|
|
547
499
|
}
|
|
548
500
|
/**
|
|
549
|
-
* Check if a spender is an approved operator for a
|
|
550
|
-
*
|
|
501
|
+
* Check if a spender is an approved operator for a holder.
|
|
551
502
|
* @param config - Token address, spender, and optional holder to check.
|
|
552
503
|
* @param options - React Query options (forwarded to `useQuery`).
|
|
553
504
|
* @returns Query result with `data: boolean`.
|
|
554
505
|
*
|
|
555
506
|
* @example
|
|
556
507
|
* ```tsx
|
|
557
|
-
* const { data:
|
|
508
|
+
* const { data: isOperator } = useConfidentialIsOperator({
|
|
558
509
|
* tokenAddress: "0xToken",
|
|
559
510
|
* spender: "0xSpender",
|
|
560
|
-
* holder: "0xHolder",
|
|
511
|
+
* holder: "0xHolder",
|
|
561
512
|
* });
|
|
562
513
|
* ```
|
|
563
514
|
*/
|
|
564
|
-
declare function
|
|
515
|
+
declare function useConfidentialIsOperator(config: UseConfidentialIsOperatorConfig, options?: Omit<UseQueryOptions<boolean>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
565
516
|
/**
|
|
566
|
-
* Suspense variant of {@link
|
|
567
|
-
*
|
|
568
|
-
*
|
|
569
|
-
* @param config - Token address, spender, and optional holder to check.
|
|
570
|
-
* @returns Suspense query result with `data: boolean`.
|
|
517
|
+
* Suspense variant of {@link useConfidentialIsOperator}. Suspends rendering
|
|
518
|
+
* until the operator check resolves.
|
|
571
519
|
*
|
|
572
520
|
* @example
|
|
573
521
|
* ```tsx
|
|
574
|
-
* const { data:
|
|
522
|
+
* const { data: isOperator } = useConfidentialIsOperatorSuspense({
|
|
575
523
|
* tokenAddress: "0xToken",
|
|
576
524
|
* spender: "0xSpender",
|
|
577
|
-
* holder: "0xHolder",
|
|
525
|
+
* holder: "0xHolder",
|
|
578
526
|
* });
|
|
579
527
|
* ```
|
|
580
528
|
*/
|
|
581
|
-
declare function
|
|
529
|
+
declare function useConfidentialIsOperatorSuspense(config: UseConfidentialIsOperatorSuspenseConfig): _$_tanstack_react_query0.UseSuspenseQueryResult<boolean, Error>;
|
|
582
530
|
//#endregion
|
|
583
531
|
//#region src/shield/use-shield.d.ts
|
|
584
532
|
/** Configuration for {@link useShield}. */
|
|
@@ -609,7 +557,7 @@ interface UseShieldConfig extends UseZamaConfig {
|
|
|
609
557
|
* shield.mutate({ amount: 1000n });
|
|
610
558
|
* ```
|
|
611
559
|
*/
|
|
612
|
-
declare function useShield<TContext = unknown>(config: UseShieldConfig, options?: UseMutationOptions<TransactionResult
|
|
560
|
+
declare function useShield<TContext = unknown>(config: UseShieldConfig, options?: UseMutationOptions<TransactionResult, Error, ShieldParams, TContext>): UseMutationResult<TransactionResult, Error, ShieldParams, TContext>;
|
|
613
561
|
//#endregion
|
|
614
562
|
//#region src/unwrap/use-unwrap.d.ts
|
|
615
563
|
/**
|
|
@@ -631,7 +579,7 @@ declare function useShield<TContext = unknown>(config: UseShieldConfig, options?
|
|
|
631
579
|
* unwrap.mutate({ amount: 500n });
|
|
632
580
|
* ```
|
|
633
581
|
*/
|
|
634
|
-
declare function useUnwrap(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
582
|
+
declare function useUnwrap(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, UnwrapParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, UnwrapParams, `0x${string}`>;
|
|
635
583
|
//#endregion
|
|
636
584
|
//#region src/unwrap/use-unwrap-all.d.ts
|
|
637
585
|
/**
|
|
@@ -652,7 +600,7 @@ declare function useUnwrap(config: UseZamaConfig, options?: UseMutationOptions<T
|
|
|
652
600
|
* unwrapAll.mutate();
|
|
653
601
|
* ```
|
|
654
602
|
*/
|
|
655
|
-
declare function useUnwrapAll(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
603
|
+
declare function useUnwrapAll(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, void, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, void, `0x${string}`>;
|
|
656
604
|
//#endregion
|
|
657
605
|
//#region src/unwrap/use-finalize-unwrap.d.ts
|
|
658
606
|
/**
|
|
@@ -670,10 +618,16 @@ declare function useUnwrapAll(config: UseZamaConfig, options?: UseMutationOption
|
|
|
670
618
|
* @example
|
|
671
619
|
* ```tsx
|
|
672
620
|
* const finalize = useFinalizeUnwrap({ tokenAddress: "0x..." });
|
|
673
|
-
*
|
|
621
|
+
* const event = findUnwrapRequested(receipt.logs);
|
|
622
|
+
* // Pass unwrapRequestId from upgraded events, or fall back to encryptedAmount for legacy ones.
|
|
623
|
+
* finalize.mutate(
|
|
624
|
+
* event.unwrapRequestId
|
|
625
|
+
* ? { unwrapRequestId: event.unwrapRequestId }
|
|
626
|
+
* : { burnAmountHandle: event.encryptedAmount },
|
|
627
|
+
* );
|
|
674
628
|
* ```
|
|
675
629
|
*/
|
|
676
|
-
declare function useFinalizeUnwrap(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
630
|
+
declare function useFinalizeUnwrap(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, FinalizeUnwrapParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, FinalizeUnwrapParams, `0x${string}`>;
|
|
677
631
|
//#endregion
|
|
678
632
|
//#region src/unshield/use-unshield.d.ts
|
|
679
633
|
/**
|
|
@@ -695,7 +649,7 @@ declare function useFinalizeUnwrap(config: UseZamaConfig, options?: UseMutationO
|
|
|
695
649
|
* unshield.mutate({ amount: 500n });
|
|
696
650
|
* ```
|
|
697
651
|
*/
|
|
698
|
-
declare function useUnshield(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
652
|
+
declare function useUnshield(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, UnshieldParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, UnshieldParams, `0x${string}`>;
|
|
699
653
|
//#endregion
|
|
700
654
|
//#region src/unshield/use-unshield-all.d.ts
|
|
701
655
|
/**
|
|
@@ -716,7 +670,7 @@ declare function useUnshield(config: UseZamaConfig, options?: UseMutationOptions
|
|
|
716
670
|
* unshieldAll.mutate();
|
|
717
671
|
* ```
|
|
718
672
|
*/
|
|
719
|
-
declare function useUnshieldAll(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
673
|
+
declare function useUnshieldAll(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, UnshieldAllParams | void, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, void | UnshieldAllParams, `0x${string}`>;
|
|
720
674
|
//#endregion
|
|
721
675
|
//#region src/unshield/use-resume-unshield.d.ts
|
|
722
676
|
/**
|
|
@@ -737,49 +691,53 @@ declare function useUnshieldAll(config: UseZamaConfig, options?: UseMutationOpti
|
|
|
737
691
|
* resumeUnshield.mutate({ unwrapTxHash: "0xabc..." });
|
|
738
692
|
* ```
|
|
739
693
|
*/
|
|
740
|
-
declare function useResumeUnshield(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
694
|
+
declare function useResumeUnshield(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ResumeUnshieldParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ResumeUnshieldParams, `0x${string}`>;
|
|
741
695
|
//#endregion
|
|
742
696
|
//#region src/shield/use-underlying-allowance.d.ts
|
|
743
|
-
/** Configuration for {@link useUnderlyingAllowance}. */
|
|
744
697
|
interface UseUnderlyingAllowanceConfig {
|
|
745
698
|
/** Address of the confidential token contract used to scope the query cache. */
|
|
746
|
-
tokenAddress: Address
|
|
699
|
+
tokenAddress: Address;
|
|
747
700
|
/** Address of the wrapper contract whose underlying ERC-20 allowance is checked. */
|
|
748
|
-
wrapperAddress: Address
|
|
701
|
+
wrapperAddress: Address;
|
|
702
|
+
/** Owner to fetch allowance for. The query is disabled while `undefined`. */
|
|
703
|
+
owner: Address | undefined;
|
|
704
|
+
}
|
|
705
|
+
interface UseUnderlyingAllowanceSuspenseConfig {
|
|
706
|
+
/** Address of the confidential token contract used to scope the query cache. */
|
|
707
|
+
tokenAddress: Address;
|
|
708
|
+
/** Address of the wrapper contract whose underlying ERC-20 allowance is checked. */
|
|
709
|
+
wrapperAddress: Address;
|
|
710
|
+
/** Owner to fetch allowance for. */
|
|
711
|
+
owner: Address;
|
|
749
712
|
}
|
|
750
713
|
/**
|
|
751
|
-
*
|
|
752
|
-
* Useful to check if an approval is needed before shielding.
|
|
753
|
-
*
|
|
754
|
-
* @param config - Token and wrapper addresses.
|
|
755
|
-
* @param options - React Query options (forwarded to `useQuery`).
|
|
756
|
-
* @returns Query result with `data: bigint` (current allowance).
|
|
714
|
+
* Hook for fetching the underlying ERC-20 allowance granted to the wrapper
|
|
715
|
+
* contract. Useful to check if an approval is needed before shielding.
|
|
757
716
|
*
|
|
758
717
|
* @example
|
|
759
718
|
* ```tsx
|
|
760
719
|
* const { data: allowance } = useUnderlyingAllowance({
|
|
761
720
|
* tokenAddress: "0xConfidentialToken",
|
|
762
721
|
* wrapperAddress: "0xWrapper",
|
|
722
|
+
* owner: "0xOwner",
|
|
763
723
|
* });
|
|
764
724
|
* ```
|
|
765
725
|
*/
|
|
766
726
|
declare function useUnderlyingAllowance(config: UseUnderlyingAllowanceConfig, options?: Omit<UseQueryOptions<bigint>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<bigint, Error>;
|
|
767
727
|
/**
|
|
768
|
-
* Suspense variant of {@link useUnderlyingAllowance}.
|
|
769
|
-
*
|
|
770
|
-
*
|
|
771
|
-
* @param config - Token and wrapper addresses.
|
|
772
|
-
* @returns Suspense query result with `data: bigint`.
|
|
728
|
+
* Suspense variant of {@link useUnderlyingAllowance}. Suspends rendering until
|
|
729
|
+
* the allowance resolves.
|
|
773
730
|
*
|
|
774
731
|
* @example
|
|
775
732
|
* ```tsx
|
|
776
733
|
* const { data: allowance } = useUnderlyingAllowanceSuspense({
|
|
777
734
|
* tokenAddress: "0xConfidentialToken",
|
|
778
735
|
* wrapperAddress: "0xWrapper",
|
|
736
|
+
* owner: "0xOwner",
|
|
779
737
|
* });
|
|
780
738
|
* ```
|
|
781
739
|
*/
|
|
782
|
-
declare function useUnderlyingAllowanceSuspense(config:
|
|
740
|
+
declare function useUnderlyingAllowanceSuspense(config: UseUnderlyingAllowanceSuspenseConfig): _$_tanstack_react_query0.UseSuspenseQueryResult<bigint, Error>;
|
|
783
741
|
//#endregion
|
|
784
742
|
//#region src/token/use-wrapper-discovery.d.ts
|
|
785
743
|
/** Configuration for {@link useWrapperDiscovery}. */
|
|
@@ -789,9 +747,9 @@ interface UseWrapperDiscoveryConfig {
|
|
|
789
747
|
* Used only to derive the signer context and to scope the query cache key —
|
|
790
748
|
* it does not affect which wrapper the registry returns.
|
|
791
749
|
*/
|
|
792
|
-
tokenAddress: Address
|
|
750
|
+
tokenAddress: Address;
|
|
793
751
|
/** ERC-20 address to discover the wrapper for. Pass `undefined` to disable the query. */
|
|
794
|
-
erc20Address: Address
|
|
752
|
+
erc20Address: Address | undefined;
|
|
795
753
|
}
|
|
796
754
|
/** Configuration for {@link useWrapperDiscoverySuspense}. */
|
|
797
755
|
interface UseWrapperDiscoverySuspenseConfig {
|
|
@@ -800,9 +758,9 @@ interface UseWrapperDiscoverySuspenseConfig {
|
|
|
800
758
|
* Used only to derive the signer context and to scope the query cache key —
|
|
801
759
|
* it does not affect which wrapper the registry returns.
|
|
802
760
|
*/
|
|
803
|
-
tokenAddress: Address
|
|
761
|
+
tokenAddress: Address;
|
|
804
762
|
/** ERC-20 address to discover the wrapper for. */
|
|
805
|
-
erc20Address: Address
|
|
763
|
+
erc20Address: Address;
|
|
806
764
|
}
|
|
807
765
|
/**
|
|
808
766
|
* Discover the confidential wrapper for an ERC-20 token via the on-chain registry.
|
|
@@ -821,7 +779,7 @@ interface UseWrapperDiscoverySuspenseConfig {
|
|
|
821
779
|
* });
|
|
822
780
|
* ```
|
|
823
781
|
*/
|
|
824
|
-
declare function useWrapperDiscovery(config: UseWrapperDiscoveryConfig, options?: Omit<UseQueryOptions<Address
|
|
782
|
+
declare function useWrapperDiscovery(config: UseWrapperDiscoveryConfig, options?: Omit<UseQueryOptions<Address | null>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<`0x${string}` | null, Error>;
|
|
825
783
|
/**
|
|
826
784
|
* Suspense variant of {@link useWrapperDiscovery}.
|
|
827
785
|
* Suspends rendering until the wrapper address is resolved.
|
|
@@ -854,7 +812,7 @@ declare function useWrapperDiscoverySuspense(config: UseWrapperDiscoverySuspense
|
|
|
854
812
|
* // metadata?.name, metadata?.symbol, metadata?.decimals
|
|
855
813
|
* ```
|
|
856
814
|
*/
|
|
857
|
-
declare function useMetadata(tokenAddress: Address
|
|
815
|
+
declare function useMetadata(tokenAddress: Address, options?: Omit<UseQueryOptions<TokenMetadata>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<TokenMetadata, Error>;
|
|
858
816
|
/**
|
|
859
817
|
* Suspense variant of {@link useMetadata}.
|
|
860
818
|
* Suspends rendering until metadata is loaded.
|
|
@@ -867,7 +825,7 @@ declare function useMetadata(tokenAddress: Address$1, options?: Omit<UseQueryOpt
|
|
|
867
825
|
* const { data: metadata } = useMetadataSuspense("0xToken");
|
|
868
826
|
* ```
|
|
869
827
|
*/
|
|
870
|
-
declare function useMetadataSuspense(tokenAddress: Address
|
|
828
|
+
declare function useMetadataSuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<TokenMetadata, Error>;
|
|
871
829
|
//#endregion
|
|
872
830
|
//#region src/delegation/use-delegate-decryption.d.ts
|
|
873
831
|
/**
|
|
@@ -882,7 +840,7 @@ declare function useMetadataSuspense(tokenAddress: Address$1): _$_tanstack_react
|
|
|
882
840
|
* delegate.mutate({ delegateAddress: "0xDelegate" });
|
|
883
841
|
* ```
|
|
884
842
|
*/
|
|
885
|
-
declare function useDelegateDecryption(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
843
|
+
declare function useDelegateDecryption(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, DelegateDecryptionParams>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, DelegateDecryptionParams, unknown>;
|
|
886
844
|
//#endregion
|
|
887
845
|
//#region src/delegation/use-revoke-delegation.d.ts
|
|
888
846
|
/**
|
|
@@ -897,16 +855,16 @@ declare function useDelegateDecryption(config: UseZamaConfig, options?: UseMutat
|
|
|
897
855
|
* revoke.mutate({ delegateAddress: "0xDelegate" });
|
|
898
856
|
* ```
|
|
899
857
|
*/
|
|
900
|
-
declare function useRevokeDelegation(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
858
|
+
declare function useRevokeDelegation(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, RevokeDelegationParams>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, RevokeDelegationParams, unknown>;
|
|
901
859
|
//#endregion
|
|
902
860
|
//#region src/delegation/use-delegation-status.d.ts
|
|
903
861
|
interface UseDelegationStatusConfig {
|
|
904
862
|
/** Address of the confidential token contract. Pass `undefined` to disable the query. */
|
|
905
|
-
tokenAddress: Address
|
|
863
|
+
tokenAddress: Address | undefined;
|
|
906
864
|
/** The address that granted the delegation. */
|
|
907
|
-
delegatorAddress?: Address
|
|
865
|
+
delegatorAddress?: Address;
|
|
908
866
|
/** The address that received delegation rights. */
|
|
909
|
-
delegateAddress?: Address
|
|
867
|
+
delegateAddress?: Address;
|
|
910
868
|
}
|
|
911
869
|
/**
|
|
912
870
|
* Query delegation status between a delegator and delegate for a token.
|
|
@@ -925,7 +883,7 @@ interface UseDelegationStatusConfig {
|
|
|
925
883
|
* // data?.isDelegated, data?.expiryTimestamp
|
|
926
884
|
* ```
|
|
927
885
|
*/
|
|
928
|
-
declare function useDelegationStatus(config: UseDelegationStatusConfig, options?: Omit<UseQueryOptions<DelegationStatusData
|
|
886
|
+
declare function useDelegationStatus(config: UseDelegationStatusConfig, options?: Omit<UseQueryOptions<DelegationStatusData>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<DelegationStatusData, Error>;
|
|
929
887
|
//#endregion
|
|
930
888
|
//#region src/delegation/use-decrypt-balance-as.d.ts
|
|
931
889
|
/**
|
|
@@ -941,7 +899,7 @@ declare function useDelegationStatus(config: UseDelegationStatusConfig, options?
|
|
|
941
899
|
* // decryptAs.data => 1000n
|
|
942
900
|
* ```
|
|
943
901
|
*/
|
|
944
|
-
declare function useDecryptBalanceAs(tokenAddress: Address
|
|
902
|
+
declare function useDecryptBalanceAs(tokenAddress: Address, options?: UseMutationOptions<bigint, Error, DecryptBalanceAsParams>): _$_tanstack_react_query0.UseMutationResult<bigint, Error, DecryptBalanceAsParams, unknown>;
|
|
945
903
|
//#endregion
|
|
946
904
|
//#region src/delegation/use-batch-decrypt-balances-as.d.ts
|
|
947
905
|
/**
|
|
@@ -959,7 +917,7 @@ declare function useDecryptBalanceAs(tokenAddress: Address$1, options?: UseMutat
|
|
|
959
917
|
* // batchDecryptAs.data => Map { "0xTokenA" => 100n, "0xTokenB" => 200n }
|
|
960
918
|
* ```
|
|
961
919
|
*/
|
|
962
|
-
declare function useBatchDecryptBalancesAs(tokens: ReadonlyToken
|
|
920
|
+
declare function useBatchDecryptBalancesAs(tokens: ReadonlyToken[], options?: UseMutationOptions<Map<Address, bigint>, Error, BatchDecryptBalancesAsParams>): _$_tanstack_react_query0.UseMutationResult<Map<`0x${string}`, bigint>, Error, _$_zama_fhe_sdk0.BatchDecryptAsOptions, unknown>;
|
|
963
921
|
//#endregion
|
|
964
922
|
//#region src/shield/use-approve-underlying.d.ts
|
|
965
923
|
/**
|
|
@@ -981,7 +939,7 @@ declare function useBatchDecryptBalancesAs(tokens: ReadonlyToken$1[], options?:
|
|
|
981
939
|
* approve.mutate({ amount: 1000n }); // exact amount
|
|
982
940
|
* ```
|
|
983
941
|
*/
|
|
984
|
-
declare function useApproveUnderlying(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
942
|
+
declare function useApproveUnderlying(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ApproveUnderlyingParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ApproveUnderlyingParams, `0x${string}`>;
|
|
985
943
|
//#endregion
|
|
986
944
|
//#region src/token/use-is-confidential.d.ts
|
|
987
945
|
/**
|
|
@@ -997,7 +955,7 @@ declare function useApproveUnderlying(config: UseZamaConfig, options?: UseMutati
|
|
|
997
955
|
* const { data: isConfidential } = useIsConfidential("0xToken");
|
|
998
956
|
* ```
|
|
999
957
|
*/
|
|
1000
|
-
declare function useIsConfidential(tokenAddress: Address
|
|
958
|
+
declare function useIsConfidential(tokenAddress: Address, options?: Omit<UseQueryOptions<boolean>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
1001
959
|
/**
|
|
1002
960
|
* Suspense variant of {@link useIsConfidential}.
|
|
1003
961
|
* Suspends rendering until the ERC-165 check resolves.
|
|
@@ -1010,7 +968,7 @@ declare function useIsConfidential(tokenAddress: Address$1, options?: Omit<UseQu
|
|
|
1010
968
|
* const { data: isConfidential } = useIsConfidentialSuspense("0xToken");
|
|
1011
969
|
* ```
|
|
1012
970
|
*/
|
|
1013
|
-
declare function useIsConfidentialSuspense(tokenAddress: Address
|
|
971
|
+
declare function useIsConfidentialSuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<boolean, Error>;
|
|
1014
972
|
/**
|
|
1015
973
|
* Check if a token supports the ERC-7984 wrapper interface via ERC-165.
|
|
1016
974
|
* Result is cached indefinitely since interface support does not change.
|
|
@@ -1024,7 +982,7 @@ declare function useIsConfidentialSuspense(tokenAddress: Address$1): _$_tanstack
|
|
|
1024
982
|
* const { data: isWrapper } = useIsWrapper("0xToken");
|
|
1025
983
|
* ```
|
|
1026
984
|
*/
|
|
1027
|
-
declare function useIsWrapper(tokenAddress: Address
|
|
985
|
+
declare function useIsWrapper(tokenAddress: Address, options?: Omit<UseQueryOptions<boolean>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
1028
986
|
/**
|
|
1029
987
|
* Suspense variant of {@link useIsWrapper}.
|
|
1030
988
|
* Suspends rendering until the ERC-165 check resolves.
|
|
@@ -1037,7 +995,7 @@ declare function useIsWrapper(tokenAddress: Address$1, options?: Omit<UseQueryOp
|
|
|
1037
995
|
* const { data: isWrapper } = useIsWrapperSuspense("0xToken");
|
|
1038
996
|
* ```
|
|
1039
997
|
*/
|
|
1040
|
-
declare function useIsWrapperSuspense(tokenAddress: Address
|
|
998
|
+
declare function useIsWrapperSuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<boolean, Error>;
|
|
1041
999
|
//#endregion
|
|
1042
1000
|
//#region src/token/use-total-supply.d.ts
|
|
1043
1001
|
/**
|
|
@@ -1047,32 +1005,35 @@ declare function useIsWrapperSuspense(tokenAddress: Address$1): _$_tanstack_reac
|
|
|
1047
1005
|
* @param tokenAddress - Address of the token contract.
|
|
1048
1006
|
* @param options - React Query options (forwarded to `useQuery`).
|
|
1049
1007
|
* @returns Query result with `data: bigint`.
|
|
1008
|
+
* Uses ERC-165 to call `inferredTotalSupply()` on upgraded wrappers and
|
|
1009
|
+
* legacy `totalSupply()` on pre-upgrade wrappers.
|
|
1050
1010
|
*
|
|
1051
1011
|
* @example
|
|
1052
1012
|
* ```tsx
|
|
1053
1013
|
* const { data: totalSupply } = useTotalSupply("0xToken");
|
|
1054
1014
|
* ```
|
|
1055
1015
|
*/
|
|
1056
|
-
declare function useTotalSupply(tokenAddress: Address
|
|
1016
|
+
declare function useTotalSupply(tokenAddress: Address, options?: Omit<UseQueryOptions<bigint>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<bigint, Error>;
|
|
1057
1017
|
/**
|
|
1058
1018
|
* Suspense variant of {@link useTotalSupply}.
|
|
1059
1019
|
* Suspends rendering until the total supply is loaded.
|
|
1060
1020
|
*
|
|
1061
1021
|
* @param tokenAddress - Address of the token contract.
|
|
1062
1022
|
* @returns Suspense query result with `data: bigint`.
|
|
1023
|
+
* Uses ERC-165 to call `inferredTotalSupply()` on upgraded wrappers and
|
|
1024
|
+
* legacy `totalSupply()` on pre-upgrade wrappers.
|
|
1063
1025
|
*
|
|
1064
1026
|
* @example
|
|
1065
1027
|
* ```tsx
|
|
1066
1028
|
* const { data: totalSupply } = useTotalSupplySuspense("0xToken");
|
|
1067
1029
|
* ```
|
|
1068
1030
|
*/
|
|
1069
|
-
declare function useTotalSupplySuspense(tokenAddress: Address
|
|
1031
|
+
declare function useTotalSupplySuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<bigint, Error>;
|
|
1070
1032
|
//#endregion
|
|
1071
1033
|
//#region src/wrappers-registry/use-wrappers-registry-address.d.ts
|
|
1072
1034
|
/**
|
|
1073
1035
|
* Resolves the wrappers registry address for the current chain.
|
|
1074
|
-
* Uses the
|
|
1075
|
-
* plus any `registryAddresses` overrides passed to `ZamaSDKConfig`).
|
|
1036
|
+
* Uses the registry addresses from `sdk.registry` (built-in defaults from chain configs).
|
|
1076
1037
|
*
|
|
1077
1038
|
* Returns `undefined` when the chain ID hasn't been fetched yet
|
|
1078
1039
|
* or when no registry is configured for the connected chain.
|
|
@@ -1080,14 +1041,14 @@ declare function useTotalSupplySuspense(tokenAddress: Address$1): _$_tanstack_re
|
|
|
1080
1041
|
* The chain ID is cached for 30 seconds (`staleTime`), so chain
|
|
1081
1042
|
* switches may take up to 30s to reflect.
|
|
1082
1043
|
*/
|
|
1083
|
-
declare function useWrappersRegistryAddress(): Address
|
|
1044
|
+
declare function useWrappersRegistryAddress(): Address | undefined;
|
|
1084
1045
|
//#endregion
|
|
1085
1046
|
//#region src/wrappers-registry/use-token-pairs-registry.d.ts
|
|
1086
1047
|
/**
|
|
1087
1048
|
* Fetches all token wrapper pairs from the ConfidentialTokenWrappersRegistry
|
|
1088
1049
|
* contract on the current chain.
|
|
1089
1050
|
*/
|
|
1090
|
-
declare function useTokenPairsRegistry(): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair
|
|
1051
|
+
declare function useTokenPairsRegistry(): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair[], Error>;
|
|
1091
1052
|
//#endregion
|
|
1092
1053
|
//#region src/wrappers-registry/use-token-pairs-length.d.ts
|
|
1093
1054
|
/**
|
|
@@ -1108,7 +1069,7 @@ declare function useTokenPairsSlice({
|
|
|
1108
1069
|
}: {
|
|
1109
1070
|
fromIndex: bigint | undefined;
|
|
1110
1071
|
toIndex: bigint | undefined;
|
|
1111
|
-
}): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair
|
|
1072
|
+
}): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair[], Error>;
|
|
1112
1073
|
//#endregion
|
|
1113
1074
|
//#region src/wrappers-registry/use-token-pair.d.ts
|
|
1114
1075
|
/**
|
|
@@ -1120,7 +1081,7 @@ declare function useTokenPair({
|
|
|
1120
1081
|
index
|
|
1121
1082
|
}: {
|
|
1122
1083
|
index: bigint | undefined;
|
|
1123
|
-
}): _$_tanstack_react_query0.UseQueryResult<TokenWrapperPair
|
|
1084
|
+
}): _$_tanstack_react_query0.UseQueryResult<TokenWrapperPair, Error>;
|
|
1124
1085
|
//#endregion
|
|
1125
1086
|
//#region src/wrappers-registry/use-confidential-token-address.d.ts
|
|
1126
1087
|
/**
|
|
@@ -1129,7 +1090,7 @@ declare function useTokenPair({
|
|
|
1129
1090
|
declare function useConfidentialTokenAddress({
|
|
1130
1091
|
tokenAddress
|
|
1131
1092
|
}: {
|
|
1132
|
-
tokenAddress: Address
|
|
1093
|
+
tokenAddress: Address | undefined;
|
|
1133
1094
|
}): _$_tanstack_react_query0.UseQueryResult<readonly [boolean, `0x${string}`], Error>;
|
|
1134
1095
|
//#endregion
|
|
1135
1096
|
//#region src/wrappers-registry/use-token-address.d.ts
|
|
@@ -1139,7 +1100,7 @@ declare function useConfidentialTokenAddress({
|
|
|
1139
1100
|
declare function useTokenAddress({
|
|
1140
1101
|
confidentialTokenAddress
|
|
1141
1102
|
}: {
|
|
1142
|
-
confidentialTokenAddress: Address
|
|
1103
|
+
confidentialTokenAddress: Address | undefined;
|
|
1143
1104
|
}): _$_tanstack_react_query0.UseQueryResult<readonly [boolean, `0x${string}`], Error>;
|
|
1144
1105
|
//#endregion
|
|
1145
1106
|
//#region src/wrappers-registry/use-is-confidential-token-valid.d.ts
|
|
@@ -1152,7 +1113,7 @@ declare function useTokenAddress({
|
|
|
1152
1113
|
declare function useIsConfidentialTokenValid({
|
|
1153
1114
|
confidentialTokenAddress
|
|
1154
1115
|
}: {
|
|
1155
|
-
confidentialTokenAddress: Address
|
|
1116
|
+
confidentialTokenAddress: Address | undefined;
|
|
1156
1117
|
}): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
1157
1118
|
//#endregion
|
|
1158
1119
|
//#region src/wrappers-registry/use-list-pairs.d.ts
|
|
@@ -1177,15 +1138,7 @@ declare function useListPairs({
|
|
|
1177
1138
|
page?: number;
|
|
1178
1139
|
pageSize?: number;
|
|
1179
1140
|
metadata?: boolean;
|
|
1180
|
-
}): _$_tanstack_react_query0.UseQueryResult<PaginatedResult
|
|
1181
|
-
//#endregion
|
|
1182
|
-
//#region src/balance/optimistic-balance-update.d.ts
|
|
1183
|
-
type OptimisticBalanceSnapshot = [QueryKey, bigint | undefined][];
|
|
1184
|
-
/** Combined context returned by optimistic `onMutate`. */
|
|
1185
|
-
interface OptimisticMutateContext {
|
|
1186
|
-
snapshot: OptimisticBalanceSnapshot;
|
|
1187
|
-
callerContext?: unknown;
|
|
1188
|
-
}
|
|
1141
|
+
}): _$_tanstack_react_query0.UseQueryResult<PaginatedResult<TokenWrapperPair | TokenWrapperPairWithMetadata>, Error>;
|
|
1189
1142
|
//#endregion
|
|
1190
|
-
export {
|
|
1143
|
+
export { type UseConfidentialBalanceConfig, type UseConfidentialBalanceOptions, type UseConfidentialBalancesConfig, type UseConfidentialBalancesOptions, type UseConfidentialIsOperatorConfig, type UseConfidentialIsOperatorSuspenseConfig, type UseConfidentialTransferConfig, type UseDelegationStatusConfig, type UseIsAllowedConfig, type UseShieldConfig, type UseUnderlyingAllowanceConfig, type UseUnderlyingAllowanceSuspenseConfig, type UseUserDecryptResult, type UseWrapperDiscoveryConfig, type UseWrapperDiscoverySuspenseConfig, type UseZamaConfig, ZamaProvider, type ZamaProviderProps, useAllow, useApproveUnderlying, useBatchDecryptBalancesAs, useConfidentialBalance, useConfidentialBalances, useConfidentialIsOperator, useConfidentialIsOperatorSuspense, useConfidentialSetOperator, useConfidentialTokenAddress, useConfidentialTransfer, useConfidentialTransferFrom, useCreateDelegatedUserDecryptEIP712, useCreateEIP712, useDecryptBalanceAs, useDelegateDecryption, useDelegatedUserDecrypt, useDelegationStatus, useEncrypt, useFinalizeUnwrap, useGenerateKeypair, useIsAllowed, useIsConfidential, useIsConfidentialSuspense, useIsConfidentialTokenValid, useIsWrapper, useIsWrapperSuspense, useListPairs, useMetadata, useMetadataSuspense, usePublicDecrypt, usePublicKey, usePublicParams, useReadonlyToken, useRequestZKProofVerification, useResumeUnshield, useRevoke, useRevokeDelegation, useRevokeSession, useShield, useToken, useTokenAddress, useTokenPair, useTokenPairsLength, useTokenPairsRegistry, useTokenPairsSlice, useTotalSupply, useTotalSupplySuspense, useUnderlyingAllowance, useUnderlyingAllowanceSuspense, useUnshield, useUnshieldAll, useUnwrap, useUnwrapAll, useUserDecrypt, useWrapperDiscovery, useWrapperDiscoverySuspense, useWrappersRegistryAddress, useZamaSDK };
|
|
1191
1144
|
//# sourceMappingURL=index.d.ts.map
|