@zama-fhe/react-sdk 3.0.0-alpha.2 → 3.0.0-alpha.20
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 +103 -73
- package/dist/index.d.ts +165 -197
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/wagmi/index.d.ts +47 -8
- package/dist/wagmi/index.js +1 -1
- package/dist/wagmi/index.js.map +1 -1
- package/package.json +2 -2
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, DelegatedUserDecryptParams, EIP712TypedData, EncryptParams, PaginatedResult, PublicKeyData, ReadonlyToken, Token, TokenWrapperPair, TokenWrapperPairWithMetadata, TransactionResult, ZKProofLike, ZamaConfig, ZamaSDK } from "@zama-fhe/sdk";
|
|
5
|
+
import { ApproveUnderlyingParams, BatchDecryptBalancesAsParams, ConfidentialApproveParams, ConfidentialTransferFromParams, ConfidentialTransferParams, CreateDelegatedUserDecryptEIP712Params, CreateEIP712Params, DecryptBalanceAsParams, DecryptResult, DelegateDecryptionParams, 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, UseQueryResult } 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,55 @@ 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...");
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function useZamaSDK(): ZamaSDK;
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/use-signer-address.d.ts
|
|
45
|
+
/**
|
|
46
|
+
* Read the connected signer address.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* const { data: address, isPending, isError } = useSignerAddress();
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare function useSignerAddress(): UseQueryResult<Address>;
|
|
54
|
+
/**
|
|
55
|
+
* Suspense variant of {@link useSignerAddress}.
|
|
56
|
+
* Suspends rendering until the signer address resolves.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* const { data: address } = useSignerAddressSuspense();
|
|
81
61
|
* ```
|
|
82
62
|
*/
|
|
83
|
-
declare function
|
|
63
|
+
declare function useSignerAddressSuspense(): _$_tanstack_react_query0.UseSuspenseQueryResult<`0x${string}`, Error>;
|
|
84
64
|
//#endregion
|
|
85
65
|
//#region src/relayer/use-encrypt.d.ts
|
|
86
66
|
/**
|
|
@@ -98,14 +78,17 @@ declare function useZamaSDK(): ZamaSDK$1;
|
|
|
98
78
|
* encrypt.mutate({ values: [{ value: 1000n, type: "euint64" }], contractAddress: "0x...", userAddress: "0x..." });
|
|
99
79
|
* ```
|
|
100
80
|
*/
|
|
101
|
-
declare function useEncrypt(): _$_tanstack_react_query0.UseMutationResult<
|
|
81
|
+
declare function useEncrypt(): _$_tanstack_react_query0.UseMutationResult<Readonly<{
|
|
82
|
+
handles: Uint8Array[];
|
|
83
|
+
inputProof: Uint8Array;
|
|
84
|
+
}>, Error, EncryptParams, unknown>;
|
|
102
85
|
//#endregion
|
|
103
86
|
//#region src/relayer/use-user-decrypt.d.ts
|
|
104
87
|
/**
|
|
105
88
|
* React hook for FHE user decryption. Thin wrapper around
|
|
106
89
|
* `userDecryptQueryOptions` with `useQuery` semantics.
|
|
107
90
|
*/
|
|
108
|
-
declare function useUserDecrypt(config: UserDecryptQueryConfig
|
|
91
|
+
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
92
|
/** Return type of {@link useUserDecrypt}. */
|
|
110
93
|
type UseUserDecryptResult = ReturnType<typeof useUserDecrypt>;
|
|
111
94
|
//#endregion
|
|
@@ -124,7 +107,11 @@ type UseUserDecryptResult = ReturnType<typeof useUserDecrypt>;
|
|
|
124
107
|
* // publicDecrypt.data?.clearValues => { "0xHandle1": 500n, ... }
|
|
125
108
|
* ```
|
|
126
109
|
*/
|
|
127
|
-
declare function usePublicDecrypt(): _$_tanstack_react_query0.UseMutationResult<
|
|
110
|
+
declare function usePublicDecrypt(): _$_tanstack_react_query0.UseMutationResult<Readonly<{
|
|
111
|
+
clearValues: _$_zama_fhe_relayer_sdk_web0.ClearValues;
|
|
112
|
+
abiEncodedClearValues: `0x${string}`;
|
|
113
|
+
decryptionProof: `0x${string}`;
|
|
114
|
+
}>, Error, `0x${string}`[], unknown>;
|
|
128
115
|
//#endregion
|
|
129
116
|
//#region src/relayer/use-generate-keypair.d.ts
|
|
130
117
|
/**
|
|
@@ -162,7 +149,7 @@ declare function useGenerateKeypair(): _$_tanstack_react_query0.UseMutationResul
|
|
|
162
149
|
* });
|
|
163
150
|
* ```
|
|
164
151
|
*/
|
|
165
|
-
declare function useCreateEIP712(): _$_tanstack_react_query0.UseMutationResult<EIP712TypedData
|
|
152
|
+
declare function useCreateEIP712(): _$_tanstack_react_query0.UseMutationResult<EIP712TypedData, Error, CreateEIP712Params, unknown>;
|
|
166
153
|
//#endregion
|
|
167
154
|
//#region src/relayer/use-create-delegated-user-decrypt-eip712.d.ts
|
|
168
155
|
/**
|
|
@@ -203,7 +190,7 @@ declare function useCreateDelegatedUserDecryptEIP712(): _$_tanstack_react_query0
|
|
|
203
190
|
* // decrypt.data => { "0xHandle1": 1000n }
|
|
204
191
|
* ```
|
|
205
192
|
*/
|
|
206
|
-
declare function useDelegatedUserDecrypt(): _$_tanstack_react_query0.UseMutationResult<Record<`0x${string}`, ClearValueType
|
|
193
|
+
declare function useDelegatedUserDecrypt(): _$_tanstack_react_query0.UseMutationResult<Record<`0x${string}`, ClearValueType>, Error, DelegatedUserDecryptParams, unknown>;
|
|
207
194
|
//#endregion
|
|
208
195
|
//#region src/relayer/use-request-zk-proof-verification.d.ts
|
|
209
196
|
/**
|
|
@@ -222,16 +209,9 @@ declare function useDelegatedUserDecrypt(): _$_tanstack_react_query0.UseMutation
|
|
|
222
209
|
declare function useRequestZKProofVerification(): _$_tanstack_react_query0.UseMutationResult<Readonly<{
|
|
223
210
|
handles: Uint8Array[];
|
|
224
211
|
inputProof: Uint8Array;
|
|
225
|
-
}>, Error, ZKProofLike
|
|
212
|
+
}>, Error, ZKProofLike, unknown>;
|
|
226
213
|
//#endregion
|
|
227
214
|
//#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
215
|
/**
|
|
236
216
|
* Fetch the FHE network public key from the relayer.
|
|
237
217
|
* Cached indefinitely since the key does not change during a session.
|
|
@@ -247,13 +227,6 @@ interface PublicKeyData {
|
|
|
247
227
|
declare function usePublicKey(): _$_tanstack_react_query0.UseQueryResult<PublicKeyData | null, Error>;
|
|
248
228
|
//#endregion
|
|
249
229
|
//#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
230
|
/**
|
|
258
231
|
* Fetch FHE public parameters for a given bit size from the relayer.
|
|
259
232
|
* Cached indefinitely since parameters do not change during a session.
|
|
@@ -267,7 +240,10 @@ interface PublicParamsData {
|
|
|
267
240
|
* // params?.publicParams, params?.publicParamsId
|
|
268
241
|
* ```
|
|
269
242
|
*/
|
|
270
|
-
declare function usePublicParams(bits: number): _$_tanstack_react_query0.UseQueryResult<
|
|
243
|
+
declare function usePublicParams(bits: number): _$_tanstack_react_query0.UseQueryResult<{
|
|
244
|
+
publicParams: Uint8Array<ArrayBufferLike>;
|
|
245
|
+
publicParamsId: string;
|
|
246
|
+
} | null, Error>;
|
|
271
247
|
//#endregion
|
|
272
248
|
//#region src/authorization/use-allow.d.ts
|
|
273
249
|
/**
|
|
@@ -290,13 +266,13 @@ declare function usePublicParams(bits: number): _$_tanstack_react_query0.UseQuer
|
|
|
290
266
|
* await allow([tokenAddress, auctionAddress, governanceAddress]);
|
|
291
267
|
* ```
|
|
292
268
|
*/
|
|
293
|
-
declare function useAllow(options?: UseMutationOptions<void, Error, Address
|
|
269
|
+
declare function useAllow(options?: UseMutationOptions<void, Error, Address[]>): _$_tanstack_react_query0.UseMutationResult<void, Error, `0x${string}`[], unknown>;
|
|
294
270
|
//#endregion
|
|
295
271
|
//#region src/authorization/use-is-allowed.d.ts
|
|
296
272
|
/** Configuration for {@link useIsAllowed}. */
|
|
297
273
|
interface UseIsAllowedConfig {
|
|
298
274
|
/** Contract addresses to check credentials against (at least one required). */
|
|
299
|
-
contractAddresses: [Address
|
|
275
|
+
contractAddresses: [Address, ...Address[]];
|
|
300
276
|
}
|
|
301
277
|
/**
|
|
302
278
|
* Check whether a session signature is cached for the connected wallet
|
|
@@ -325,7 +301,7 @@ declare function useIsAllowed(config: UseIsAllowedConfig): _$_tanstack_react_que
|
|
|
325
301
|
* revoke([tokenAddress, auctionAddress]);
|
|
326
302
|
* ```
|
|
327
303
|
*/
|
|
328
|
-
declare function useRevoke(options?: UseMutationOptions<void, Error, Address
|
|
304
|
+
declare function useRevoke(options?: UseMutationOptions<void, Error, Address[]>): _$_tanstack_react_query0.UseMutationResult<void, Error, `0x${string}`[], unknown>;
|
|
329
305
|
//#endregion
|
|
330
306
|
//#region src/authorization/use-revoke-session.d.ts
|
|
331
307
|
/**
|
|
@@ -344,13 +320,12 @@ declare function useRevokeSession(options?: UseMutationOptions<void>): _$_tansta
|
|
|
344
320
|
/** Base configuration shared by all mutation hooks that need a Token instance. */
|
|
345
321
|
interface UseZamaConfig {
|
|
346
322
|
/** Address of the confidential token contract. */
|
|
347
|
-
tokenAddress: Address
|
|
323
|
+
tokenAddress: Address;
|
|
348
324
|
/** Address of the wrapper contract (required for shield/unshield operations). */
|
|
349
|
-
wrapperAddress?: Address
|
|
325
|
+
wrapperAddress?: Address;
|
|
350
326
|
}
|
|
351
327
|
/**
|
|
352
328
|
* Get a {@link Token} instance, memoized by address pair.
|
|
353
|
-
* Reads signer and storage from the nearest {@link ZamaProvider}.
|
|
354
329
|
*
|
|
355
330
|
* @param config - Token and optional wrapper addresses.
|
|
356
331
|
* @returns A memoized `Token` instance.
|
|
@@ -360,7 +335,7 @@ interface UseZamaConfig {
|
|
|
360
335
|
* const token = useToken({ tokenAddress: "0xToken", wrapperAddress: "0xWrapper" });
|
|
361
336
|
* ```
|
|
362
337
|
*/
|
|
363
|
-
declare function useToken(config: UseZamaConfig):
|
|
338
|
+
declare function useToken(config: UseZamaConfig): Token;
|
|
364
339
|
//#endregion
|
|
365
340
|
//#region src/token/use-readonly-token.d.ts
|
|
366
341
|
/**
|
|
@@ -377,58 +352,49 @@ declare function useToken(config: UseZamaConfig): _$_zama_fhe_sdk0.Token;
|
|
|
377
352
|
* // token.balanceOf(), token.isConfidential(), etc.
|
|
378
353
|
* ```
|
|
379
354
|
*/
|
|
380
|
-
declare function useReadonlyToken(address: Address
|
|
355
|
+
declare function useReadonlyToken(address: Address): _$_zama_fhe_sdk0.ReadonlyToken;
|
|
381
356
|
//#endregion
|
|
382
357
|
//#region src/balance/use-confidential-balance.d.ts
|
|
383
|
-
/** Configuration for {@link useConfidentialBalance}. */
|
|
384
358
|
interface UseConfidentialBalanceConfig {
|
|
385
359
|
/** Address of the confidential token contract. */
|
|
386
|
-
tokenAddress: Address
|
|
360
|
+
tokenAddress: Address;
|
|
361
|
+
/** Account to fetch balance for. The query is disabled while `undefined`. */
|
|
362
|
+
account: Address | undefined;
|
|
387
363
|
}
|
|
388
|
-
/** Query options for {@link useConfidentialBalance}. */
|
|
389
364
|
interface UseConfidentialBalanceOptions extends Omit<UseQueryOptions<bigint>, "queryKey" | "queryFn" | "enabled"> {
|
|
390
|
-
/**
|
|
365
|
+
/** Set this to `false` to disable this query from automatically running. */
|
|
391
366
|
enabled?: boolean;
|
|
392
367
|
}
|
|
393
368
|
/**
|
|
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.
|
|
369
|
+
* Hook for fetching a confidential token balance. Reads the on-chain handle and
|
|
370
|
+
* decrypts via the SDK; cached values are returned instantly and the relayer is
|
|
371
|
+
* only hit when the handle changes.
|
|
402
372
|
*
|
|
403
373
|
* @example
|
|
404
374
|
* ```tsx
|
|
405
|
-
* const { data: balance
|
|
406
|
-
* tokenAddress: "
|
|
375
|
+
* const { data: balance } = useConfidentialBalance({
|
|
376
|
+
* tokenAddress: "0xToken",
|
|
377
|
+
* account: "0xAccount",
|
|
407
378
|
* });
|
|
408
379
|
* ```
|
|
409
380
|
*/
|
|
410
381
|
declare function useConfidentialBalance(config: UseConfidentialBalanceConfig, options?: UseConfidentialBalanceOptions): _$_tanstack_react_query0.UseQueryResult<bigint, Error>;
|
|
411
382
|
//#endregion
|
|
412
383
|
//#region src/balance/use-confidential-balances.d.ts
|
|
413
|
-
/** Configuration for {@link useConfidentialBalances}. */
|
|
414
384
|
interface UseConfidentialBalancesConfig {
|
|
415
|
-
/** Addresses of the confidential token contracts to batch-query. */
|
|
416
|
-
tokenAddresses: Address
|
|
385
|
+
/** Addresses of the confidential token contracts to batch-query. The query is disabled while empty. */
|
|
386
|
+
tokenAddresses: Address[];
|
|
387
|
+
/** Account to fetch balances for. The query is disabled while `undefined`. */
|
|
388
|
+
account: Address | undefined;
|
|
417
389
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
/** Whether the query is enabled. Callback form is not supported in composite hooks. */
|
|
390
|
+
interface UseConfidentialBalancesOptions extends Omit<UseQueryOptions<BatchBalancesResult>, "queryKey" | "queryFn" | "enabled"> {
|
|
391
|
+
/** Set this to `false` to disable this query from automatically running. */
|
|
421
392
|
enabled?: boolean;
|
|
422
393
|
}
|
|
423
394
|
/**
|
|
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
|
-
*
|
|
395
|
+
* Hook for fetching multiple confidential token balances in batch. Returns
|
|
396
|
+
* partial results when some tokens fail — successful balances are available
|
|
397
|
+
* alongside per-token error information.
|
|
432
398
|
* @param config - Token addresses configuration.
|
|
433
399
|
* @param options - React Query options forwarded to the balance query.
|
|
434
400
|
* @returns The balance query result.
|
|
@@ -437,6 +403,7 @@ interface UseConfidentialBalancesOptions extends Omit<UseQueryOptions<BatchBalan
|
|
|
437
403
|
* ```tsx
|
|
438
404
|
* const { data } = useConfidentialBalances({
|
|
439
405
|
* tokenAddresses: ["0xTokenA", "0xTokenB"],
|
|
406
|
+
* account: "0xAccount",
|
|
440
407
|
* });
|
|
441
408
|
* const balance = data?.results.get("0xTokenA");
|
|
442
409
|
* if (data && data.errors.size > 0) {
|
|
@@ -444,7 +411,7 @@ interface UseConfidentialBalancesOptions extends Omit<UseQueryOptions<BatchBalan
|
|
|
444
411
|
* }
|
|
445
412
|
* ```
|
|
446
413
|
*/
|
|
447
|
-
declare function useConfidentialBalances(config: UseConfidentialBalancesConfig, options?: UseConfidentialBalancesOptions): _$_tanstack_react_query0.UseQueryResult<BatchBalancesResult
|
|
414
|
+
declare function useConfidentialBalances(config: UseConfidentialBalancesConfig, options?: UseConfidentialBalancesOptions): _$_tanstack_react_query0.UseQueryResult<BatchBalancesResult, Error>;
|
|
448
415
|
//#endregion
|
|
449
416
|
//#region src/transfer/use-confidential-transfer.d.ts
|
|
450
417
|
/** Configuration for {@link useConfidentialTransfer}. */
|
|
@@ -486,7 +453,7 @@ interface UseConfidentialTransferConfig extends UseZamaConfig {
|
|
|
486
453
|
* );
|
|
487
454
|
* ```
|
|
488
455
|
*/
|
|
489
|
-
declare function useConfidentialTransfer<TContext = unknown>(config: UseConfidentialTransferConfig, options?: UseMutationOptions<TransactionResult
|
|
456
|
+
declare function useConfidentialTransfer<TContext = unknown>(config: UseConfidentialTransferConfig, options?: UseMutationOptions<TransactionResult, Error, ConfidentialTransferParams, TContext>): UseMutationResult<TransactionResult, Error, ConfidentialTransferParams, TContext>;
|
|
490
457
|
//#endregion
|
|
491
458
|
//#region src/transfer/use-confidential-transfer-from.d.ts
|
|
492
459
|
/**
|
|
@@ -507,7 +474,7 @@ declare function useConfidentialTransfer<TContext = unknown>(config: UseConfiden
|
|
|
507
474
|
* transferFrom.mutate({ from: "0xOwner", to: "0xRecipient", amount: 500n });
|
|
508
475
|
* ```
|
|
509
476
|
*/
|
|
510
|
-
declare function useConfidentialTransferFrom(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
477
|
+
declare function useConfidentialTransferFrom(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ConfidentialTransferFromParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ConfidentialTransferFromParams, `0x${string}`>;
|
|
511
478
|
//#endregion
|
|
512
479
|
//#region src/transfer/use-confidential-approve.d.ts
|
|
513
480
|
/**
|
|
@@ -526,28 +493,27 @@ declare function useConfidentialTransferFrom(config: UseZamaConfig, options?: Us
|
|
|
526
493
|
* approve.mutate({ spender: "0xOperator" });
|
|
527
494
|
* ```
|
|
528
495
|
*/
|
|
529
|
-
declare function useConfidentialApprove(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
496
|
+
declare function useConfidentialApprove(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ConfidentialApproveParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ConfidentialApproveParams, `0x${string}`>;
|
|
530
497
|
//#endregion
|
|
531
498
|
//#region src/transfer/use-confidential-is-approved.d.ts
|
|
532
|
-
/** Configuration for {@link useConfidentialIsApproved}. */
|
|
533
499
|
interface UseConfidentialIsApprovedConfig {
|
|
534
|
-
/** Address of the confidential token contract.
|
|
535
|
-
tokenAddress: Address
|
|
536
|
-
/** Address to check approval for.
|
|
537
|
-
spender: Address
|
|
538
|
-
/** Token holder address.
|
|
539
|
-
holder
|
|
500
|
+
/** Address of the confidential token contract. The query is disabled while `undefined`. */
|
|
501
|
+
tokenAddress: Address | undefined;
|
|
502
|
+
/** Address to check approval for. The query is disabled while `undefined`. */
|
|
503
|
+
spender: Address | undefined;
|
|
504
|
+
/** Token holder address. The query is disabled while `undefined`. */
|
|
505
|
+
holder: Address | undefined;
|
|
540
506
|
}
|
|
541
|
-
|
|
542
|
-
|
|
507
|
+
interface UseConfidentialIsApprovedSuspenseConfig {
|
|
508
|
+
/** Address of the confidential token contract. */
|
|
509
|
+
tokenAddress: Address;
|
|
543
510
|
/** Address to check approval for. */
|
|
544
|
-
spender: Address
|
|
545
|
-
/** Token holder address.
|
|
546
|
-
holder
|
|
511
|
+
spender: Address;
|
|
512
|
+
/** Token holder address. */
|
|
513
|
+
holder: Address;
|
|
547
514
|
}
|
|
548
515
|
/**
|
|
549
|
-
* Check if a spender is an approved operator for a
|
|
550
|
-
*
|
|
516
|
+
* Check if a spender is an approved operator for a holder.
|
|
551
517
|
* @param config - Token address, spender, and optional holder to check.
|
|
552
518
|
* @param options - React Query options (forwarded to `useQuery`).
|
|
553
519
|
* @returns Query result with `data: boolean`.
|
|
@@ -557,24 +523,21 @@ interface UseConfidentialIsApprovedSuspenseConfig extends UseZamaConfig {
|
|
|
557
523
|
* const { data: isApproved } = useConfidentialIsApproved({
|
|
558
524
|
* tokenAddress: "0xToken",
|
|
559
525
|
* spender: "0xSpender",
|
|
560
|
-
* holder: "0xHolder",
|
|
526
|
+
* holder: "0xHolder",
|
|
561
527
|
* });
|
|
562
528
|
* ```
|
|
563
529
|
*/
|
|
564
530
|
declare function useConfidentialIsApproved(config: UseConfidentialIsApprovedConfig, options?: Omit<UseQueryOptions<boolean>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
565
531
|
/**
|
|
566
|
-
* Suspense variant of {@link useConfidentialIsApproved}.
|
|
567
|
-
*
|
|
568
|
-
*
|
|
569
|
-
* @param config - Token address, spender, and optional holder to check.
|
|
570
|
-
* @returns Suspense query result with `data: boolean`.
|
|
532
|
+
* Suspense variant of {@link useConfidentialIsApproved}. Suspends rendering
|
|
533
|
+
* until the approval check resolves.
|
|
571
534
|
*
|
|
572
535
|
* @example
|
|
573
536
|
* ```tsx
|
|
574
537
|
* const { data: isApproved } = useConfidentialIsApprovedSuspense({
|
|
575
538
|
* tokenAddress: "0xToken",
|
|
576
539
|
* spender: "0xSpender",
|
|
577
|
-
* holder: "0xHolder",
|
|
540
|
+
* holder: "0xHolder",
|
|
578
541
|
* });
|
|
579
542
|
* ```
|
|
580
543
|
*/
|
|
@@ -609,7 +572,7 @@ interface UseShieldConfig extends UseZamaConfig {
|
|
|
609
572
|
* shield.mutate({ amount: 1000n });
|
|
610
573
|
* ```
|
|
611
574
|
*/
|
|
612
|
-
declare function useShield<TContext = unknown>(config: UseShieldConfig, options?: UseMutationOptions<TransactionResult
|
|
575
|
+
declare function useShield<TContext = unknown>(config: UseShieldConfig, options?: UseMutationOptions<TransactionResult, Error, ShieldParams, TContext>): UseMutationResult<TransactionResult, Error, ShieldParams, TContext>;
|
|
613
576
|
//#endregion
|
|
614
577
|
//#region src/unwrap/use-unwrap.d.ts
|
|
615
578
|
/**
|
|
@@ -631,7 +594,7 @@ declare function useShield<TContext = unknown>(config: UseShieldConfig, options?
|
|
|
631
594
|
* unwrap.mutate({ amount: 500n });
|
|
632
595
|
* ```
|
|
633
596
|
*/
|
|
634
|
-
declare function useUnwrap(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
597
|
+
declare function useUnwrap(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, UnwrapParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, UnwrapParams, `0x${string}`>;
|
|
635
598
|
//#endregion
|
|
636
599
|
//#region src/unwrap/use-unwrap-all.d.ts
|
|
637
600
|
/**
|
|
@@ -652,7 +615,7 @@ declare function useUnwrap(config: UseZamaConfig, options?: UseMutationOptions<T
|
|
|
652
615
|
* unwrapAll.mutate();
|
|
653
616
|
* ```
|
|
654
617
|
*/
|
|
655
|
-
declare function useUnwrapAll(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
618
|
+
declare function useUnwrapAll(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, void, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, void, `0x${string}`>;
|
|
656
619
|
//#endregion
|
|
657
620
|
//#region src/unwrap/use-finalize-unwrap.d.ts
|
|
658
621
|
/**
|
|
@@ -670,10 +633,16 @@ declare function useUnwrapAll(config: UseZamaConfig, options?: UseMutationOption
|
|
|
670
633
|
* @example
|
|
671
634
|
* ```tsx
|
|
672
635
|
* const finalize = useFinalizeUnwrap({ tokenAddress: "0x..." });
|
|
673
|
-
*
|
|
636
|
+
* const event = findUnwrapRequested(receipt.logs);
|
|
637
|
+
* // Pass unwrapRequestId from upgraded events, or fall back to encryptedAmount for legacy ones.
|
|
638
|
+
* finalize.mutate(
|
|
639
|
+
* event.unwrapRequestId
|
|
640
|
+
* ? { unwrapRequestId: event.unwrapRequestId }
|
|
641
|
+
* : { burnAmountHandle: event.encryptedAmount },
|
|
642
|
+
* );
|
|
674
643
|
* ```
|
|
675
644
|
*/
|
|
676
|
-
declare function useFinalizeUnwrap(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
645
|
+
declare function useFinalizeUnwrap(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, FinalizeUnwrapParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, FinalizeUnwrapParams, `0x${string}`>;
|
|
677
646
|
//#endregion
|
|
678
647
|
//#region src/unshield/use-unshield.d.ts
|
|
679
648
|
/**
|
|
@@ -695,7 +664,7 @@ declare function useFinalizeUnwrap(config: UseZamaConfig, options?: UseMutationO
|
|
|
695
664
|
* unshield.mutate({ amount: 500n });
|
|
696
665
|
* ```
|
|
697
666
|
*/
|
|
698
|
-
declare function useUnshield(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
667
|
+
declare function useUnshield(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, UnshieldParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, UnshieldParams, `0x${string}`>;
|
|
699
668
|
//#endregion
|
|
700
669
|
//#region src/unshield/use-unshield-all.d.ts
|
|
701
670
|
/**
|
|
@@ -716,7 +685,7 @@ declare function useUnshield(config: UseZamaConfig, options?: UseMutationOptions
|
|
|
716
685
|
* unshieldAll.mutate();
|
|
717
686
|
* ```
|
|
718
687
|
*/
|
|
719
|
-
declare function useUnshieldAll(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
688
|
+
declare function useUnshieldAll(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, UnshieldAllParams | void, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, void | UnshieldAllParams, `0x${string}`>;
|
|
720
689
|
//#endregion
|
|
721
690
|
//#region src/unshield/use-resume-unshield.d.ts
|
|
722
691
|
/**
|
|
@@ -737,49 +706,53 @@ declare function useUnshieldAll(config: UseZamaConfig, options?: UseMutationOpti
|
|
|
737
706
|
* resumeUnshield.mutate({ unwrapTxHash: "0xabc..." });
|
|
738
707
|
* ```
|
|
739
708
|
*/
|
|
740
|
-
declare function useResumeUnshield(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
709
|
+
declare function useResumeUnshield(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ResumeUnshieldParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ResumeUnshieldParams, `0x${string}`>;
|
|
741
710
|
//#endregion
|
|
742
711
|
//#region src/shield/use-underlying-allowance.d.ts
|
|
743
|
-
/** Configuration for {@link useUnderlyingAllowance}. */
|
|
744
712
|
interface UseUnderlyingAllowanceConfig {
|
|
745
713
|
/** Address of the confidential token contract used to scope the query cache. */
|
|
746
|
-
tokenAddress: Address
|
|
714
|
+
tokenAddress: Address;
|
|
747
715
|
/** Address of the wrapper contract whose underlying ERC-20 allowance is checked. */
|
|
748
|
-
wrapperAddress: Address
|
|
716
|
+
wrapperAddress: Address;
|
|
717
|
+
/** Owner to fetch allowance for. The query is disabled while `undefined`. */
|
|
718
|
+
owner: Address | undefined;
|
|
719
|
+
}
|
|
720
|
+
interface UseUnderlyingAllowanceSuspenseConfig {
|
|
721
|
+
/** Address of the confidential token contract used to scope the query cache. */
|
|
722
|
+
tokenAddress: Address;
|
|
723
|
+
/** Address of the wrapper contract whose underlying ERC-20 allowance is checked. */
|
|
724
|
+
wrapperAddress: Address;
|
|
725
|
+
/** Owner to fetch allowance for. */
|
|
726
|
+
owner: Address;
|
|
749
727
|
}
|
|
750
728
|
/**
|
|
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).
|
|
729
|
+
* Hook for fetching the underlying ERC-20 allowance granted to the wrapper
|
|
730
|
+
* contract. Useful to check if an approval is needed before shielding.
|
|
757
731
|
*
|
|
758
732
|
* @example
|
|
759
733
|
* ```tsx
|
|
760
734
|
* const { data: allowance } = useUnderlyingAllowance({
|
|
761
735
|
* tokenAddress: "0xConfidentialToken",
|
|
762
736
|
* wrapperAddress: "0xWrapper",
|
|
737
|
+
* owner: "0xOwner",
|
|
763
738
|
* });
|
|
764
739
|
* ```
|
|
765
740
|
*/
|
|
766
741
|
declare function useUnderlyingAllowance(config: UseUnderlyingAllowanceConfig, options?: Omit<UseQueryOptions<bigint>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<bigint, Error>;
|
|
767
742
|
/**
|
|
768
|
-
* Suspense variant of {@link useUnderlyingAllowance}.
|
|
769
|
-
*
|
|
770
|
-
*
|
|
771
|
-
* @param config - Token and wrapper addresses.
|
|
772
|
-
* @returns Suspense query result with `data: bigint`.
|
|
743
|
+
* Suspense variant of {@link useUnderlyingAllowance}. Suspends rendering until
|
|
744
|
+
* the allowance resolves.
|
|
773
745
|
*
|
|
774
746
|
* @example
|
|
775
747
|
* ```tsx
|
|
776
748
|
* const { data: allowance } = useUnderlyingAllowanceSuspense({
|
|
777
749
|
* tokenAddress: "0xConfidentialToken",
|
|
778
750
|
* wrapperAddress: "0xWrapper",
|
|
751
|
+
* owner: "0xOwner",
|
|
779
752
|
* });
|
|
780
753
|
* ```
|
|
781
754
|
*/
|
|
782
|
-
declare function useUnderlyingAllowanceSuspense(config:
|
|
755
|
+
declare function useUnderlyingAllowanceSuspense(config: UseUnderlyingAllowanceSuspenseConfig): _$_tanstack_react_query0.UseSuspenseQueryResult<bigint, Error>;
|
|
783
756
|
//#endregion
|
|
784
757
|
//#region src/token/use-wrapper-discovery.d.ts
|
|
785
758
|
/** Configuration for {@link useWrapperDiscovery}. */
|
|
@@ -789,9 +762,9 @@ interface UseWrapperDiscoveryConfig {
|
|
|
789
762
|
* Used only to derive the signer context and to scope the query cache key —
|
|
790
763
|
* it does not affect which wrapper the registry returns.
|
|
791
764
|
*/
|
|
792
|
-
tokenAddress: Address
|
|
765
|
+
tokenAddress: Address;
|
|
793
766
|
/** ERC-20 address to discover the wrapper for. Pass `undefined` to disable the query. */
|
|
794
|
-
erc20Address: Address
|
|
767
|
+
erc20Address: Address | undefined;
|
|
795
768
|
}
|
|
796
769
|
/** Configuration for {@link useWrapperDiscoverySuspense}. */
|
|
797
770
|
interface UseWrapperDiscoverySuspenseConfig {
|
|
@@ -800,9 +773,9 @@ interface UseWrapperDiscoverySuspenseConfig {
|
|
|
800
773
|
* Used only to derive the signer context and to scope the query cache key —
|
|
801
774
|
* it does not affect which wrapper the registry returns.
|
|
802
775
|
*/
|
|
803
|
-
tokenAddress: Address
|
|
776
|
+
tokenAddress: Address;
|
|
804
777
|
/** ERC-20 address to discover the wrapper for. */
|
|
805
|
-
erc20Address: Address
|
|
778
|
+
erc20Address: Address;
|
|
806
779
|
}
|
|
807
780
|
/**
|
|
808
781
|
* Discover the confidential wrapper for an ERC-20 token via the on-chain registry.
|
|
@@ -821,7 +794,7 @@ interface UseWrapperDiscoverySuspenseConfig {
|
|
|
821
794
|
* });
|
|
822
795
|
* ```
|
|
823
796
|
*/
|
|
824
|
-
declare function useWrapperDiscovery(config: UseWrapperDiscoveryConfig, options?: Omit<UseQueryOptions<Address
|
|
797
|
+
declare function useWrapperDiscovery(config: UseWrapperDiscoveryConfig, options?: Omit<UseQueryOptions<Address | null>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<`0x${string}` | null, Error>;
|
|
825
798
|
/**
|
|
826
799
|
* Suspense variant of {@link useWrapperDiscovery}.
|
|
827
800
|
* Suspends rendering until the wrapper address is resolved.
|
|
@@ -854,7 +827,7 @@ declare function useWrapperDiscoverySuspense(config: UseWrapperDiscoverySuspense
|
|
|
854
827
|
* // metadata?.name, metadata?.symbol, metadata?.decimals
|
|
855
828
|
* ```
|
|
856
829
|
*/
|
|
857
|
-
declare function useMetadata(tokenAddress: Address
|
|
830
|
+
declare function useMetadata(tokenAddress: Address, options?: Omit<UseQueryOptions<TokenMetadata>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<TokenMetadata, Error>;
|
|
858
831
|
/**
|
|
859
832
|
* Suspense variant of {@link useMetadata}.
|
|
860
833
|
* Suspends rendering until metadata is loaded.
|
|
@@ -867,7 +840,7 @@ declare function useMetadata(tokenAddress: Address$1, options?: Omit<UseQueryOpt
|
|
|
867
840
|
* const { data: metadata } = useMetadataSuspense("0xToken");
|
|
868
841
|
* ```
|
|
869
842
|
*/
|
|
870
|
-
declare function useMetadataSuspense(tokenAddress: Address
|
|
843
|
+
declare function useMetadataSuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<TokenMetadata, Error>;
|
|
871
844
|
//#endregion
|
|
872
845
|
//#region src/delegation/use-delegate-decryption.d.ts
|
|
873
846
|
/**
|
|
@@ -882,7 +855,7 @@ declare function useMetadataSuspense(tokenAddress: Address$1): _$_tanstack_react
|
|
|
882
855
|
* delegate.mutate({ delegateAddress: "0xDelegate" });
|
|
883
856
|
* ```
|
|
884
857
|
*/
|
|
885
|
-
declare function useDelegateDecryption(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
858
|
+
declare function useDelegateDecryption(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, DelegateDecryptionParams>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, DelegateDecryptionParams, unknown>;
|
|
886
859
|
//#endregion
|
|
887
860
|
//#region src/delegation/use-revoke-delegation.d.ts
|
|
888
861
|
/**
|
|
@@ -897,16 +870,16 @@ declare function useDelegateDecryption(config: UseZamaConfig, options?: UseMutat
|
|
|
897
870
|
* revoke.mutate({ delegateAddress: "0xDelegate" });
|
|
898
871
|
* ```
|
|
899
872
|
*/
|
|
900
|
-
declare function useRevokeDelegation(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
873
|
+
declare function useRevokeDelegation(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, RevokeDelegationParams>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, RevokeDelegationParams, unknown>;
|
|
901
874
|
//#endregion
|
|
902
875
|
//#region src/delegation/use-delegation-status.d.ts
|
|
903
876
|
interface UseDelegationStatusConfig {
|
|
904
877
|
/** Address of the confidential token contract. Pass `undefined` to disable the query. */
|
|
905
|
-
tokenAddress: Address
|
|
878
|
+
tokenAddress: Address | undefined;
|
|
906
879
|
/** The address that granted the delegation. */
|
|
907
|
-
delegatorAddress?: Address
|
|
880
|
+
delegatorAddress?: Address;
|
|
908
881
|
/** The address that received delegation rights. */
|
|
909
|
-
delegateAddress?: Address
|
|
882
|
+
delegateAddress?: Address;
|
|
910
883
|
}
|
|
911
884
|
/**
|
|
912
885
|
* Query delegation status between a delegator and delegate for a token.
|
|
@@ -925,7 +898,7 @@ interface UseDelegationStatusConfig {
|
|
|
925
898
|
* // data?.isDelegated, data?.expiryTimestamp
|
|
926
899
|
* ```
|
|
927
900
|
*/
|
|
928
|
-
declare function useDelegationStatus(config: UseDelegationStatusConfig, options?: Omit<UseQueryOptions<DelegationStatusData
|
|
901
|
+
declare function useDelegationStatus(config: UseDelegationStatusConfig, options?: Omit<UseQueryOptions<DelegationStatusData>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<DelegationStatusData, Error>;
|
|
929
902
|
//#endregion
|
|
930
903
|
//#region src/delegation/use-decrypt-balance-as.d.ts
|
|
931
904
|
/**
|
|
@@ -941,7 +914,7 @@ declare function useDelegationStatus(config: UseDelegationStatusConfig, options?
|
|
|
941
914
|
* // decryptAs.data => 1000n
|
|
942
915
|
* ```
|
|
943
916
|
*/
|
|
944
|
-
declare function useDecryptBalanceAs(tokenAddress: Address
|
|
917
|
+
declare function useDecryptBalanceAs(tokenAddress: Address, options?: UseMutationOptions<bigint, Error, DecryptBalanceAsParams>): _$_tanstack_react_query0.UseMutationResult<bigint, Error, DecryptBalanceAsParams, unknown>;
|
|
945
918
|
//#endregion
|
|
946
919
|
//#region src/delegation/use-batch-decrypt-balances-as.d.ts
|
|
947
920
|
/**
|
|
@@ -959,7 +932,7 @@ declare function useDecryptBalanceAs(tokenAddress: Address$1, options?: UseMutat
|
|
|
959
932
|
* // batchDecryptAs.data => Map { "0xTokenA" => 100n, "0xTokenB" => 200n }
|
|
960
933
|
* ```
|
|
961
934
|
*/
|
|
962
|
-
declare function useBatchDecryptBalancesAs(tokens: ReadonlyToken
|
|
935
|
+
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
936
|
//#endregion
|
|
964
937
|
//#region src/shield/use-approve-underlying.d.ts
|
|
965
938
|
/**
|
|
@@ -981,7 +954,7 @@ declare function useBatchDecryptBalancesAs(tokens: ReadonlyToken$1[], options?:
|
|
|
981
954
|
* approve.mutate({ amount: 1000n }); // exact amount
|
|
982
955
|
* ```
|
|
983
956
|
*/
|
|
984
|
-
declare function useApproveUnderlying(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult
|
|
957
|
+
declare function useApproveUnderlying(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ApproveUnderlyingParams, Address>): _$_tanstack_react_query0.UseMutationResult<TransactionResult, Error, ApproveUnderlyingParams, `0x${string}`>;
|
|
985
958
|
//#endregion
|
|
986
959
|
//#region src/token/use-is-confidential.d.ts
|
|
987
960
|
/**
|
|
@@ -997,7 +970,7 @@ declare function useApproveUnderlying(config: UseZamaConfig, options?: UseMutati
|
|
|
997
970
|
* const { data: isConfidential } = useIsConfidential("0xToken");
|
|
998
971
|
* ```
|
|
999
972
|
*/
|
|
1000
|
-
declare function useIsConfidential(tokenAddress: Address
|
|
973
|
+
declare function useIsConfidential(tokenAddress: Address, options?: Omit<UseQueryOptions<boolean>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
1001
974
|
/**
|
|
1002
975
|
* Suspense variant of {@link useIsConfidential}.
|
|
1003
976
|
* Suspends rendering until the ERC-165 check resolves.
|
|
@@ -1010,7 +983,7 @@ declare function useIsConfidential(tokenAddress: Address$1, options?: Omit<UseQu
|
|
|
1010
983
|
* const { data: isConfidential } = useIsConfidentialSuspense("0xToken");
|
|
1011
984
|
* ```
|
|
1012
985
|
*/
|
|
1013
|
-
declare function useIsConfidentialSuspense(tokenAddress: Address
|
|
986
|
+
declare function useIsConfidentialSuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<boolean, Error>;
|
|
1014
987
|
/**
|
|
1015
988
|
* Check if a token supports the ERC-7984 wrapper interface via ERC-165.
|
|
1016
989
|
* Result is cached indefinitely since interface support does not change.
|
|
@@ -1024,7 +997,7 @@ declare function useIsConfidentialSuspense(tokenAddress: Address$1): _$_tanstack
|
|
|
1024
997
|
* const { data: isWrapper } = useIsWrapper("0xToken");
|
|
1025
998
|
* ```
|
|
1026
999
|
*/
|
|
1027
|
-
declare function useIsWrapper(tokenAddress: Address
|
|
1000
|
+
declare function useIsWrapper(tokenAddress: Address, options?: Omit<UseQueryOptions<boolean>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
1028
1001
|
/**
|
|
1029
1002
|
* Suspense variant of {@link useIsWrapper}.
|
|
1030
1003
|
* Suspends rendering until the ERC-165 check resolves.
|
|
@@ -1037,7 +1010,7 @@ declare function useIsWrapper(tokenAddress: Address$1, options?: Omit<UseQueryOp
|
|
|
1037
1010
|
* const { data: isWrapper } = useIsWrapperSuspense("0xToken");
|
|
1038
1011
|
* ```
|
|
1039
1012
|
*/
|
|
1040
|
-
declare function useIsWrapperSuspense(tokenAddress: Address
|
|
1013
|
+
declare function useIsWrapperSuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<boolean, Error>;
|
|
1041
1014
|
//#endregion
|
|
1042
1015
|
//#region src/token/use-total-supply.d.ts
|
|
1043
1016
|
/**
|
|
@@ -1047,32 +1020,35 @@ declare function useIsWrapperSuspense(tokenAddress: Address$1): _$_tanstack_reac
|
|
|
1047
1020
|
* @param tokenAddress - Address of the token contract.
|
|
1048
1021
|
* @param options - React Query options (forwarded to `useQuery`).
|
|
1049
1022
|
* @returns Query result with `data: bigint`.
|
|
1023
|
+
* Uses ERC-165 to call `inferredTotalSupply()` on upgraded wrappers and
|
|
1024
|
+
* legacy `totalSupply()` on pre-upgrade wrappers.
|
|
1050
1025
|
*
|
|
1051
1026
|
* @example
|
|
1052
1027
|
* ```tsx
|
|
1053
1028
|
* const { data: totalSupply } = useTotalSupply("0xToken");
|
|
1054
1029
|
* ```
|
|
1055
1030
|
*/
|
|
1056
|
-
declare function useTotalSupply(tokenAddress: Address
|
|
1031
|
+
declare function useTotalSupply(tokenAddress: Address, options?: Omit<UseQueryOptions<bigint>, "queryKey" | "queryFn">): _$_tanstack_react_query0.UseQueryResult<bigint, Error>;
|
|
1057
1032
|
/**
|
|
1058
1033
|
* Suspense variant of {@link useTotalSupply}.
|
|
1059
1034
|
* Suspends rendering until the total supply is loaded.
|
|
1060
1035
|
*
|
|
1061
1036
|
* @param tokenAddress - Address of the token contract.
|
|
1062
1037
|
* @returns Suspense query result with `data: bigint`.
|
|
1038
|
+
* Uses ERC-165 to call `inferredTotalSupply()` on upgraded wrappers and
|
|
1039
|
+
* legacy `totalSupply()` on pre-upgrade wrappers.
|
|
1063
1040
|
*
|
|
1064
1041
|
* @example
|
|
1065
1042
|
* ```tsx
|
|
1066
1043
|
* const { data: totalSupply } = useTotalSupplySuspense("0xToken");
|
|
1067
1044
|
* ```
|
|
1068
1045
|
*/
|
|
1069
|
-
declare function useTotalSupplySuspense(tokenAddress: Address
|
|
1046
|
+
declare function useTotalSupplySuspense(tokenAddress: Address): _$_tanstack_react_query0.UseSuspenseQueryResult<bigint, Error>;
|
|
1070
1047
|
//#endregion
|
|
1071
1048
|
//#region src/wrappers-registry/use-wrappers-registry-address.d.ts
|
|
1072
1049
|
/**
|
|
1073
1050
|
* Resolves the wrappers registry address for the current chain.
|
|
1074
|
-
* Uses the
|
|
1075
|
-
* plus any `registryAddresses` overrides passed to `ZamaSDKConfig`).
|
|
1051
|
+
* Uses the registry addresses from `sdk.registry` (built-in defaults from chain configs).
|
|
1076
1052
|
*
|
|
1077
1053
|
* Returns `undefined` when the chain ID hasn't been fetched yet
|
|
1078
1054
|
* or when no registry is configured for the connected chain.
|
|
@@ -1080,14 +1056,14 @@ declare function useTotalSupplySuspense(tokenAddress: Address$1): _$_tanstack_re
|
|
|
1080
1056
|
* The chain ID is cached for 30 seconds (`staleTime`), so chain
|
|
1081
1057
|
* switches may take up to 30s to reflect.
|
|
1082
1058
|
*/
|
|
1083
|
-
declare function useWrappersRegistryAddress(): Address
|
|
1059
|
+
declare function useWrappersRegistryAddress(): Address | undefined;
|
|
1084
1060
|
//#endregion
|
|
1085
1061
|
//#region src/wrappers-registry/use-token-pairs-registry.d.ts
|
|
1086
1062
|
/**
|
|
1087
1063
|
* Fetches all token wrapper pairs from the ConfidentialTokenWrappersRegistry
|
|
1088
1064
|
* contract on the current chain.
|
|
1089
1065
|
*/
|
|
1090
|
-
declare function useTokenPairsRegistry(): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair
|
|
1066
|
+
declare function useTokenPairsRegistry(): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair[], Error>;
|
|
1091
1067
|
//#endregion
|
|
1092
1068
|
//#region src/wrappers-registry/use-token-pairs-length.d.ts
|
|
1093
1069
|
/**
|
|
@@ -1108,7 +1084,7 @@ declare function useTokenPairsSlice({
|
|
|
1108
1084
|
}: {
|
|
1109
1085
|
fromIndex: bigint | undefined;
|
|
1110
1086
|
toIndex: bigint | undefined;
|
|
1111
|
-
}): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair
|
|
1087
|
+
}): _$_tanstack_react_query0.UseQueryResult<readonly TokenWrapperPair[], Error>;
|
|
1112
1088
|
//#endregion
|
|
1113
1089
|
//#region src/wrappers-registry/use-token-pair.d.ts
|
|
1114
1090
|
/**
|
|
@@ -1120,7 +1096,7 @@ declare function useTokenPair({
|
|
|
1120
1096
|
index
|
|
1121
1097
|
}: {
|
|
1122
1098
|
index: bigint | undefined;
|
|
1123
|
-
}): _$_tanstack_react_query0.UseQueryResult<TokenWrapperPair
|
|
1099
|
+
}): _$_tanstack_react_query0.UseQueryResult<TokenWrapperPair, Error>;
|
|
1124
1100
|
//#endregion
|
|
1125
1101
|
//#region src/wrappers-registry/use-confidential-token-address.d.ts
|
|
1126
1102
|
/**
|
|
@@ -1129,7 +1105,7 @@ declare function useTokenPair({
|
|
|
1129
1105
|
declare function useConfidentialTokenAddress({
|
|
1130
1106
|
tokenAddress
|
|
1131
1107
|
}: {
|
|
1132
|
-
tokenAddress: Address
|
|
1108
|
+
tokenAddress: Address | undefined;
|
|
1133
1109
|
}): _$_tanstack_react_query0.UseQueryResult<readonly [boolean, `0x${string}`], Error>;
|
|
1134
1110
|
//#endregion
|
|
1135
1111
|
//#region src/wrappers-registry/use-token-address.d.ts
|
|
@@ -1139,7 +1115,7 @@ declare function useConfidentialTokenAddress({
|
|
|
1139
1115
|
declare function useTokenAddress({
|
|
1140
1116
|
confidentialTokenAddress
|
|
1141
1117
|
}: {
|
|
1142
|
-
confidentialTokenAddress: Address
|
|
1118
|
+
confidentialTokenAddress: Address | undefined;
|
|
1143
1119
|
}): _$_tanstack_react_query0.UseQueryResult<readonly [boolean, `0x${string}`], Error>;
|
|
1144
1120
|
//#endregion
|
|
1145
1121
|
//#region src/wrappers-registry/use-is-confidential-token-valid.d.ts
|
|
@@ -1152,7 +1128,7 @@ declare function useTokenAddress({
|
|
|
1152
1128
|
declare function useIsConfidentialTokenValid({
|
|
1153
1129
|
confidentialTokenAddress
|
|
1154
1130
|
}: {
|
|
1155
|
-
confidentialTokenAddress: Address
|
|
1131
|
+
confidentialTokenAddress: Address | undefined;
|
|
1156
1132
|
}): _$_tanstack_react_query0.UseQueryResult<boolean, Error>;
|
|
1157
1133
|
//#endregion
|
|
1158
1134
|
//#region src/wrappers-registry/use-list-pairs.d.ts
|
|
@@ -1177,15 +1153,7 @@ declare function useListPairs({
|
|
|
1177
1153
|
page?: number;
|
|
1178
1154
|
pageSize?: number;
|
|
1179
1155
|
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
|
-
}
|
|
1156
|
+
}): _$_tanstack_react_query0.UseQueryResult<PaginatedResult<TokenWrapperPair | TokenWrapperPairWithMetadata>, Error>;
|
|
1189
1157
|
//#endregion
|
|
1190
|
-
export {
|
|
1158
|
+
export { type UseConfidentialBalanceConfig, type UseConfidentialBalanceOptions, type UseConfidentialBalancesConfig, type UseConfidentialBalancesOptions, type UseConfidentialIsApprovedConfig, type UseConfidentialIsApprovedSuspenseConfig, 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, useConfidentialApprove, useConfidentialBalance, useConfidentialBalances, useConfidentialIsApproved, useConfidentialIsApprovedSuspense, 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, useSignerAddress, useSignerAddressSuspense, useToken, useTokenAddress, useTokenPair, useTokenPairsLength, useTokenPairsRegistry, useTokenPairsSlice, useTotalSupply, useTotalSupplySuspense, useUnderlyingAllowance, useUnderlyingAllowanceSuspense, useUnshield, useUnshieldAll, useUnwrap, useUnwrapAll, useUserDecrypt, useWrapperDiscovery, useWrapperDiscoverySuspense, useWrappersRegistryAddress, useZamaSDK };
|
|
1191
1159
|
//# sourceMappingURL=index.d.ts.map
|