@zama-fhe/react-sdk 1.0.0-alpha.13 → 1.0.0-alpha.15
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 +18 -28
- package/dist/index.d.ts +88 -671
- package/dist/index.js +343 -704
- package/dist/index.js.map +1 -1
- package/dist/wagmi/index.d.ts +4 -4
- package/dist/wagmi/index.js +7 -7
- package/dist/wagmi/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as _zama_fhe_sdk from '@zama-fhe/sdk';
|
|
3
|
-
import { RelayerSDK, GenericSigner, GenericStorage, ZamaSDKEventListener, ZamaSDK,
|
|
4
|
-
export { ActivityAmount, ActivityDirection, ActivityItem, ActivityLogMetadata, ActivityType, Address, ApprovalFailedError, ApproveSubmittedEvent, ApproveUnderlyingSubmittedEvent, BATCH_SWAP_ABI, BaseEvent, BatchDecryptOptions, BatchTransferData, ChromeSessionStorage, ConfidentialTransferEvent,
|
|
3
|
+
import { RelayerSDK, GenericSigner, GenericStorage, ZamaSDKEventListener, ZamaSDK, EncryptResult, EncryptParams, ClearValueType, UserDecryptParams, PublicDecryptResult, KeypairType, EIP712TypedData, Address, DelegatedUserDecryptParams, ZKProofLike, Handle, Hex, TransactionResult, RawLog, ActivityLogMetadata, ActivityItem } from '@zama-fhe/sdk';
|
|
4
|
+
export { ActivityAmount, ActivityDirection, ActivityItem, ActivityLogMetadata, ActivityType, Address, ApprovalFailedError, ApproveSubmittedEvent, ApproveUnderlyingSubmittedEvent, BATCH_SWAP_ABI, BaseEvent, BatchDecryptOptions, BatchTransferData, ChromeSessionStorage, ClearValueType, ConfidentialTransferEvent, ContractAbi, CredentialsAllowedEvent, CredentialsCachedEvent, CredentialsCreatedEvent, CredentialsCreatingEvent, CredentialsExpiredEvent, CredentialsLoadingEvent, CredentialsManager, CredentialsManagerConfig, CredentialsRevokedEvent, DEPLOYMENT_COORDINATOR_ABI, DecryptEndEvent, DecryptErrorEvent, DecryptStartEvent, DecryptionFailedError, DelegatedUserDecryptParams, EIP712TypedData, ENCRYPTION_ABI, ERC165_ABI, ERC20_ABI, ERC20_METADATA_ABI, ERC7984_INTERFACE_ID, ERC7984_WRAPPER_INTERFACE_ID, EncryptEndEvent, EncryptErrorEvent, EncryptInput, EncryptParams, EncryptResult, EncryptStartEvent, EncryptionFailedError, FEE_MANAGER_ABI, FheTypeName, FhevmInstanceConfig, FinalizeUnwrapSubmittedEvent, GenericSigner, GenericStorage, Handle, HardhatConfig, Hex, IndexedDBStorage, InputProofBytesType, InvalidKeypairError, KeypairExpiredError, KeypairType, KmsDelegatedUserDecryptEIP712Type, MainnetConfig, MemoryStorage, NetworkType, NoCiphertextError, OnChainEvent, PublicDecryptResult, RawLog, ReadContractArgs, ReadContractConfig, ReadContractReturnType, ReadFunctionName, ReadonlyToken, ReadonlyTokenConfig, RelayerRequestFailedError, RelayerSDK, RelayerSDKStatus, RelayerWeb, RelayerWebConfig, RelayerWebSecurityConfig, SepoliaConfig, SessionExpiredEvent, ShieldCallbacks, ShieldSubmittedEvent, SigningFailedError, SigningRejectedError, StoredCredentials, TOKEN_TOPICS, TRANSFER_BATCHER_ABI, Token, TokenConfig, Topics, TransactionErrorEvent, TransactionReceipt, TransactionResult, TransactionRevertedError, TransferCallbacks, TransferFromSubmittedEvent, TransferSubmittedEvent, UnshieldCallbacks, UnshieldPhase1SubmittedEvent, UnshieldPhase2StartedEvent, UnshieldPhase2SubmittedEvent, UnwrapRequestedEvent, UnwrapSubmittedEvent, UnwrappedFinalizedEvent, UnwrappedStartedEvent, UserDecryptParams, WRAPPER_ABI, WrappedEvent, WriteContractArgs, WriteContractConfig, WriteFunctionName, ZERO_HANDLE, ZKProofLike, ZamaError, ZamaErrorCode, ZamaSDK, ZamaSDKConfig, ZamaSDKEvent, ZamaSDKEventInput, ZamaSDKEventListener, ZamaSDKEventType, ZamaSDKEvents, allowanceContract, applyDecryptedValues, approveContract, balanceOfContract, chromeSessionStorage, clearPendingUnshield, confidentialBalanceOfContract, confidentialBatchTransferContract, confidentialTotalSupplyContract, confidentialTransferContract, confidentialTransferFromContract, decimalsContract, decodeConfidentialTransfer, decodeOnChainEvent, decodeOnChainEvents, decodeUnwrapRequested, decodeUnwrappedFinalized, decodeUnwrappedStarted, decodeWrapped, deploymentCoordinatorContract, extractEncryptedHandles, finalizeUnwrapContract, findUnwrapRequested, findWrapped, getBatchTransferFeeContract, getFeeRecipientContract, getUnwrapFeeContract, getWrapFeeContract, getWrapperContract, indexedDBStorage, isConfidentialTokenContract, isConfidentialWrapperContract, isFinalizeUnwrapOperatorContract, isOperatorContract, loadPendingUnshield, matchZamaError, nameContract, parseActivityFeed, rateContract, savePendingUnshield, setFinalizeUnwrapOperatorContract, setOperatorContract, sortByBlockNumber, supportsInterfaceContract, symbolContract, totalSupplyContract, underlyingContract, unwrapContract, unwrapFromBalanceContract, wrapContract, wrapETHContract, wrapperExistsContract } from '@zama-fhe/sdk';
|
|
5
5
|
import { PropsWithChildren } from 'react';
|
|
6
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
|
-
import { UseQueryOptions, UseMutationOptions,
|
|
7
|
+
import { UseQueryOptions, UseMutationOptions, QueryKey } from '@tanstack/react-query';
|
|
8
8
|
import * as _zama_fhe_relayer_sdk_web from '@zama-fhe/relayer-sdk/web';
|
|
9
|
+
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
10
|
+
import { ConfidentialBalancesData, ConfidentialTransferParams, ConfidentialTransferFromParams, ConfidentialApproveParams, ShieldParams, ShieldETHParams, UnwrapParams, FinalizeUnwrapParams, UnshieldParams, UnshieldAllParams, ResumeUnshieldParams, TokenMetadata, ApproveUnderlyingParams } from '@zama-fhe/sdk/query';
|
|
11
|
+
export { ApproveUnderlyingParams, ConfidentialApproveParams, ConfidentialBalancesData, ConfidentialTransferFromParams, ConfidentialTransferParams, FinalizeUnwrapParams, ResumeUnshieldParams, ShieldETHParams, ShieldParams, TokenMetadata, UnshieldAllParams, UnshieldParams, UnwrapParams, activityFeedQueryOptions, allowMutationOptions, approveUnderlyingMutationOptions, batchTransferFeeQueryOptions, confidentialApproveMutationOptions, confidentialBalanceQueryOptions, confidentialBalancesQueryOptions, confidentialHandleQueryOptions, confidentialHandlesQueryOptions, confidentialIsApprovedQueryOptions, confidentialTransferFromMutationOptions, confidentialTransferMutationOptions, encryptMutationOptions, feeRecipientQueryOptions, filterQueryOptions, finalizeUnwrapMutationOptions, hashFn, isAllowedQueryOptions, isConfidentialQueryOptions, isWrapperQueryOptions, publicKeyQueryOptions, publicParamsQueryOptions, resumeUnshieldMutationOptions, revokeMutationOptions, revokeSessionMutationOptions, shieldETHMutationOptions, shieldFeeQueryOptions, shieldMutationOptions, signerAddressQueryOptions, tokenMetadataQueryOptions, totalSupplyQueryOptions, underlyingAllowanceQueryOptions, unshieldAllMutationOptions, unshieldFeeQueryOptions, unshieldMutationOptions, unwrapAllMutationOptions, unwrapMutationOptions, wrapperDiscoveryQueryOptions, zamaQueryKeys } from '@zama-fhe/sdk/query';
|
|
9
12
|
|
|
10
13
|
/** Props for {@link ZamaProvider}. */
|
|
11
14
|
interface ZamaProviderProps extends PropsWithChildren {
|
|
@@ -58,16 +61,6 @@ declare function ZamaProvider({ children, relayer, signer, storage, sessionStora
|
|
|
58
61
|
*/
|
|
59
62
|
declare function useZamaSDK(): ZamaSDK;
|
|
60
63
|
|
|
61
|
-
/**
|
|
62
|
-
* TanStack Query mutation options factory for FHE encrypt.
|
|
63
|
-
*
|
|
64
|
-
* @param sdk - A `ZamaSDK` instance.
|
|
65
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
66
|
-
*/
|
|
67
|
-
declare function encryptMutationOptions(sdk: ZamaSDK): {
|
|
68
|
-
mutationKey: readonly ["encrypt"];
|
|
69
|
-
mutationFn: (params: EncryptParams) => Promise<EncryptResult>;
|
|
70
|
-
};
|
|
71
64
|
/**
|
|
72
65
|
* Encrypt a plaintext value using FHE.
|
|
73
66
|
* Calls the relayer's `encrypt` method via a mutation.
|
|
@@ -91,7 +84,7 @@ declare function useEncrypt(): _tanstack_react_query.UseMutationResult<EncryptRe
|
|
|
91
84
|
* On success, populates the decryption cache so useUserDecryptedValue/useUserDecryptedValues
|
|
92
85
|
* can read the results.
|
|
93
86
|
*/
|
|
94
|
-
declare function useUserDecrypt(): _tanstack_react_query.UseMutationResult<Record
|
|
87
|
+
declare function useUserDecrypt(): _tanstack_react_query.UseMutationResult<Record<`0x${string}`, ClearValueType>, Error, UserDecryptParams, unknown>;
|
|
95
88
|
|
|
96
89
|
/**
|
|
97
90
|
* Decrypt FHE ciphertext handles using the network public key (no credential needed).
|
|
@@ -107,7 +100,7 @@ declare function useUserDecrypt(): _tanstack_react_query.UseMutationResult<Recor
|
|
|
107
100
|
* // publicDecrypt.data?.clearValues => { "0xHandle1": 500n, ... }
|
|
108
101
|
* ```
|
|
109
102
|
*/
|
|
110
|
-
declare function usePublicDecrypt(): _tanstack_react_query.UseMutationResult<PublicDecryptResult, Error, string[], unknown>;
|
|
103
|
+
declare function usePublicDecrypt(): _tanstack_react_query.UseMutationResult<PublicDecryptResult, Error, `0x${string}`[], unknown>;
|
|
111
104
|
|
|
112
105
|
/**
|
|
113
106
|
* Generate an FHE keypair via the relayer.
|
|
@@ -122,7 +115,7 @@ declare function usePublicDecrypt(): _tanstack_react_query.UseMutationResult<Pub
|
|
|
122
115
|
* // generateKeypair.data?.publicKey, generateKeypair.data?.privateKey
|
|
123
116
|
* ```
|
|
124
117
|
*/
|
|
125
|
-
declare function useGenerateKeypair(): _tanstack_react_query.UseMutationResult<
|
|
118
|
+
declare function useGenerateKeypair(): _tanstack_react_query.UseMutationResult<KeypairType<string>, Error, void, unknown>;
|
|
126
119
|
|
|
127
120
|
/** Parameters for {@link useCreateEIP712}. */
|
|
128
121
|
interface CreateEIP712Params {
|
|
@@ -203,7 +196,7 @@ declare function useCreateDelegatedUserDecryptEIP712(): _tanstack_react_query.Us
|
|
|
203
196
|
* // decrypt.data => { "0xHandle1": 1000n }
|
|
204
197
|
* ```
|
|
205
198
|
*/
|
|
206
|
-
declare function useDelegatedUserDecrypt(): _tanstack_react_query.UseMutationResult<Record
|
|
199
|
+
declare function useDelegatedUserDecrypt(): _tanstack_react_query.UseMutationResult<Record<`0x${string}`, ClearValueType>, Error, DelegatedUserDecryptParams, unknown>;
|
|
207
200
|
|
|
208
201
|
/**
|
|
209
202
|
* Submit a ZK proof for on-chain verification.
|
|
@@ -223,14 +216,6 @@ declare function useRequestZKProofVerification(): _tanstack_react_query.UseMutat
|
|
|
223
216
|
inputProof: Uint8Array;
|
|
224
217
|
}>, Error, ZKProofLike, unknown>;
|
|
225
218
|
|
|
226
|
-
/**
|
|
227
|
-
* Query key factory for the FHE public key query.
|
|
228
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
229
|
-
*/
|
|
230
|
-
declare const publicKeyQueryKeys: {
|
|
231
|
-
/** Match the public key query. */
|
|
232
|
-
readonly all: readonly ["publicKey"];
|
|
233
|
-
};
|
|
234
219
|
/** Shape of the FHE public key data returned by the relayer. */
|
|
235
220
|
interface PublicKeyData {
|
|
236
221
|
/** Unique identifier for this public key version. */
|
|
@@ -238,18 +223,6 @@ interface PublicKeyData {
|
|
|
238
223
|
/** The raw FHE public key bytes. */
|
|
239
224
|
publicKey: Uint8Array;
|
|
240
225
|
}
|
|
241
|
-
type PublicKeyResult = PublicKeyData | null;
|
|
242
|
-
/**
|
|
243
|
-
* TanStack Query options factory for the FHE public key.
|
|
244
|
-
*
|
|
245
|
-
* @param sdk - A `ZamaSDK` instance.
|
|
246
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
247
|
-
*/
|
|
248
|
-
declare function publicKeyQueryOptions(sdk: ZamaSDK): {
|
|
249
|
-
readonly queryKey: readonly ["publicKey"];
|
|
250
|
-
readonly queryFn: () => Promise<PublicKeyResult>;
|
|
251
|
-
readonly staleTime: number;
|
|
252
|
-
};
|
|
253
226
|
/**
|
|
254
227
|
* Fetch the FHE network public key from the relayer.
|
|
255
228
|
* Cached indefinitely since the key does not change during a session.
|
|
@@ -262,18 +235,11 @@ declare function publicKeyQueryOptions(sdk: ZamaSDK): {
|
|
|
262
235
|
* // publicKey?.publicKeyId, publicKey?.publicKey
|
|
263
236
|
* ```
|
|
264
237
|
*/
|
|
265
|
-
declare function usePublicKey(): _tanstack_react_query.UseQueryResult<
|
|
238
|
+
declare function usePublicKey(): _tanstack_react_query.UseQueryResult<{
|
|
239
|
+
publicKeyId: string;
|
|
240
|
+
publicKey: Uint8Array;
|
|
241
|
+
} | null, Error>;
|
|
266
242
|
|
|
267
|
-
/**
|
|
268
|
-
* Query key factory for FHE public params queries.
|
|
269
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
270
|
-
*/
|
|
271
|
-
declare const publicParamsQueryKeys: {
|
|
272
|
-
/** Match all public params queries. */
|
|
273
|
-
readonly all: readonly ["publicParams"];
|
|
274
|
-
/** Match public params query for a specific bit size. */
|
|
275
|
-
readonly bits: (bits: number) => readonly ["publicParams", number];
|
|
276
|
-
};
|
|
277
243
|
/** Shape of the FHE public parameters returned by the relayer. */
|
|
278
244
|
interface PublicParamsData {
|
|
279
245
|
/** The raw public parameters bytes (WASM-ready). */
|
|
@@ -281,19 +247,6 @@ interface PublicParamsData {
|
|
|
281
247
|
/** Unique identifier for this public params version. */
|
|
282
248
|
publicParamsId: string;
|
|
283
249
|
}
|
|
284
|
-
type PublicParamsResult = PublicParamsData | null;
|
|
285
|
-
/**
|
|
286
|
-
* TanStack Query options factory for FHE public parameters.
|
|
287
|
-
*
|
|
288
|
-
* @param sdk - A `ZamaSDK` instance.
|
|
289
|
-
* @param bits - The FHE bit size to fetch parameters for (e.g. 2048).
|
|
290
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
291
|
-
*/
|
|
292
|
-
declare function publicParamsQueryOptions(sdk: ZamaSDK, bits: number): {
|
|
293
|
-
readonly queryKey: readonly ["publicParams", number];
|
|
294
|
-
readonly queryFn: () => Promise<PublicParamsResult>;
|
|
295
|
-
readonly staleTime: number;
|
|
296
|
-
};
|
|
297
250
|
/**
|
|
298
251
|
* Fetch FHE public parameters for a given bit size from the relayer.
|
|
299
252
|
* Cached indefinitely since parameters do not change during a session.
|
|
@@ -307,11 +260,14 @@ declare function publicParamsQueryOptions(sdk: ZamaSDK, bits: number): {
|
|
|
307
260
|
* // params?.publicParams, params?.publicParamsId
|
|
308
261
|
* ```
|
|
309
262
|
*/
|
|
310
|
-
declare function usePublicParams(bits: number): _tanstack_react_query.UseQueryResult<
|
|
263
|
+
declare function usePublicParams(bits: number): _tanstack_react_query.UseQueryResult<{
|
|
264
|
+
publicParams: Uint8Array;
|
|
265
|
+
publicParamsId: string;
|
|
266
|
+
} | null, Error>;
|
|
311
267
|
|
|
312
268
|
/** A handle to decrypt, paired with its originating contract address. */
|
|
313
269
|
interface DecryptHandle {
|
|
314
|
-
handle:
|
|
270
|
+
handle: Handle;
|
|
315
271
|
contractAddress: Address;
|
|
316
272
|
}
|
|
317
273
|
/** Parameters for {@link useUserDecryptFlow}. */
|
|
@@ -330,7 +286,7 @@ interface UserDecryptFlowCallbacks {
|
|
|
330
286
|
/** Fired after the wallet signature is obtained. */
|
|
331
287
|
onSigned?: (signature: Hex) => void;
|
|
332
288
|
/** Fired after decryption completes. */
|
|
333
|
-
onDecrypted?: (values: Record<
|
|
289
|
+
onDecrypted?: (values: Record<Handle, ClearValueType>) => void;
|
|
334
290
|
}
|
|
335
291
|
/** Configuration for {@link useUserDecryptFlow}. */
|
|
336
292
|
interface UseUserDecryptFlowConfig {
|
|
@@ -358,21 +314,21 @@ interface UseUserDecryptFlowConfig {
|
|
|
358
314
|
* });
|
|
359
315
|
* ```
|
|
360
316
|
*/
|
|
361
|
-
declare function useUserDecryptFlow(config?: UseUserDecryptFlowConfig): _tanstack_react_query.UseMutationResult<Record
|
|
317
|
+
declare function useUserDecryptFlow(config?: UseUserDecryptFlowConfig): _tanstack_react_query.UseMutationResult<Record<`0x${string}`, ClearValueType>, Error, UserDecryptFlowParams, unknown>;
|
|
362
318
|
|
|
363
319
|
/**
|
|
364
320
|
* Look up a single cached decrypted value by its handle.
|
|
365
321
|
* Values are populated automatically when useUserDecrypt or usePublicDecrypt succeed.
|
|
366
322
|
* You can also populate manually via queryClient.setQueryData(decryptionKeys.value(handle), value).
|
|
367
323
|
*/
|
|
368
|
-
declare function useUserDecryptedValue(handle:
|
|
324
|
+
declare function useUserDecryptedValue(handle: Handle | undefined): _tanstack_react_query.UseQueryResult<ClearValueType, Error>;
|
|
369
325
|
|
|
370
326
|
/**
|
|
371
327
|
* Look up multiple cached decrypted values by their handles.
|
|
372
328
|
* Values are populated automatically when useUserDecrypt or usePublicDecrypt succeed.
|
|
373
329
|
*/
|
|
374
|
-
declare function useUserDecryptedValues(handles:
|
|
375
|
-
data: Record
|
|
330
|
+
declare function useUserDecryptedValues(handles: Handle[]): {
|
|
331
|
+
data: Partial<Record<`0x${string}`, ClearValueType | undefined>>;
|
|
376
332
|
results: _tanstack_react_query.UseQueryResult<never, Error>[];
|
|
377
333
|
};
|
|
378
334
|
|
|
@@ -382,7 +338,10 @@ declare function useUserDecryptedValues(handles: string[]): {
|
|
|
382
338
|
* and by useUserDecryptedValue to read.
|
|
383
339
|
*/
|
|
384
340
|
declare const decryptionKeys: {
|
|
385
|
-
value: (handle: string) => readonly ["
|
|
341
|
+
value: (handle: string, contractAddress?: string) => readonly ["zama.decryption", {
|
|
342
|
+
readonly contractAddress?: `0x${string}` | undefined;
|
|
343
|
+
readonly handle: string;
|
|
344
|
+
}];
|
|
386
345
|
};
|
|
387
346
|
|
|
388
347
|
/** Base configuration shared by all mutation hooks that need a Token instance. */
|
|
@@ -472,8 +431,8 @@ declare function useConfidentialBalance(config: UseConfidentialBalanceConfig, op
|
|
|
472
431
|
isRefetching: boolean;
|
|
473
432
|
isStale: boolean;
|
|
474
433
|
isEnabled: boolean;
|
|
475
|
-
refetch: (options?:
|
|
476
|
-
fetchStatus:
|
|
434
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
435
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
477
436
|
promise: Promise<bigint>;
|
|
478
437
|
} | {
|
|
479
438
|
handleQuery: _tanstack_react_query.UseQueryResult<`0x${string}`, Error>;
|
|
@@ -500,8 +459,8 @@ declare function useConfidentialBalance(config: UseConfidentialBalanceConfig, op
|
|
|
500
459
|
isRefetching: boolean;
|
|
501
460
|
isStale: boolean;
|
|
502
461
|
isEnabled: boolean;
|
|
503
|
-
refetch: (options?:
|
|
504
|
-
fetchStatus:
|
|
462
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
463
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
505
464
|
promise: Promise<bigint>;
|
|
506
465
|
} | {
|
|
507
466
|
handleQuery: _tanstack_react_query.UseQueryResult<`0x${string}`, Error>;
|
|
@@ -528,8 +487,8 @@ declare function useConfidentialBalance(config: UseConfidentialBalanceConfig, op
|
|
|
528
487
|
isRefetching: boolean;
|
|
529
488
|
isStale: boolean;
|
|
530
489
|
isEnabled: boolean;
|
|
531
|
-
refetch: (options?:
|
|
532
|
-
fetchStatus:
|
|
490
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
491
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
533
492
|
promise: Promise<bigint>;
|
|
534
493
|
} | {
|
|
535
494
|
handleQuery: _tanstack_react_query.UseQueryResult<`0x${string}`, Error>;
|
|
@@ -556,8 +515,8 @@ declare function useConfidentialBalance(config: UseConfidentialBalanceConfig, op
|
|
|
556
515
|
isRefetching: boolean;
|
|
557
516
|
isStale: boolean;
|
|
558
517
|
isEnabled: boolean;
|
|
559
|
-
refetch: (options?:
|
|
560
|
-
fetchStatus:
|
|
518
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
519
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
561
520
|
promise: Promise<bigint>;
|
|
562
521
|
} | {
|
|
563
522
|
handleQuery: _tanstack_react_query.UseQueryResult<`0x${string}`, Error>;
|
|
@@ -584,8 +543,8 @@ declare function useConfidentialBalance(config: UseConfidentialBalanceConfig, op
|
|
|
584
543
|
isRefetching: boolean;
|
|
585
544
|
isStale: boolean;
|
|
586
545
|
isEnabled: boolean;
|
|
587
|
-
refetch: (options?:
|
|
588
|
-
fetchStatus:
|
|
546
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
547
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
589
548
|
promise: Promise<bigint>;
|
|
590
549
|
} | {
|
|
591
550
|
handleQuery: _tanstack_react_query.UseQueryResult<`0x${string}`, Error>;
|
|
@@ -612,8 +571,8 @@ declare function useConfidentialBalance(config: UseConfidentialBalanceConfig, op
|
|
|
612
571
|
isRefetching: boolean;
|
|
613
572
|
isStale: boolean;
|
|
614
573
|
isEnabled: boolean;
|
|
615
|
-
refetch: (options?:
|
|
616
|
-
fetchStatus:
|
|
574
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
|
|
575
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
617
576
|
promise: Promise<bigint>;
|
|
618
577
|
};
|
|
619
578
|
|
|
@@ -626,15 +585,7 @@ interface UseConfidentialBalancesConfig {
|
|
|
626
585
|
/** Maximum number of concurrent decrypt calls. Default: `Infinity` (no limit). */
|
|
627
586
|
maxConcurrency?: number;
|
|
628
587
|
}
|
|
629
|
-
|
|
630
|
-
interface ConfidentialBalancesData {
|
|
631
|
-
/** Successfully decrypted balances (address → balance). */
|
|
632
|
-
balances: Map<Address, bigint>;
|
|
633
|
-
/** Per-token errors for tokens that failed to decrypt. */
|
|
634
|
-
errors: Map<Address, Error>;
|
|
635
|
-
/** `true` if some but not all tokens failed. */
|
|
636
|
-
isPartialError: boolean;
|
|
637
|
-
}
|
|
588
|
+
|
|
638
589
|
/** Query options for the decrypt phase of {@link useConfidentialBalances}. */
|
|
639
590
|
type UseConfidentialBalancesOptions = Omit<UseQueryOptions<ConfidentialBalancesData, Error>, "queryKey" | "queryFn">;
|
|
640
591
|
/**
|
|
@@ -685,8 +636,8 @@ declare function useConfidentialBalances(config: UseConfidentialBalancesConfig,
|
|
|
685
636
|
isRefetching: boolean;
|
|
686
637
|
isStale: boolean;
|
|
687
638
|
isEnabled: boolean;
|
|
688
|
-
refetch: (options?:
|
|
689
|
-
fetchStatus:
|
|
639
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ConfidentialBalancesData, Error>>;
|
|
640
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
690
641
|
promise: Promise<ConfidentialBalancesData>;
|
|
691
642
|
} | {
|
|
692
643
|
handlesQuery: _tanstack_react_query.UseQueryResult<`0x${string}`[], Error>;
|
|
@@ -713,8 +664,8 @@ declare function useConfidentialBalances(config: UseConfidentialBalancesConfig,
|
|
|
713
664
|
isRefetching: boolean;
|
|
714
665
|
isStale: boolean;
|
|
715
666
|
isEnabled: boolean;
|
|
716
|
-
refetch: (options?:
|
|
717
|
-
fetchStatus:
|
|
667
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ConfidentialBalancesData, Error>>;
|
|
668
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
718
669
|
promise: Promise<ConfidentialBalancesData>;
|
|
719
670
|
} | {
|
|
720
671
|
handlesQuery: _tanstack_react_query.UseQueryResult<`0x${string}`[], Error>;
|
|
@@ -741,8 +692,8 @@ declare function useConfidentialBalances(config: UseConfidentialBalancesConfig,
|
|
|
741
692
|
isRefetching: boolean;
|
|
742
693
|
isStale: boolean;
|
|
743
694
|
isEnabled: boolean;
|
|
744
|
-
refetch: (options?:
|
|
745
|
-
fetchStatus:
|
|
695
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ConfidentialBalancesData, Error>>;
|
|
696
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
746
697
|
promise: Promise<ConfidentialBalancesData>;
|
|
747
698
|
} | {
|
|
748
699
|
handlesQuery: _tanstack_react_query.UseQueryResult<`0x${string}`[], Error>;
|
|
@@ -769,8 +720,8 @@ declare function useConfidentialBalances(config: UseConfidentialBalancesConfig,
|
|
|
769
720
|
isRefetching: boolean;
|
|
770
721
|
isStale: boolean;
|
|
771
722
|
isEnabled: boolean;
|
|
772
|
-
refetch: (options?:
|
|
773
|
-
fetchStatus:
|
|
723
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ConfidentialBalancesData, Error>>;
|
|
724
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
774
725
|
promise: Promise<ConfidentialBalancesData>;
|
|
775
726
|
} | {
|
|
776
727
|
handlesQuery: _tanstack_react_query.UseQueryResult<`0x${string}`[], Error>;
|
|
@@ -797,8 +748,8 @@ declare function useConfidentialBalances(config: UseConfidentialBalancesConfig,
|
|
|
797
748
|
isRefetching: boolean;
|
|
798
749
|
isStale: boolean;
|
|
799
750
|
isEnabled: boolean;
|
|
800
|
-
refetch: (options?:
|
|
801
|
-
fetchStatus:
|
|
751
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ConfidentialBalancesData, Error>>;
|
|
752
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
802
753
|
promise: Promise<ConfidentialBalancesData>;
|
|
803
754
|
} | {
|
|
804
755
|
handlesQuery: _tanstack_react_query.UseQueryResult<`0x${string}`[], Error>;
|
|
@@ -825,21 +776,11 @@ declare function useConfidentialBalances(config: UseConfidentialBalancesConfig,
|
|
|
825
776
|
isRefetching: boolean;
|
|
826
777
|
isStale: boolean;
|
|
827
778
|
isEnabled: boolean;
|
|
828
|
-
refetch: (options?:
|
|
829
|
-
fetchStatus:
|
|
779
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ConfidentialBalancesData, Error>>;
|
|
780
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
830
781
|
promise: Promise<ConfidentialBalancesData>;
|
|
831
782
|
};
|
|
832
783
|
|
|
833
|
-
/**
|
|
834
|
-
* TanStack Query mutation options factory for token allow.
|
|
835
|
-
*
|
|
836
|
-
* @param sdk - A `ZamaSDK` instance.
|
|
837
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
838
|
-
*/
|
|
839
|
-
declare function allowMutationOptions(sdk: ZamaSDK): {
|
|
840
|
-
mutationKey: readonly ["allow"];
|
|
841
|
-
mutationFn: (tokenAddresses: Address[]) => Promise<void>;
|
|
842
|
-
};
|
|
843
784
|
/**
|
|
844
785
|
* Pre-authorize FHE decrypt credentials for a list of token addresses.
|
|
845
786
|
* A single wallet signature covers all addresses, so subsequent decrypt
|
|
@@ -851,15 +792,8 @@ declare function allowMutationOptions(sdk: ZamaSDK): {
|
|
|
851
792
|
* // Call allow(allTokenAddresses) before any individual reveal
|
|
852
793
|
* ```
|
|
853
794
|
*/
|
|
854
|
-
declare function useAllow(): _tanstack_react_query.UseMutationResult<void, Error, `0x${string}`[], unknown>;
|
|
795
|
+
declare function useAllow(options?: UseMutationOptions<void, Error, Address[]>): _tanstack_react_query.UseMutationResult<void, Error, `0x${string}`[], unknown>;
|
|
855
796
|
|
|
856
|
-
declare const isAllowedQueryKeys: {
|
|
857
|
-
all: readonly ["zama", "isAllowed"];
|
|
858
|
-
};
|
|
859
|
-
declare function isAllowedQueryOptions(sdk: ZamaSDK): {
|
|
860
|
-
queryKey: readonly ["zama", "isAllowed"];
|
|
861
|
-
queryFn: () => Promise<boolean>;
|
|
862
|
-
};
|
|
863
797
|
/**
|
|
864
798
|
* Check whether a session signature is cached for the connected wallet.
|
|
865
799
|
* Returns `true` if decrypt operations can proceed without a wallet prompt.
|
|
@@ -869,25 +803,11 @@ declare function isAllowedQueryOptions(sdk: ZamaSDK): {
|
|
|
869
803
|
* const { data: allowed } = useIsAllowed();
|
|
870
804
|
* ```
|
|
871
805
|
*/
|
|
872
|
-
declare function useIsAllowed(): _tanstack_react_query.UseQueryResult<
|
|
806
|
+
declare function useIsAllowed(): _tanstack_react_query.UseQueryResult<unknown, Error>;
|
|
873
807
|
|
|
874
808
|
/**
|
|
875
|
-
*
|
|
876
|
-
*
|
|
877
|
-
* @param sdk - A `ZamaSDK` instance.
|
|
878
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
879
|
-
*/
|
|
880
|
-
declare function revokeMutationOptions(sdk: ZamaSDK): {
|
|
881
|
-
mutationKey: readonly ["revoke"];
|
|
882
|
-
mutationFn: (tokenAddresses: Address[]) => Promise<void>;
|
|
883
|
-
};
|
|
884
|
-
/**
|
|
885
|
-
* Revoke the session signature for the connected wallet.
|
|
886
|
-
* Stored credentials remain intact, but the next decrypt operation
|
|
887
|
-
* will require a fresh wallet signature.
|
|
888
|
-
*
|
|
889
|
-
* The addresses are passed through to the `credentials:revoked` event
|
|
890
|
-
* for observability.
|
|
809
|
+
* Revoke stored FHE credentials for a list of token addresses.
|
|
810
|
+
* The next decrypt operation will require a fresh wallet signature.
|
|
891
811
|
*
|
|
892
812
|
* @example
|
|
893
813
|
* ```tsx
|
|
@@ -895,18 +815,8 @@ declare function revokeMutationOptions(sdk: ZamaSDK): {
|
|
|
895
815
|
* revoke(["0xTokenA", "0xTokenB"]);
|
|
896
816
|
* ```
|
|
897
817
|
*/
|
|
898
|
-
declare function useRevoke(): _tanstack_react_query.UseMutationResult<void, Error, `0x${string}`[], unknown>;
|
|
818
|
+
declare function useRevoke(options?: UseMutationOptions<void, Error, Address[]>): _tanstack_react_query.UseMutationResult<void, Error, `0x${string}`[], unknown>;
|
|
899
819
|
|
|
900
|
-
/**
|
|
901
|
-
* TanStack Query mutation options factory for session revoke.
|
|
902
|
-
*
|
|
903
|
-
* @param sdk - A `ZamaSDK` instance.
|
|
904
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
905
|
-
*/
|
|
906
|
-
declare function revokeSessionMutationOptions(sdk: ZamaSDK): {
|
|
907
|
-
mutationKey: readonly ["revokeSession"];
|
|
908
|
-
mutationFn: () => Promise<void>;
|
|
909
|
-
};
|
|
910
820
|
/**
|
|
911
821
|
* Revoke the session signature for the connected wallet without
|
|
912
822
|
* specifying contract addresses. Useful for wallet disconnect handlers.
|
|
@@ -917,17 +827,15 @@ declare function revokeSessionMutationOptions(sdk: ZamaSDK): {
|
|
|
917
827
|
* revokeSession();
|
|
918
828
|
* ```
|
|
919
829
|
*/
|
|
920
|
-
declare function useRevokeSession(): _tanstack_react_query.UseMutationResult<void, Error, void, unknown>;
|
|
830
|
+
declare function useRevokeSession(options?: UseMutationOptions<void, Error, void>): _tanstack_react_query.UseMutationResult<void, Error, void, unknown>;
|
|
921
831
|
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
amount: bigint;
|
|
928
|
-
/** Optional progress callbacks for the multi-step transfer flow. */
|
|
929
|
-
callbacks?: TransferCallbacks;
|
|
832
|
+
type OptimisticBalanceSnapshot = Array<[QueryKey, bigint | undefined]>;
|
|
833
|
+
/** Combined context returned by optimistic `onMutate`. */
|
|
834
|
+
interface OptimisticMutateContext {
|
|
835
|
+
snapshot: OptimisticBalanceSnapshot;
|
|
836
|
+
callerContext?: unknown;
|
|
930
837
|
}
|
|
838
|
+
|
|
931
839
|
/** Configuration for {@link useConfidentialTransfer}. */
|
|
932
840
|
interface UseConfidentialTransferConfig extends UseZamaConfig {
|
|
933
841
|
/**
|
|
@@ -937,16 +845,6 @@ interface UseConfidentialTransferConfig extends UseZamaConfig {
|
|
|
937
845
|
*/
|
|
938
846
|
optimistic?: boolean;
|
|
939
847
|
}
|
|
940
|
-
/**
|
|
941
|
-
* TanStack Query mutation options factory for confidential transfer.
|
|
942
|
-
*
|
|
943
|
-
* @param token - A `Token` instance.
|
|
944
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
945
|
-
*/
|
|
946
|
-
declare function confidentialTransferMutationOptions(token: Token): {
|
|
947
|
-
mutationKey: readonly ["confidentialTransfer", `0x${string}`];
|
|
948
|
-
mutationFn: ({ to, amount, callbacks }: ConfidentialTransferParams) => Promise<TransactionResult>;
|
|
949
|
-
};
|
|
950
848
|
/**
|
|
951
849
|
* Encrypt and send a confidential transfer. Invalidates balance caches on success.
|
|
952
850
|
*
|
|
@@ -977,29 +875,8 @@ declare function confidentialTransferMutationOptions(token: Token): {
|
|
|
977
875
|
* );
|
|
978
876
|
* ```
|
|
979
877
|
*/
|
|
980
|
-
declare function useConfidentialTransfer(config: UseConfidentialTransferConfig, options?: UseMutationOptions<TransactionResult, Error, ConfidentialTransferParams,
|
|
878
|
+
declare function useConfidentialTransfer(config: UseConfidentialTransferConfig, options?: UseMutationOptions<TransactionResult, Error, ConfidentialTransferParams, OptimisticMutateContext>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, ConfidentialTransferParams, OptimisticMutateContext>;
|
|
981
879
|
|
|
982
|
-
/** Parameters passed to the `mutate` function of {@link useConfidentialTransferFrom}. */
|
|
983
|
-
interface ConfidentialTransferFromParams {
|
|
984
|
-
/** Address to transfer from. Caller must be an approved operator. */
|
|
985
|
-
from: Address;
|
|
986
|
-
/** Recipient address. */
|
|
987
|
-
to: Address;
|
|
988
|
-
/** Amount to transfer (plaintext — encrypted automatically). */
|
|
989
|
-
amount: bigint;
|
|
990
|
-
/** Optional progress callbacks for the multi-step transfer flow. */
|
|
991
|
-
callbacks?: TransferCallbacks;
|
|
992
|
-
}
|
|
993
|
-
/**
|
|
994
|
-
* TanStack Query mutation options factory for confidential transfer-from.
|
|
995
|
-
*
|
|
996
|
-
* @param token - A `Token` instance.
|
|
997
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
998
|
-
*/
|
|
999
|
-
declare function confidentialTransferFromMutationOptions(token: Token): {
|
|
1000
|
-
mutationKey: readonly ["confidentialTransferFrom", `0x${string}`];
|
|
1001
|
-
mutationFn: ({ from, to, amount, callbacks }: ConfidentialTransferFromParams) => Promise<TransactionResult>;
|
|
1002
|
-
};
|
|
1003
880
|
/**
|
|
1004
881
|
* Operator transfer on behalf of another address. Caller must be an approved operator.
|
|
1005
882
|
* Invalidates balance caches on success.
|
|
@@ -1015,23 +892,6 @@ declare function confidentialTransferFromMutationOptions(token: Token): {
|
|
|
1015
892
|
*/
|
|
1016
893
|
declare function useConfidentialTransferFrom(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ConfidentialTransferFromParams, Address>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, ConfidentialTransferFromParams, `0x${string}`>;
|
|
1017
894
|
|
|
1018
|
-
/** Parameters passed to the `mutate` function of {@link useConfidentialApprove}. */
|
|
1019
|
-
interface ConfidentialApproveParams {
|
|
1020
|
-
/** Address to approve as operator. */
|
|
1021
|
-
spender: Address;
|
|
1022
|
-
/** Unix timestamp until which the approval is valid. Defaults to 1 hour from now. */
|
|
1023
|
-
until?: number;
|
|
1024
|
-
}
|
|
1025
|
-
/**
|
|
1026
|
-
* TanStack Query mutation options factory for confidential approve.
|
|
1027
|
-
*
|
|
1028
|
-
* @param token - A `Token` instance.
|
|
1029
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
1030
|
-
*/
|
|
1031
|
-
declare function confidentialApproveMutationOptions(token: Token): {
|
|
1032
|
-
mutationKey: readonly ["confidentialApprove", `0x${string}`];
|
|
1033
|
-
mutationFn: ({ spender, until }: ConfidentialApproveParams) => Promise<TransactionResult>;
|
|
1034
|
-
};
|
|
1035
895
|
/**
|
|
1036
896
|
* Set operator approval for a confidential token. Defaults to 1 hour.
|
|
1037
897
|
*
|
|
@@ -1050,18 +910,6 @@ declare function confidentialApproveMutationOptions(token: Token): {
|
|
|
1050
910
|
*/
|
|
1051
911
|
declare function useConfidentialApprove(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ConfidentialApproveParams, Address>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, ConfidentialApproveParams, `0x${string}`>;
|
|
1052
912
|
|
|
1053
|
-
/**
|
|
1054
|
-
* Query key factory for confidential approval queries.
|
|
1055
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1056
|
-
*/
|
|
1057
|
-
declare const confidentialIsApprovedQueryKeys: {
|
|
1058
|
-
/** Match all approval queries. */
|
|
1059
|
-
readonly all: readonly ["confidentialIsApproved"];
|
|
1060
|
-
/** Match approval queries for a specific token. */
|
|
1061
|
-
readonly token: (tokenAddress: string) => readonly ["confidentialIsApproved", string];
|
|
1062
|
-
/** Match approval queries for a specific token + spender pair. */
|
|
1063
|
-
readonly spender: (tokenAddress: string, spender: string, holder?: string) => readonly ["confidentialIsApproved", string, string, string];
|
|
1064
|
-
};
|
|
1065
913
|
/** Configuration for {@link useConfidentialIsApproved}. */
|
|
1066
914
|
interface UseConfidentialIsApprovedConfig extends UseZamaConfig {
|
|
1067
915
|
/** Address to check approval for. Pass `undefined` to disable the query. */
|
|
@@ -1076,19 +924,6 @@ interface UseConfidentialIsApprovedSuspenseConfig extends UseZamaConfig {
|
|
|
1076
924
|
/** Token holder address. Defaults to the connected wallet. */
|
|
1077
925
|
holder?: Address;
|
|
1078
926
|
}
|
|
1079
|
-
/**
|
|
1080
|
-
* TanStack Query options factory for confidential approval check.
|
|
1081
|
-
*
|
|
1082
|
-
* @param token - A `Token` instance.
|
|
1083
|
-
* @param spender - Address to check approval for.
|
|
1084
|
-
* @param holder - Optional holder address. Defaults to the connected wallet.
|
|
1085
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
1086
|
-
*/
|
|
1087
|
-
declare function confidentialIsApprovedQueryOptions(token: Token, spender: Address, holder?: Address): {
|
|
1088
|
-
readonly queryKey: readonly ["confidentialIsApproved", string, string, string];
|
|
1089
|
-
readonly queryFn: () => Promise<boolean>;
|
|
1090
|
-
readonly staleTime: 30000;
|
|
1091
|
-
};
|
|
1092
927
|
/**
|
|
1093
928
|
* Check if a spender is an approved operator for a given holder (defaults to connected wallet).
|
|
1094
929
|
*
|
|
@@ -1105,7 +940,7 @@ declare function confidentialIsApprovedQueryOptions(token: Token, spender: Addre
|
|
|
1105
940
|
* });
|
|
1106
941
|
* ```
|
|
1107
942
|
*/
|
|
1108
|
-
declare function useConfidentialIsApproved(config: UseConfidentialIsApprovedConfig, options?: Omit<UseQueryOptions<boolean, Error>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<
|
|
943
|
+
declare function useConfidentialIsApproved(config: UseConfidentialIsApprovedConfig, options?: Omit<UseQueryOptions<boolean, Error>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<unknown, Error>;
|
|
1109
944
|
/**
|
|
1110
945
|
* Suspense variant of {@link useConfidentialIsApproved}.
|
|
1111
946
|
* Suspends rendering until the approval check resolves.
|
|
@@ -1124,19 +959,6 @@ declare function useConfidentialIsApproved(config: UseConfidentialIsApprovedConf
|
|
|
1124
959
|
*/
|
|
1125
960
|
declare function useConfidentialIsApprovedSuspense(config: UseConfidentialIsApprovedSuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<boolean, Error>;
|
|
1126
961
|
|
|
1127
|
-
/** Parameters passed to the `mutate` function of {@link useShield}. */
|
|
1128
|
-
interface ShieldParams {
|
|
1129
|
-
/** Amount of underlying ERC-20 tokens to wrap. */
|
|
1130
|
-
amount: bigint;
|
|
1131
|
-
/** Optional fee amount (for native ETH wrapping with fees). */
|
|
1132
|
-
fees?: bigint;
|
|
1133
|
-
/** ERC-20 approval strategy: `"exact"` (default), `"max"`, or `"skip"`. */
|
|
1134
|
-
approvalStrategy?: "max" | "exact" | "skip";
|
|
1135
|
-
/** Recipient address for the shielded tokens. Defaults to the connected wallet. */
|
|
1136
|
-
to?: Address;
|
|
1137
|
-
/** Optional progress callbacks for the multi-step shield flow. */
|
|
1138
|
-
callbacks?: ShieldCallbacks;
|
|
1139
|
-
}
|
|
1140
962
|
/** Configuration for {@link useShield}. */
|
|
1141
963
|
interface UseShieldConfig extends UseZamaConfig {
|
|
1142
964
|
/**
|
|
@@ -1146,16 +968,6 @@ interface UseShieldConfig extends UseZamaConfig {
|
|
|
1146
968
|
*/
|
|
1147
969
|
optimistic?: boolean;
|
|
1148
970
|
}
|
|
1149
|
-
/**
|
|
1150
|
-
* TanStack Query mutation options factory for shield.
|
|
1151
|
-
*
|
|
1152
|
-
* @param token - A `Token` instance.
|
|
1153
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
1154
|
-
*/
|
|
1155
|
-
declare function shieldMutationOptions(token: Token): {
|
|
1156
|
-
mutationKey: readonly ["shield", `0x${string}`];
|
|
1157
|
-
mutationFn: ({ amount, fees, approvalStrategy, to, callbacks }: ShieldParams) => Promise<TransactionResult>;
|
|
1158
|
-
};
|
|
1159
971
|
/**
|
|
1160
972
|
* Shield public ERC-20 tokens into confidential tokens.
|
|
1161
973
|
* Handles ERC-20 approval automatically. Invalidates balance caches on success.
|
|
@@ -1175,25 +987,8 @@ declare function shieldMutationOptions(token: Token): {
|
|
|
1175
987
|
* shield.mutate({ amount: 1000n });
|
|
1176
988
|
* ```
|
|
1177
989
|
*/
|
|
1178
|
-
declare function useShield(config: UseShieldConfig, options?: UseMutationOptions<TransactionResult, Error, ShieldParams,
|
|
990
|
+
declare function useShield(config: UseShieldConfig, options?: UseMutationOptions<TransactionResult, Error, ShieldParams, OptimisticMutateContext>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, ShieldParams, OptimisticMutateContext>;
|
|
1179
991
|
|
|
1180
|
-
/** Parameters passed to the `mutate` function of {@link useShieldETH}. */
|
|
1181
|
-
interface ShieldETHParams {
|
|
1182
|
-
/** Amount of ETH to wrap (in wei). */
|
|
1183
|
-
amount: bigint;
|
|
1184
|
-
/** ETH value to send with the transaction. Defaults to `amount`. */
|
|
1185
|
-
value?: bigint;
|
|
1186
|
-
}
|
|
1187
|
-
/**
|
|
1188
|
-
* TanStack Query mutation options factory for shield ETH.
|
|
1189
|
-
*
|
|
1190
|
-
* @param token - A `Token` instance.
|
|
1191
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
1192
|
-
*/
|
|
1193
|
-
declare function shieldETHMutationOptions(token: Token): {
|
|
1194
|
-
mutationKey: readonly ["shieldETH", `0x${string}`];
|
|
1195
|
-
mutationFn: ({ amount, value }: ShieldETHParams) => Promise<TransactionResult>;
|
|
1196
|
-
};
|
|
1197
992
|
/**
|
|
1198
993
|
* Shield native ETH into confidential tokens.
|
|
1199
994
|
* Invalidates balance caches on success.
|
|
@@ -1209,21 +1004,6 @@ declare function shieldETHMutationOptions(token: Token): {
|
|
|
1209
1004
|
*/
|
|
1210
1005
|
declare function useShieldETH(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ShieldETHParams, Address>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, ShieldETHParams, `0x${string}`>;
|
|
1211
1006
|
|
|
1212
|
-
/** Parameters passed to the `mutate` function of {@link useUnwrap}. */
|
|
1213
|
-
interface UnwrapParams {
|
|
1214
|
-
/** Amount to unwrap (plaintext — encrypted automatically). */
|
|
1215
|
-
amount: bigint;
|
|
1216
|
-
}
|
|
1217
|
-
/**
|
|
1218
|
-
* TanStack Query mutation options factory for unwrap.
|
|
1219
|
-
*
|
|
1220
|
-
* @param token - A `Token` instance.
|
|
1221
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
1222
|
-
*/
|
|
1223
|
-
declare function unwrapMutationOptions(token: Token): {
|
|
1224
|
-
mutationKey: readonly ["unwrap", `0x${string}`];
|
|
1225
|
-
mutationFn: ({ amount }: UnwrapParams) => Promise<TransactionResult>;
|
|
1226
|
-
};
|
|
1227
1007
|
/**
|
|
1228
1008
|
* Request an unwrap for a specific amount. Encrypts the amount first.
|
|
1229
1009
|
* Call {@link useFinalizeUnwrap} after the request is processed on-chain,
|
|
@@ -1240,16 +1020,6 @@ declare function unwrapMutationOptions(token: Token): {
|
|
|
1240
1020
|
*/
|
|
1241
1021
|
declare function useUnwrap(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, UnwrapParams, Address>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, UnwrapParams, `0x${string}`>;
|
|
1242
1022
|
|
|
1243
|
-
/**
|
|
1244
|
-
* TanStack Query mutation options factory for unwrap-all.
|
|
1245
|
-
*
|
|
1246
|
-
* @param token - A `Token` instance.
|
|
1247
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
1248
|
-
*/
|
|
1249
|
-
declare function unwrapAllMutationOptions(token: Token): {
|
|
1250
|
-
mutationKey: readonly ["unwrapAll", `0x${string}`];
|
|
1251
|
-
mutationFn: () => Promise<TransactionResult>;
|
|
1252
|
-
};
|
|
1253
1023
|
/**
|
|
1254
1024
|
* Request an unwrap for the entire confidential balance.
|
|
1255
1025
|
* Uses the on-chain balance handle directly (no encryption needed).
|
|
@@ -1266,21 +1036,6 @@ declare function unwrapAllMutationOptions(token: Token): {
|
|
|
1266
1036
|
*/
|
|
1267
1037
|
declare function useUnwrapAll(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, void, Address>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, void, `0x${string}`>;
|
|
1268
1038
|
|
|
1269
|
-
/** Parameters passed to the `mutate` function of {@link useFinalizeUnwrap}. */
|
|
1270
|
-
interface FinalizeUnwrapParams {
|
|
1271
|
-
/** Encrypted amount handle from the UnwrapRequested event. */
|
|
1272
|
-
burnAmountHandle: Address;
|
|
1273
|
-
}
|
|
1274
|
-
/**
|
|
1275
|
-
* TanStack Query mutation options factory for finalize-unwrap.
|
|
1276
|
-
*
|
|
1277
|
-
* @param token - A `Token` instance.
|
|
1278
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
1279
|
-
*/
|
|
1280
|
-
declare function finalizeUnwrapMutationOptions(token: Token): {
|
|
1281
|
-
mutationKey: readonly ["finalizeUnwrap", `0x${string}`];
|
|
1282
|
-
mutationFn: ({ burnAmountHandle }: FinalizeUnwrapParams) => Promise<TransactionResult>;
|
|
1283
|
-
};
|
|
1284
1039
|
/**
|
|
1285
1040
|
* Complete an unwrap by providing the public decryption proof.
|
|
1286
1041
|
* Call this after an unwrap request has been processed on-chain.
|
|
@@ -1296,23 +1051,6 @@ declare function finalizeUnwrapMutationOptions(token: Token): {
|
|
|
1296
1051
|
*/
|
|
1297
1052
|
declare function useFinalizeUnwrap(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, FinalizeUnwrapParams, Address>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, FinalizeUnwrapParams, `0x${string}`>;
|
|
1298
1053
|
|
|
1299
|
-
/** Parameters passed to the `mutate` function of {@link useUnshield}. */
|
|
1300
|
-
interface UnshieldParams {
|
|
1301
|
-
/** Amount to unshield (plaintext — encrypted automatically). */
|
|
1302
|
-
amount: bigint;
|
|
1303
|
-
/** Optional progress callbacks for the multi-step unshield flow. */
|
|
1304
|
-
callbacks?: UnshieldCallbacks;
|
|
1305
|
-
}
|
|
1306
|
-
/**
|
|
1307
|
-
* TanStack Query mutation options factory for unshield.
|
|
1308
|
-
*
|
|
1309
|
-
* @param token - A `Token` instance.
|
|
1310
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
1311
|
-
*/
|
|
1312
|
-
declare function unshieldMutationOptions(token: Token): {
|
|
1313
|
-
mutationKey: readonly ["unshield", `0x${string}`];
|
|
1314
|
-
mutationFn: ({ amount, callbacks }: UnshieldParams) => Promise<TransactionResult>;
|
|
1315
|
-
};
|
|
1316
1054
|
/**
|
|
1317
1055
|
* Unshield a specific amount and finalize in one call.
|
|
1318
1056
|
* Orchestrates: unwrap → wait for receipt → parse event → finalize.
|
|
@@ -1334,21 +1072,6 @@ declare function unshieldMutationOptions(token: Token): {
|
|
|
1334
1072
|
*/
|
|
1335
1073
|
declare function useUnshield(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, UnshieldParams, Address>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, UnshieldParams, `0x${string}`>;
|
|
1336
1074
|
|
|
1337
|
-
/**
|
|
1338
|
-
* TanStack Query mutation options factory for unshield-all.
|
|
1339
|
-
*
|
|
1340
|
-
* @param token - A `Token` instance.
|
|
1341
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
1342
|
-
*/
|
|
1343
|
-
/** Parameters passed to the `mutate` function of {@link useUnshieldAll}. */
|
|
1344
|
-
interface UnshieldAllParams {
|
|
1345
|
-
/** Optional progress callbacks for the multi-step unshield flow. */
|
|
1346
|
-
callbacks?: UnshieldCallbacks;
|
|
1347
|
-
}
|
|
1348
|
-
declare function unshieldAllMutationOptions(token: Token): {
|
|
1349
|
-
mutationKey: readonly ["unshieldAll", `0x${string}`];
|
|
1350
|
-
mutationFn: (params?: UnshieldAllParams) => Promise<TransactionResult>;
|
|
1351
|
-
};
|
|
1352
1075
|
/**
|
|
1353
1076
|
* Unshield the entire balance and finalize in one call.
|
|
1354
1077
|
* Orchestrates: unwrapAll → wait for receipt → parse event → finalize.
|
|
@@ -1364,23 +1087,6 @@ declare function unshieldAllMutationOptions(token: Token): {
|
|
|
1364
1087
|
*/
|
|
1365
1088
|
declare function useUnshieldAll(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, UnshieldAllParams | void, Address>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, void | UnshieldAllParams, `0x${string}`>;
|
|
1366
1089
|
|
|
1367
|
-
/** Parameters passed to the `mutate` function of {@link useResumeUnshield}. */
|
|
1368
|
-
interface ResumeUnshieldParams {
|
|
1369
|
-
/** The unwrap transaction hash from a previously interrupted unshield. */
|
|
1370
|
-
unwrapTxHash: Hex;
|
|
1371
|
-
/** Optional progress callbacks for the finalization flow. */
|
|
1372
|
-
callbacks?: UnshieldCallbacks;
|
|
1373
|
-
}
|
|
1374
|
-
/**
|
|
1375
|
-
* TanStack Query mutation options factory for resume-unshield.
|
|
1376
|
-
*
|
|
1377
|
-
* @param token - A `Token` instance.
|
|
1378
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
1379
|
-
*/
|
|
1380
|
-
declare function resumeUnshieldMutationOptions(token: Token): {
|
|
1381
|
-
mutationKey: readonly ["resumeUnshield", `0x${string}`];
|
|
1382
|
-
mutationFn: ({ unwrapTxHash, callbacks }: ResumeUnshieldParams) => Promise<TransactionResult>;
|
|
1383
|
-
};
|
|
1384
1090
|
/**
|
|
1385
1091
|
* Resume an interrupted unshield from an existing unwrap tx hash.
|
|
1386
1092
|
* Useful when the user submitted the unwrap but the finalize step was
|
|
@@ -1401,35 +1107,13 @@ declare function resumeUnshieldMutationOptions(token: Token): {
|
|
|
1401
1107
|
*/
|
|
1402
1108
|
declare function useResumeUnshield(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ResumeUnshieldParams, Address>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, ResumeUnshieldParams, `0x${string}`>;
|
|
1403
1109
|
|
|
1404
|
-
/**
|
|
1405
|
-
* Query key factory for underlying ERC-20 allowance queries.
|
|
1406
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1407
|
-
*/
|
|
1408
|
-
declare const underlyingAllowanceQueryKeys: {
|
|
1409
|
-
/** Match all underlying allowance queries. */
|
|
1410
|
-
readonly all: readonly ["underlyingAllowance"];
|
|
1411
|
-
/** Match allowance query for a specific token + wrapper pair. */
|
|
1412
|
-
readonly token: (tokenAddress: string, wrapper: string) => readonly ["underlyingAllowance", string, string];
|
|
1413
|
-
};
|
|
1414
1110
|
/** Configuration for {@link useUnderlyingAllowance}. */
|
|
1415
1111
|
interface UseUnderlyingAllowanceConfig {
|
|
1416
|
-
/** Address of the
|
|
1112
|
+
/** Address of the confidential token contract used to scope the query cache. */
|
|
1417
1113
|
tokenAddress: Address;
|
|
1418
|
-
/** Address of the wrapper contract
|
|
1114
|
+
/** Address of the wrapper contract whose underlying ERC-20 allowance is checked. */
|
|
1419
1115
|
wrapperAddress: Address;
|
|
1420
1116
|
}
|
|
1421
|
-
/**
|
|
1422
|
-
* TanStack Query options factory for underlying ERC-20 allowance.
|
|
1423
|
-
*
|
|
1424
|
-
* @param token - A `ReadonlyToken` instance.
|
|
1425
|
-
* @param wrapperAddress - Address of the wrapper contract (the spender).
|
|
1426
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
1427
|
-
*/
|
|
1428
|
-
declare function underlyingAllowanceQueryOptions(token: ReadonlyToken, wrapperAddress: Address): {
|
|
1429
|
-
readonly queryKey: readonly ["underlyingAllowance", string, string];
|
|
1430
|
-
readonly queryFn: () => Promise<bigint>;
|
|
1431
|
-
readonly staleTime: 30000;
|
|
1432
|
-
};
|
|
1433
1117
|
/**
|
|
1434
1118
|
* Read the underlying ERC-20 allowance granted to the wrapper contract.
|
|
1435
1119
|
* Useful to check if an approval is needed before shielding.
|
|
@@ -1441,7 +1125,7 @@ declare function underlyingAllowanceQueryOptions(token: ReadonlyToken, wrapperAd
|
|
|
1441
1125
|
* @example
|
|
1442
1126
|
* ```tsx
|
|
1443
1127
|
* const { data: allowance } = useUnderlyingAllowance({
|
|
1444
|
-
* tokenAddress: "
|
|
1128
|
+
* tokenAddress: "0xConfidentialToken",
|
|
1445
1129
|
* wrapperAddress: "0xWrapper",
|
|
1446
1130
|
* });
|
|
1447
1131
|
* ```
|
|
@@ -1457,81 +1141,13 @@ declare function useUnderlyingAllowance(config: UseUnderlyingAllowanceConfig, op
|
|
|
1457
1141
|
* @example
|
|
1458
1142
|
* ```tsx
|
|
1459
1143
|
* const { data: allowance } = useUnderlyingAllowanceSuspense({
|
|
1460
|
-
* tokenAddress: "
|
|
1144
|
+
* tokenAddress: "0xConfidentialToken",
|
|
1461
1145
|
* wrapperAddress: "0xWrapper",
|
|
1462
1146
|
* });
|
|
1463
1147
|
* ```
|
|
1464
1148
|
*/
|
|
1465
1149
|
declare function useUnderlyingAllowanceSuspense(config: UseUnderlyingAllowanceConfig): _tanstack_react_query.UseSuspenseQueryResult<bigint, Error>;
|
|
1466
1150
|
|
|
1467
|
-
/**
|
|
1468
|
-
* Query key factories for confidential balance queries.
|
|
1469
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()` / `removeQueries()`.
|
|
1470
|
-
*
|
|
1471
|
-
* @example
|
|
1472
|
-
* ```ts
|
|
1473
|
-
* // Invalidate all balance queries
|
|
1474
|
-
* queryClient.invalidateQueries({ queryKey: confidentialBalanceQueryKeys.all });
|
|
1475
|
-
*
|
|
1476
|
-
* // Reset balance for a specific token + owner
|
|
1477
|
-
* queryClient.resetQueries({
|
|
1478
|
-
* queryKey: confidentialBalanceQueryKeys.owner("0xToken", "0xOwner"),
|
|
1479
|
-
* });
|
|
1480
|
-
* ```
|
|
1481
|
-
*/
|
|
1482
|
-
declare const confidentialBalanceQueryKeys: {
|
|
1483
|
-
/** Match all single-token balance queries. */
|
|
1484
|
-
readonly all: readonly ["confidentialBalance"];
|
|
1485
|
-
/** Match balance queries for a specific token (any owner). */
|
|
1486
|
-
readonly token: (tokenAddress: string) => readonly ["confidentialBalance", string];
|
|
1487
|
-
/** Match balance query for a specific token + owner. */
|
|
1488
|
-
readonly owner: (tokenAddress: string, owner: string) => readonly ["confidentialBalance", string, string];
|
|
1489
|
-
};
|
|
1490
|
-
/**
|
|
1491
|
-
* Query key factory for batch balance queries (multiple tokens).
|
|
1492
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1493
|
-
*/
|
|
1494
|
-
declare const confidentialBalancesQueryKeys: {
|
|
1495
|
-
/** Match all batch balance queries. */
|
|
1496
|
-
readonly all: readonly ["confidentialBalances"];
|
|
1497
|
-
/** Match batch balance query for a specific token set + owner. */
|
|
1498
|
-
readonly tokens: (tokenAddresses: string[], owner: string) => readonly ["confidentialBalances", string[], string];
|
|
1499
|
-
};
|
|
1500
|
-
/**
|
|
1501
|
-
* Query key factory for encrypted handle queries (Phase 1 of two-phase polling).
|
|
1502
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1503
|
-
*/
|
|
1504
|
-
declare const confidentialHandleQueryKeys: {
|
|
1505
|
-
/** Match all single-token handle queries. */
|
|
1506
|
-
readonly all: readonly ["confidentialHandle"];
|
|
1507
|
-
/** Match handle queries for a specific token (any owner). */
|
|
1508
|
-
readonly token: (tokenAddress: string) => readonly ["confidentialHandle", string];
|
|
1509
|
-
/** Match handle query for a specific token + owner. */
|
|
1510
|
-
readonly owner: (tokenAddress: string, owner: string) => readonly ["confidentialHandle", string, string];
|
|
1511
|
-
};
|
|
1512
|
-
/**
|
|
1513
|
-
* Query key factory for batch encrypted handle queries (Phase 1, multiple tokens).
|
|
1514
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1515
|
-
*/
|
|
1516
|
-
declare const confidentialHandlesQueryKeys: {
|
|
1517
|
-
/** Match all batch handle queries. */
|
|
1518
|
-
readonly all: readonly ["confidentialHandles"];
|
|
1519
|
-
/** Match batch handle query for a specific token set + owner. */
|
|
1520
|
-
readonly tokens: (tokenAddresses: string[], owner: string) => readonly ["confidentialHandles", string[], string];
|
|
1521
|
-
};
|
|
1522
|
-
|
|
1523
|
-
/**
|
|
1524
|
-
* Query key factory for wrapper discovery queries.
|
|
1525
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1526
|
-
*/
|
|
1527
|
-
declare const wrapperDiscoveryQueryKeys: {
|
|
1528
|
-
/** Match all wrapper discovery queries. */
|
|
1529
|
-
readonly all: readonly ["wrapperDiscovery"];
|
|
1530
|
-
/** Match wrapper discovery queries for a specific token. */
|
|
1531
|
-
readonly token: (tokenAddress: string) => readonly ["wrapperDiscovery", string];
|
|
1532
|
-
/** Match wrapper discovery query for a specific token + coordinator pair. */
|
|
1533
|
-
readonly tokenCoordinator: (tokenAddress: string, coordinatorAddress: string) => readonly ["wrapperDiscovery", string, string];
|
|
1534
|
-
};
|
|
1535
1151
|
/** Configuration for {@link useWrapperDiscovery}. */
|
|
1536
1152
|
interface UseWrapperDiscoveryConfig {
|
|
1537
1153
|
/** Address of the underlying ERC-20 token. */
|
|
@@ -1546,18 +1162,6 @@ interface UseWrapperDiscoverySuspenseConfig {
|
|
|
1546
1162
|
/** Address of the wrapper coordinator. */
|
|
1547
1163
|
coordinatorAddress: Address;
|
|
1548
1164
|
}
|
|
1549
|
-
/**
|
|
1550
|
-
* TanStack Query options factory for wrapper discovery.
|
|
1551
|
-
*
|
|
1552
|
-
* @param token - A `ReadonlyToken` instance.
|
|
1553
|
-
* @param coordinatorAddress - Address of the wrapper coordinator.
|
|
1554
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
1555
|
-
*/
|
|
1556
|
-
declare function wrapperDiscoveryQueryOptions(token: ReadonlyToken, coordinatorAddress: Address): {
|
|
1557
|
-
readonly queryKey: readonly ["wrapperDiscovery", string, string];
|
|
1558
|
-
readonly queryFn: () => Promise<`0x${string}` | null>;
|
|
1559
|
-
readonly staleTime: number;
|
|
1560
|
-
};
|
|
1561
1165
|
/**
|
|
1562
1166
|
* Discover the wrapper contract for an ERC-20 token.
|
|
1563
1167
|
* Returns the wrapper address if one exists, or `null` if not.
|
|
@@ -1575,7 +1179,7 @@ declare function wrapperDiscoveryQueryOptions(token: ReadonlyToken, coordinatorA
|
|
|
1575
1179
|
* });
|
|
1576
1180
|
* ```
|
|
1577
1181
|
*/
|
|
1578
|
-
declare function useWrapperDiscovery(config: UseWrapperDiscoveryConfig, options?: Omit<UseQueryOptions<Address | null, Error>, "queryKey" | "queryFn">): UseQueryResult
|
|
1182
|
+
declare function useWrapperDiscovery(config: UseWrapperDiscoveryConfig, options?: Omit<UseQueryOptions<Address | null, Error>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<`0x${string}` | null, Error>;
|
|
1579
1183
|
/**
|
|
1580
1184
|
* Suspense variant of {@link useWrapperDiscovery}.
|
|
1581
1185
|
* Suspends rendering until the wrapper address is resolved.
|
|
@@ -1591,45 +1195,8 @@ declare function useWrapperDiscovery(config: UseWrapperDiscoveryConfig, options?
|
|
|
1591
1195
|
* });
|
|
1592
1196
|
* ```
|
|
1593
1197
|
*/
|
|
1594
|
-
declare function useWrapperDiscoverySuspense(config: UseWrapperDiscoverySuspenseConfig): UseSuspenseQueryResult
|
|
1198
|
+
declare function useWrapperDiscoverySuspense(config: UseWrapperDiscoverySuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<`0x${string}` | null, Error>;
|
|
1595
1199
|
|
|
1596
|
-
/**
|
|
1597
|
-
* Query key factory for token metadata queries.
|
|
1598
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1599
|
-
*/
|
|
1600
|
-
declare const metadataQueryKeys: {
|
|
1601
|
-
/** Match all token metadata queries. */
|
|
1602
|
-
readonly all: readonly ["tokenMetadata"];
|
|
1603
|
-
/** Match metadata query for a specific token. */
|
|
1604
|
-
readonly token: (tokenAddress: string) => readonly ["tokenMetadata", string];
|
|
1605
|
-
};
|
|
1606
|
-
/** ERC-20 token metadata (name, symbol, decimals). */
|
|
1607
|
-
interface TokenMetadata {
|
|
1608
|
-
/** Human-readable token name (e.g. "Wrapped Ether"). */
|
|
1609
|
-
name: string;
|
|
1610
|
-
/** Short ticker symbol (e.g. "WETH"). */
|
|
1611
|
-
symbol: string;
|
|
1612
|
-
/** Number of decimal places (e.g. 18). */
|
|
1613
|
-
decimals: number;
|
|
1614
|
-
}
|
|
1615
|
-
/**
|
|
1616
|
-
* TanStack Query options factory for token metadata.
|
|
1617
|
-
* Returns a config object usable with `useQuery`, `prefetchQuery`, `useQueries`, etc.
|
|
1618
|
-
*
|
|
1619
|
-
* @param token - A `ReadonlyToken` instance.
|
|
1620
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
1621
|
-
*
|
|
1622
|
-
* @example
|
|
1623
|
-
* ```ts
|
|
1624
|
-
* const options = metadataQueryOptions(token);
|
|
1625
|
-
* await queryClient.prefetchQuery(options);
|
|
1626
|
-
* ```
|
|
1627
|
-
*/
|
|
1628
|
-
declare function metadataQueryOptions(token: ReadonlyToken): {
|
|
1629
|
-
readonly queryKey: readonly ["tokenMetadata", string];
|
|
1630
|
-
readonly queryFn: () => Promise<TokenMetadata>;
|
|
1631
|
-
readonly staleTime: number;
|
|
1632
|
-
};
|
|
1633
1200
|
/**
|
|
1634
1201
|
* Read ERC-20 token metadata (name, symbol, decimals).
|
|
1635
1202
|
* Fetches all three in parallel. Cached indefinitely since metadata is immutable.
|
|
@@ -1644,7 +1211,7 @@ declare function metadataQueryOptions(token: ReadonlyToken): {
|
|
|
1644
1211
|
* // metadata?.name, metadata?.symbol, metadata?.decimals
|
|
1645
1212
|
* ```
|
|
1646
1213
|
*/
|
|
1647
|
-
declare function useMetadata(tokenAddress: Address, options?: Omit<UseQueryOptions<TokenMetadata, Error>, "queryKey" | "queryFn">): UseQueryResult<TokenMetadata, Error>;
|
|
1214
|
+
declare function useMetadata(tokenAddress: Address, options?: Omit<UseQueryOptions<TokenMetadata, Error>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenMetadata, Error>;
|
|
1648
1215
|
/**
|
|
1649
1216
|
* Suspense variant of {@link useMetadata}.
|
|
1650
1217
|
* Suspends rendering until metadata is loaded.
|
|
@@ -1657,18 +1224,8 @@ declare function useMetadata(tokenAddress: Address, options?: Omit<UseQueryOptio
|
|
|
1657
1224
|
* const { data: metadata } = useMetadataSuspense("0xToken");
|
|
1658
1225
|
* ```
|
|
1659
1226
|
*/
|
|
1660
|
-
declare function useMetadataSuspense(tokenAddress: Address): UseSuspenseQueryResult<TokenMetadata, Error>;
|
|
1227
|
+
declare function useMetadataSuspense(tokenAddress: Address): _tanstack_react_query.UseSuspenseQueryResult<TokenMetadata, Error>;
|
|
1661
1228
|
|
|
1662
|
-
/**
|
|
1663
|
-
* Query key factory for activity feed queries.
|
|
1664
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1665
|
-
*/
|
|
1666
|
-
declare const activityFeedQueryKeys: {
|
|
1667
|
-
/** Match all activity feed queries. */
|
|
1668
|
-
readonly all: readonly ["activityFeed"];
|
|
1669
|
-
/** Match activity feed queries for a specific token. */
|
|
1670
|
-
readonly token: (tokenAddress: string) => readonly ["activityFeed", string];
|
|
1671
|
-
};
|
|
1672
1229
|
/** Configuration for {@link useActivityFeed}. */
|
|
1673
1230
|
interface UseActivityFeedConfig {
|
|
1674
1231
|
/** Address of the confidential token contract. */
|
|
@@ -1700,23 +1257,8 @@ interface UseActivityFeedConfig {
|
|
|
1700
1257
|
* });
|
|
1701
1258
|
* ```
|
|
1702
1259
|
*/
|
|
1703
|
-
declare function useActivityFeed(config: UseActivityFeedConfig): UseQueryResult<ActivityItem[], Error>;
|
|
1260
|
+
declare function useActivityFeed(config: UseActivityFeedConfig): _tanstack_react_query.UseQueryResult<ActivityItem[], Error>;
|
|
1704
1261
|
|
|
1705
|
-
/** Parameters passed to the `mutate` function of {@link useApproveUnderlying}. */
|
|
1706
|
-
interface ApproveUnderlyingParams {
|
|
1707
|
-
/** Approval amount. Defaults to max uint256 if omitted. */
|
|
1708
|
-
amount?: bigint;
|
|
1709
|
-
}
|
|
1710
|
-
/**
|
|
1711
|
-
* TanStack Query mutation options factory for approve-underlying.
|
|
1712
|
-
*
|
|
1713
|
-
* @param token - A `Token` instance.
|
|
1714
|
-
* @returns Mutation options with `mutationKey` and `mutationFn`.
|
|
1715
|
-
*/
|
|
1716
|
-
declare function approveUnderlyingMutationOptions(token: Token): {
|
|
1717
|
-
mutationKey: readonly ["approveUnderlying", `0x${string}`];
|
|
1718
|
-
mutationFn: ({ amount }: ApproveUnderlyingParams) => Promise<TransactionResult>;
|
|
1719
|
-
};
|
|
1720
1262
|
/**
|
|
1721
1263
|
* Approve the wrapper contract to spend the underlying ERC-20.
|
|
1722
1264
|
* Defaults to max uint256. Resets to zero first if there's an existing
|
|
@@ -1734,48 +1276,6 @@ declare function approveUnderlyingMutationOptions(token: Token): {
|
|
|
1734
1276
|
*/
|
|
1735
1277
|
declare function useApproveUnderlying(config: UseZamaConfig, options?: UseMutationOptions<TransactionResult, Error, ApproveUnderlyingParams, Address>): _tanstack_react_query.UseMutationResult<TransactionResult, Error, ApproveUnderlyingParams, `0x${string}`>;
|
|
1736
1278
|
|
|
1737
|
-
/**
|
|
1738
|
-
* Query key factory for ERC-165 confidential interface checks.
|
|
1739
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1740
|
-
*/
|
|
1741
|
-
declare const isConfidentialQueryKeys: {
|
|
1742
|
-
/** Match all confidential interface queries. */
|
|
1743
|
-
readonly all: readonly ["isConfidential"];
|
|
1744
|
-
/** Match confidential interface query for a specific token. */
|
|
1745
|
-
readonly token: (tokenAddress: string) => readonly ["isConfidential", string];
|
|
1746
|
-
};
|
|
1747
|
-
/**
|
|
1748
|
-
* Query key factory for ERC-165 wrapper interface checks.
|
|
1749
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1750
|
-
*/
|
|
1751
|
-
declare const isWrapperQueryKeys: {
|
|
1752
|
-
/** Match all wrapper interface queries. */
|
|
1753
|
-
readonly all: readonly ["isWrapper"];
|
|
1754
|
-
/** Match wrapper interface query for a specific token. */
|
|
1755
|
-
readonly token: (tokenAddress: string) => readonly ["isWrapper", string];
|
|
1756
|
-
};
|
|
1757
|
-
/**
|
|
1758
|
-
* TanStack Query options factory for ERC-165 confidential interface check.
|
|
1759
|
-
*
|
|
1760
|
-
* @param token - A `ReadonlyToken` instance.
|
|
1761
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
1762
|
-
*/
|
|
1763
|
-
declare function isConfidentialQueryOptions(token: ReadonlyToken): {
|
|
1764
|
-
readonly queryKey: readonly ["isConfidential", string];
|
|
1765
|
-
readonly queryFn: () => Promise<boolean>;
|
|
1766
|
-
readonly staleTime: number;
|
|
1767
|
-
};
|
|
1768
|
-
/**
|
|
1769
|
-
* TanStack Query options factory for ERC-165 wrapper interface check.
|
|
1770
|
-
*
|
|
1771
|
-
* @param token - A `ReadonlyToken` instance.
|
|
1772
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
1773
|
-
*/
|
|
1774
|
-
declare function isWrapperQueryOptions(token: ReadonlyToken): {
|
|
1775
|
-
readonly queryKey: readonly ["isWrapper", string];
|
|
1776
|
-
readonly queryFn: () => Promise<boolean>;
|
|
1777
|
-
readonly staleTime: number;
|
|
1778
|
-
};
|
|
1779
1279
|
/**
|
|
1780
1280
|
* Check if a token supports the ERC-7984 confidential interface via ERC-165.
|
|
1781
1281
|
* Result is cached indefinitely since interface support does not change.
|
|
@@ -1789,7 +1289,7 @@ declare function isWrapperQueryOptions(token: ReadonlyToken): {
|
|
|
1789
1289
|
* const { data: isConfidential } = useIsConfidential("0xToken");
|
|
1790
1290
|
* ```
|
|
1791
1291
|
*/
|
|
1792
|
-
declare function useIsConfidential(tokenAddress: Address, options?: Omit<UseQueryOptions<boolean, Error>, "queryKey" | "queryFn">): UseQueryResult<boolean, Error>;
|
|
1292
|
+
declare function useIsConfidential(tokenAddress: Address, options?: Omit<UseQueryOptions<boolean, Error>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<boolean, Error>;
|
|
1793
1293
|
/**
|
|
1794
1294
|
* Suspense variant of {@link useIsConfidential}.
|
|
1795
1295
|
* Suspends rendering until the ERC-165 check resolves.
|
|
@@ -1802,7 +1302,7 @@ declare function useIsConfidential(tokenAddress: Address, options?: Omit<UseQuer
|
|
|
1802
1302
|
* const { data: isConfidential } = useIsConfidentialSuspense("0xToken");
|
|
1803
1303
|
* ```
|
|
1804
1304
|
*/
|
|
1805
|
-
declare function useIsConfidentialSuspense(tokenAddress: Address): UseSuspenseQueryResult<boolean, Error>;
|
|
1305
|
+
declare function useIsConfidentialSuspense(tokenAddress: Address): _tanstack_react_query.UseSuspenseQueryResult<boolean, Error>;
|
|
1806
1306
|
/**
|
|
1807
1307
|
* Check if a token supports the ERC-7984 wrapper interface via ERC-165.
|
|
1808
1308
|
* Result is cached indefinitely since interface support does not change.
|
|
@@ -1816,7 +1316,7 @@ declare function useIsConfidentialSuspense(tokenAddress: Address): UseSuspenseQu
|
|
|
1816
1316
|
* const { data: isWrapper } = useIsWrapper("0xToken");
|
|
1817
1317
|
* ```
|
|
1818
1318
|
*/
|
|
1819
|
-
declare function useIsWrapper(tokenAddress: Address, options?: Omit<UseQueryOptions<boolean, Error>, "queryKey" | "queryFn">): UseQueryResult<boolean, Error>;
|
|
1319
|
+
declare function useIsWrapper(tokenAddress: Address, options?: Omit<UseQueryOptions<boolean, Error>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<boolean, Error>;
|
|
1820
1320
|
/**
|
|
1821
1321
|
* Suspense variant of {@link useIsWrapper}.
|
|
1822
1322
|
* Suspends rendering until the ERC-165 check resolves.
|
|
@@ -1829,29 +1329,8 @@ declare function useIsWrapper(tokenAddress: Address, options?: Omit<UseQueryOpti
|
|
|
1829
1329
|
* const { data: isWrapper } = useIsWrapperSuspense("0xToken");
|
|
1830
1330
|
* ```
|
|
1831
1331
|
*/
|
|
1832
|
-
declare function useIsWrapperSuspense(tokenAddress: Address): UseSuspenseQueryResult<boolean, Error>;
|
|
1332
|
+
declare function useIsWrapperSuspense(tokenAddress: Address): _tanstack_react_query.UseSuspenseQueryResult<boolean, Error>;
|
|
1833
1333
|
|
|
1834
|
-
/**
|
|
1835
|
-
* Query key factory for total supply queries.
|
|
1836
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1837
|
-
*/
|
|
1838
|
-
declare const totalSupplyQueryKeys: {
|
|
1839
|
-
/** Match all total supply queries. */
|
|
1840
|
-
readonly all: readonly ["totalSupply"];
|
|
1841
|
-
/** Match total supply query for a specific token. */
|
|
1842
|
-
readonly token: (tokenAddress: string) => readonly ["totalSupply", string];
|
|
1843
|
-
};
|
|
1844
|
-
/**
|
|
1845
|
-
* TanStack Query options factory for total supply.
|
|
1846
|
-
*
|
|
1847
|
-
* @param token - A `ReadonlyToken` instance.
|
|
1848
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
1849
|
-
*/
|
|
1850
|
-
declare function totalSupplyQueryOptions(token: ReadonlyToken): {
|
|
1851
|
-
readonly queryKey: readonly ["totalSupply", string];
|
|
1852
|
-
readonly queryFn: () => Promise<bigint>;
|
|
1853
|
-
readonly staleTime: 30000;
|
|
1854
|
-
};
|
|
1855
1334
|
/**
|
|
1856
1335
|
* Read the total supply of a token.
|
|
1857
1336
|
* Stale after 30 seconds to balance freshness and RPC cost.
|
|
@@ -1865,7 +1344,7 @@ declare function totalSupplyQueryOptions(token: ReadonlyToken): {
|
|
|
1865
1344
|
* const { data: totalSupply } = useTotalSupply("0xToken");
|
|
1866
1345
|
* ```
|
|
1867
1346
|
*/
|
|
1868
|
-
declare function useTotalSupply(tokenAddress: Address, options?: Omit<UseQueryOptions<bigint, Error>, "queryKey" | "queryFn">): UseQueryResult<bigint, Error>;
|
|
1347
|
+
declare function useTotalSupply(tokenAddress: Address, options?: Omit<UseQueryOptions<bigint, Error>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<bigint, Error>;
|
|
1869
1348
|
/**
|
|
1870
1349
|
* Suspense variant of {@link useTotalSupply}.
|
|
1871
1350
|
* Suspends rendering until the total supply is loaded.
|
|
@@ -1878,22 +1357,8 @@ declare function useTotalSupply(tokenAddress: Address, options?: Omit<UseQueryOp
|
|
|
1878
1357
|
* const { data: totalSupply } = useTotalSupplySuspense("0xToken");
|
|
1879
1358
|
* ```
|
|
1880
1359
|
*/
|
|
1881
|
-
declare function useTotalSupplySuspense(tokenAddress: Address): UseSuspenseQueryResult<bigint, Error>;
|
|
1360
|
+
declare function useTotalSupplySuspense(tokenAddress: Address): _tanstack_react_query.UseSuspenseQueryResult<bigint, Error>;
|
|
1882
1361
|
|
|
1883
|
-
/**
|
|
1884
|
-
* Query key factory for fee-related queries.
|
|
1885
|
-
* Use with `queryClient.invalidateQueries()` / `resetQueries()`.
|
|
1886
|
-
*/
|
|
1887
|
-
declare const feeQueryKeys: {
|
|
1888
|
-
/** Match shield fee query for given parameters. */
|
|
1889
|
-
readonly shieldFee: (feeManagerAddress: string, amount?: string, from?: string, to?: string) => readonly ["shieldFee", string, ...(string | undefined)[]];
|
|
1890
|
-
/** Match unshield fee query for given parameters. */
|
|
1891
|
-
readonly unshieldFee: (feeManagerAddress: string, amount?: string, from?: string, to?: string) => readonly ["unshieldFee", string, ...(string | undefined)[]];
|
|
1892
|
-
/** Match batch transfer fee query for a specific fee manager. */
|
|
1893
|
-
readonly batchTransferFee: (feeManagerAddress: string) => readonly ["batchTransferFee", string];
|
|
1894
|
-
/** Match fee recipient query for a specific fee manager. */
|
|
1895
|
-
readonly feeRecipient: (feeManagerAddress: string) => readonly ["feeRecipient", string];
|
|
1896
|
-
};
|
|
1897
1362
|
/** Configuration for {@link useShieldFee} and {@link useUnshieldFee}. */
|
|
1898
1363
|
interface UseFeeConfig {
|
|
1899
1364
|
/** Address of the fee manager contract. */
|
|
@@ -1905,54 +1370,6 @@ interface UseFeeConfig {
|
|
|
1905
1370
|
/** Receiver address. */
|
|
1906
1371
|
to: Address;
|
|
1907
1372
|
}
|
|
1908
|
-
/**
|
|
1909
|
-
* TanStack Query options factory for shield fee.
|
|
1910
|
-
*
|
|
1911
|
-
* @param signer - A `GenericSigner` instance.
|
|
1912
|
-
* @param config - {@link UseFeeConfig} with fee manager address, amount, from, and to.
|
|
1913
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
1914
|
-
*/
|
|
1915
|
-
declare function shieldFeeQueryOptions(signer: GenericSigner, config: UseFeeConfig): {
|
|
1916
|
-
readonly queryKey: readonly ["shieldFee", string, ...(string | undefined)[]];
|
|
1917
|
-
readonly queryFn: () => Promise<bigint>;
|
|
1918
|
-
readonly staleTime: 30000;
|
|
1919
|
-
};
|
|
1920
|
-
/**
|
|
1921
|
-
* TanStack Query options factory for unshield fee.
|
|
1922
|
-
*
|
|
1923
|
-
* @param signer - A `GenericSigner` instance.
|
|
1924
|
-
* @param config - Fee manager address, amount, from, and to.
|
|
1925
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
1926
|
-
*/
|
|
1927
|
-
declare function unshieldFeeQueryOptions(signer: GenericSigner, config: UseFeeConfig): {
|
|
1928
|
-
readonly queryKey: readonly ["unshieldFee", string, ...(string | undefined)[]];
|
|
1929
|
-
readonly queryFn: () => Promise<bigint>;
|
|
1930
|
-
readonly staleTime: 30000;
|
|
1931
|
-
};
|
|
1932
|
-
/**
|
|
1933
|
-
* TanStack Query options factory for batch transfer fee.
|
|
1934
|
-
*
|
|
1935
|
-
* @param signer - A `GenericSigner` instance.
|
|
1936
|
-
* @param feeManagerAddress - Address of the fee manager contract.
|
|
1937
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
1938
|
-
*/
|
|
1939
|
-
declare function batchTransferFeeQueryOptions(signer: GenericSigner, feeManagerAddress: Address): {
|
|
1940
|
-
readonly queryKey: readonly ["batchTransferFee", string];
|
|
1941
|
-
readonly queryFn: () => Promise<bigint>;
|
|
1942
|
-
readonly staleTime: 30000;
|
|
1943
|
-
};
|
|
1944
|
-
/**
|
|
1945
|
-
* TanStack Query options factory for fee recipient.
|
|
1946
|
-
*
|
|
1947
|
-
* @param signer - A `GenericSigner` instance.
|
|
1948
|
-
* @param feeManagerAddress - Address of the fee manager contract.
|
|
1949
|
-
* @returns Query options with `queryKey`, `queryFn`, and `staleTime`.
|
|
1950
|
-
*/
|
|
1951
|
-
declare function feeRecipientQueryOptions(signer: GenericSigner, feeManagerAddress: Address): {
|
|
1952
|
-
readonly queryKey: readonly ["feeRecipient", string];
|
|
1953
|
-
readonly queryFn: () => Promise<`0x${string}`>;
|
|
1954
|
-
readonly staleTime: 30000;
|
|
1955
|
-
};
|
|
1956
1373
|
/**
|
|
1957
1374
|
* Read the shield fee for a given amount and address pair.
|
|
1958
1375
|
*
|
|
@@ -1970,7 +1387,7 @@ declare function feeRecipientQueryOptions(signer: GenericSigner, feeManagerAddre
|
|
|
1970
1387
|
* });
|
|
1971
1388
|
* ```
|
|
1972
1389
|
*/
|
|
1973
|
-
declare function useShieldFee(config: UseFeeConfig, options?: Omit<UseQueryOptions<bigint, Error>, "queryKey" | "queryFn">): UseQueryResult<bigint, Error>;
|
|
1390
|
+
declare function useShieldFee(config: UseFeeConfig, options?: Omit<UseQueryOptions<bigint, Error>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<bigint, Error>;
|
|
1974
1391
|
/**
|
|
1975
1392
|
* Read the unshield fee for a given amount and address pair.
|
|
1976
1393
|
*
|
|
@@ -1988,7 +1405,7 @@ declare function useShieldFee(config: UseFeeConfig, options?: Omit<UseQueryOptio
|
|
|
1988
1405
|
* });
|
|
1989
1406
|
* ```
|
|
1990
1407
|
*/
|
|
1991
|
-
declare function useUnshieldFee(config: UseFeeConfig, options?: Omit<UseQueryOptions<bigint, Error>, "queryKey" | "queryFn">): UseQueryResult<bigint, Error>;
|
|
1408
|
+
declare function useUnshieldFee(config: UseFeeConfig, options?: Omit<UseQueryOptions<bigint, Error>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<bigint, Error>;
|
|
1992
1409
|
/**
|
|
1993
1410
|
* Read the batch transfer fee from the fee manager.
|
|
1994
1411
|
*
|
|
@@ -2001,7 +1418,7 @@ declare function useUnshieldFee(config: UseFeeConfig, options?: Omit<UseQueryOpt
|
|
|
2001
1418
|
* const { data: fee } = useBatchTransferFee("0xFeeManager");
|
|
2002
1419
|
* ```
|
|
2003
1420
|
*/
|
|
2004
|
-
declare function useBatchTransferFee(feeManagerAddress: Address, options?: Omit<UseQueryOptions<bigint, Error>, "queryKey" | "queryFn">): UseQueryResult<bigint, Error>;
|
|
1421
|
+
declare function useBatchTransferFee(feeManagerAddress: Address, options?: Omit<UseQueryOptions<bigint, Error>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<bigint, Error>;
|
|
2005
1422
|
/**
|
|
2006
1423
|
* Read the fee recipient address from the fee manager.
|
|
2007
1424
|
*
|
|
@@ -2014,6 +1431,6 @@ declare function useBatchTransferFee(feeManagerAddress: Address, options?: Omit<
|
|
|
2014
1431
|
* const { data: recipient } = useFeeRecipient("0xFeeManager");
|
|
2015
1432
|
* ```
|
|
2016
1433
|
*/
|
|
2017
|
-
declare function useFeeRecipient(feeManagerAddress: Address, options?: Omit<UseQueryOptions<Address, Error>, "queryKey" | "queryFn">): UseQueryResult
|
|
1434
|
+
declare function useFeeRecipient(feeManagerAddress: Address, options?: Omit<UseQueryOptions<Address, Error>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<`0x${string}`, Error>;
|
|
2018
1435
|
|
|
2019
|
-
export { type
|
|
1436
|
+
export { type CreateDelegatedUserDecryptEIP712Params, type CreateEIP712Params, type DecryptHandle, type OptimisticBalanceSnapshot, type OptimisticMutateContext, type PublicKeyData, type PublicParamsData, type UseActivityFeedConfig, type UseConfidentialBalanceConfig, type UseConfidentialBalanceOptions, type UseConfidentialBalancesConfig, type UseConfidentialBalancesOptions, type UseConfidentialIsApprovedConfig, type UseConfidentialIsApprovedSuspenseConfig, type UseConfidentialTransferConfig, type UseFeeConfig, type UseShieldConfig, type UseUnderlyingAllowanceConfig, type UseUserDecryptFlowConfig, type UseWrapperDiscoveryConfig, type UseWrapperDiscoverySuspenseConfig, type UseZamaConfig, type UserDecryptFlowCallbacks, type UserDecryptFlowParams, ZamaProvider, type ZamaProviderProps, decryptionKeys, useActivityFeed, useAllow, useApproveUnderlying, useBatchTransferFee, useConfidentialApprove, useConfidentialBalance, useConfidentialBalances, useConfidentialIsApproved, useConfidentialIsApprovedSuspense, useConfidentialTransfer, useConfidentialTransferFrom, useCreateDelegatedUserDecryptEIP712, useCreateEIP712, useDelegatedUserDecrypt, useEncrypt, useFeeRecipient, useFinalizeUnwrap, useGenerateKeypair, useIsAllowed, useIsConfidential, useIsConfidentialSuspense, useIsWrapper, useIsWrapperSuspense, useMetadata, useMetadataSuspense, usePublicDecrypt, usePublicKey, usePublicParams, useReadonlyToken, useRequestZKProofVerification, useResumeUnshield, useRevoke, useRevokeSession, useShield, useShieldETH, useShieldFee, useToken, useTotalSupply, useTotalSupplySuspense, useUnderlyingAllowance, useUnderlyingAllowanceSuspense, useUnshield, useUnshieldAll, useUnshieldFee, useUnwrap, useUnwrapAll, useUserDecrypt, useUserDecryptFlow, useUserDecryptedValue, useUserDecryptedValues, useWrapperDiscovery, useWrapperDiscoverySuspense, useZamaSDK };
|