@zama-fhe/sdk 3.7.0-alpha.2 → 3.7.0-beta.2
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/dist/cjs/base-signer.cjs +1 -1
- package/dist/cjs/base-signer.cjs.map +1 -1
- package/dist/cjs/chains.cjs +1 -1
- package/dist/cjs/chains.cjs.map +1 -1
- package/dist/cjs/erc165.cjs +2 -0
- package/dist/cjs/erc165.cjs.map +1 -0
- package/dist/cjs/ethers/index.cjs +1 -1
- package/dist/cjs/ethers/index.cjs.map +1 -1
- package/dist/cjs/fhevm-relayer.cjs +2 -2
- package/dist/cjs/fhevm-relayer.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/invalidation.cjs +2 -0
- package/dist/cjs/invalidation.cjs.map +1 -0
- package/dist/cjs/primitives.cjs +2 -0
- package/dist/cjs/primitives.cjs.map +1 -0
- package/dist/cjs/query/index.cjs +1 -1
- package/dist/cjs/query/index.cjs.map +1 -1
- package/dist/cjs/relayer.cjs +1 -1
- package/dist/cjs/relayer.cjs.map +1 -1
- package/dist/cjs/token.cjs +1 -1
- package/dist/cjs/token.cjs.map +1 -1
- package/dist/cjs/vaults/index.cjs +2 -0
- package/dist/cjs/vaults/index.cjs.map +1 -0
- package/dist/cjs/viem/index.cjs +1 -1
- package/dist/cjs/viem/index.cjs.map +1 -1
- package/dist/cjs/wrapped-token.cjs +2 -0
- package/dist/cjs/wrapped-token.cjs.map +1 -0
- package/dist/cjs/wrappers-registry.cjs +1 -1
- package/dist/cjs/wrappers-registry.cjs.map +1 -1
- package/dist/esm/base-signer-D5Cwv7yb.js +2 -0
- package/dist/esm/base-signer-D5Cwv7yb.js.map +1 -0
- package/dist/esm/{base-signer-S2Ogf6L4.d.ts → base-signer-DIYZwDnc.d.ts} +2 -2
- package/dist/esm/chains/index.d.ts +1 -1
- package/dist/esm/chains/index.js +1 -1
- package/dist/esm/chains-ByyCdrrd.js +2 -0
- package/dist/esm/chains-ByyCdrrd.js.map +1 -0
- package/dist/esm/cleartext/index.d.ts +2 -2
- package/dist/esm/cleartext/index.js +1 -1
- package/dist/esm/{cleartext-pv2blbFU.d.ts → cleartext-3HOk1BAg.d.ts} +2 -2
- package/dist/esm/{cleartext-DcbDCDXj.js → cleartext-PCpNqRGV.js} +2 -2
- package/dist/esm/{cleartext-DcbDCDXj.js.map → cleartext-PCpNqRGV.js.map} +1 -1
- package/dist/esm/encrypt.worker.js +51 -51
- package/dist/esm/{encryption-DJljZ2oV.js → encryption-BKoalB4o.js} +2 -2
- package/dist/esm/{encryption-DJljZ2oV.js.map → encryption-BKoalB4o.js.map} +1 -1
- package/dist/esm/erc165-DbMOt-s6.js +2 -0
- package/dist/esm/erc165-DbMOt-s6.js.map +1 -0
- package/dist/esm/ethers/index.d.ts +5 -5
- package/dist/esm/ethers/index.js +1 -1
- package/dist/esm/ethers/index.js.map +1 -1
- package/dist/esm/fhevm-relayer-CtrnKjJf.js +8 -0
- package/dist/esm/fhevm-relayer-CtrnKjJf.js.map +1 -0
- package/dist/esm/{index-tfvbrVa2.d.ts → index-BHrjck_q.d.ts} +4 -4
- package/dist/esm/{index-DRrrBtMX.d.ts → index-DJYq1rAB.d.ts} +989 -1874
- package/dist/esm/{index-Gk1S0gjO.d.ts → index-ijgDL4IC.d.ts} +1 -14
- package/dist/esm/index.d.ts +8 -108
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/invalidation-BgFjmXeQ.js +2 -0
- package/dist/esm/invalidation-BgFjmXeQ.js.map +1 -0
- package/dist/esm/invalidation-CJ-pzOUG.d.ts +46 -0
- package/dist/esm/node/index.d.ts +4 -4
- package/dist/esm/node/index.js +1 -1
- package/dist/esm/primitives-Cym-3HKa.js +2 -0
- package/dist/esm/primitives-Cym-3HKa.js.map +1 -0
- package/dist/esm/query/index.d.ts +495 -4
- package/dist/esm/query/index.js +1 -1
- package/dist/esm/query/index.js.map +1 -1
- package/dist/esm/relayer-CVKO9GmQ.js +2 -0
- package/dist/esm/relayer-CVKO9GmQ.js.map +1 -0
- package/dist/esm/token-CRJ8eCr7.js +2 -0
- package/dist/esm/token-CRJ8eCr7.js.map +1 -0
- package/dist/esm/{types-BOyFfG7D.d.ts → types-Bz5-wHPv.d.ts} +23 -43
- package/dist/esm/{types-BRIpBy9n.d.ts → types-CI6BtpB7.d.ts} +3 -3
- package/dist/esm/{types-OXQqX_kH.d.ts → types-v0_sfkli.d.ts} +3 -3
- package/dist/esm/{validation-DWe2k89s.js → validation-BRu06AM_.js} +2 -2
- package/dist/esm/{validation-DWe2k89s.js.map → validation-BRu06AM_.js.map} +1 -1
- package/dist/esm/vaults/index.d.ts +13833 -0
- package/dist/esm/vaults/index.js +2 -0
- package/dist/esm/vaults/index.js.map +1 -0
- package/dist/esm/viem/index.d.ts +5 -5
- package/dist/esm/viem/index.js +1 -1
- package/dist/esm/viem/index.js.map +1 -1
- package/dist/esm/web/index.d.ts +1 -1
- package/dist/esm/web/index.js +1 -1
- package/dist/esm/wrapped-token-BOtzaSAY.js +2 -0
- package/dist/esm/wrapped-token-BOtzaSAY.js.map +1 -0
- package/dist/esm/wrappers-registry-Cm3JJeqx.js +2 -0
- package/dist/esm/wrappers-registry-Cm3JJeqx.js.map +1 -0
- package/package.json +19 -5
- package/dist/esm/base-signer--sBO2qJp.js +0 -2
- package/dist/esm/base-signer--sBO2qJp.js.map +0 -1
- package/dist/esm/chains-DEpKup1n.js +0 -2
- package/dist/esm/chains-DEpKup1n.js.map +0 -1
- package/dist/esm/fhevm-relayer-CPmCytDX.js +0 -8
- package/dist/esm/fhevm-relayer-CPmCytDX.js.map +0 -1
- package/dist/esm/relayer-B6Zo6EkX.js +0 -2
- package/dist/esm/relayer-B6Zo6EkX.js.map +0 -1
- package/dist/esm/token-BMQ6xlrk.js +0 -2
- package/dist/esm/token-BMQ6xlrk.js.map +0 -1
- package/dist/esm/wrappers-registry-BfQr2QHn.js +0 -2
- package/dist/esm/wrappers-registry-BfQr2QHn.js.map +0 -1
|
@@ -1,4 +1,495 @@
|
|
|
1
|
-
import { f as FheChain, p as FheChainAuth } from "../index-
|
|
2
|
-
import { $ as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { f as FheChain, p as FheChainAuth } from "../index-ijgDL4IC.js";
|
|
2
|
+
import { $ as SetOperatorSubmittedEvent, $t as TransactionReceipt, A as WalletAccountListener, B as ApproveUnderlyingSubmittedEvent, C as TransferAndCallRequest, Ct as ShieldCallbacks, D as GenericSigner, E as WrapRequest, F as ReadContractReturnType, Ft as UnwrapFinalizedEvent, G as DelegationSubmittedEvent, H as DecryptEndEvent, I as ReadFunctionName, It as UnwrapRequestedEvent, J as EncryptStartEvent, K as EncryptEndEvent, L as WriteContractArgs, Lt as WrapEvent, M as ContractAbi, N as ReadContractArgs, O as WalletAccount, P as ReadContractConfig, Q as RevokeDelegationSubmittedEvent, Qt as RawLog, R as WriteContractConfig, S as TransactionKind, St as WrapOptions, T as UnwrapRequest, Tt as UnshieldCallbacks, U as DecryptErrorEvent, V as BaseEvent, W as DecryptStartEvent, X as PermitErrorEvent, Y as FinalizeUnwrapSubmittedEvent, Z as PermitOperation, _ as PrepareTransactionRequest, _t as ShieldOptions, an as EncryptInput, at as UnshieldPhase1SubmittedEvent, b as RevokeDelegationRequest, bt as UnshieldOptions, c as GenericStorage, cn as EncryptedValue, ct as UnwrapSubmittedEvent, d as ConfidentialTransferFromRequest, dn as FhevmRelayerOptions, dt as WrapSubmittedEvent, en as TransactionResult, et as ShieldSubmittedEvent, f as ConfidentialTransferRequest, fn as FhevmRuntimeConfig, ft as ZamaSDKEvent, g as PrepareOptions, gt as ApprovalStrategy, h as PrepareFees, ht as ZamaSDKEvents, i as ZamaConfig, in as EIP712TypedData, it as TransferSubmittedEvent, j as WalletAccountStore, jt as OnChainEvent, k as WalletAccountChange, kt as ConfidentialTransferEvent, l as GenericProvider, ln as FhevmClient, m as FinalizeUnwrapRequest, mn as RelayerSDK, nn as DecryptPublicValuesResult, nt as TransactionOperation, on as EncryptParams, ot as UnshieldPhase2StartedEvent, p as DelegateDecryptionRequest, pt as ZamaSDKEventListener, q as EncryptErrorEvent, rt as TransferFromSubmittedEvent, s as GenericLogger, sn as EncryptResult, st as UnshieldPhase2SubmittedEvent, tn as ClearValue, tt as TransactionErrorEvent, u as ApproveUnderlyingRequest, v as PreparedFor, vt as ShieldPath, w as UnwrapAllRequest, wt as TransferCallbacks, x as SetOperatorRequest, xt as UnwrapResult, y as PreparedTransaction, yt as TransferOptions, z as WriteFunctionName } from "../types-Bz5-wHPv.js";
|
|
3
|
+
import { A as BatchDecryptAsOptions, C as ZamaSDKOptions, D as WrappersRegistryConfig, Dt as ZamaErrorCode, E as WrappersRegistry, Et as ZamaError, F as Permits, Ft as SerializedTransportKeyPair, It as ChecksummedAddress, Lt as PaginatedResult, M as Offline, Mt as PreparedPermit, N as Delegations, O as WrappedToken, P as DelegationStatus, Pt as SerializedPermitEip712, Rt as TokenWrapperPair, S as ZamaSDK, T as ListPairsOptions, _ as decryptValuesQueryOptions, b as MutationFactoryOptions, d as Decryption, f as BatchDecryptItem, g as EncryptedInput, h as DecryptResult, j as Token, jt as PreparePermitRequest, k as BatchBalancesResult, m as DelegatedDecryptOptions, p as BatchDecryptResult, v as SignerQueryContext, x as QueryFactoryOptions, y as zamaQueryKeys, zt as TokenWrapperPairWithMetadata } from "../index-DJYq1rAB.js";
|
|
4
|
+
import "../index-BHrjck_q.js";
|
|
5
|
+
import { a as invalidateAfterSetOperator, c as invalidateAfterUnshield, d as invalidateAfterWrap, f as invalidateBalanceQueries, i as invalidateAfterApproveUnderlying, l as invalidateAfterUnshieldSettled, m as invalidateWalletLifecycleQueries, n as QueryFilterLike, o as invalidateAfterShield, p as invalidateWagmiBalanceQueries, r as QueryLike, s as invalidateAfterTransfer, t as QueryClientLike, u as invalidateAfterUnwrap } from "../invalidation-CJ-pzOUG.js";
|
|
6
|
+
import { Address, Hex } from "viem";
|
|
7
|
+
//#region src/query/utils.d.ts
|
|
8
|
+
/** Union of TanStack Query option keys stripped by {@link filterQueryOptions}, leaving only domain parameters. */
|
|
9
|
+
type StrippedQueryOptionKeys = "gcTime" | "staleTime" | "enabled" | "select" | "refetchInterval" | "refetchOnMount" | "refetchOnWindowFocus" | "refetchOnReconnect" | "retry" | "retryDelay" | "retryOnMount" | "queryFn" | "queryKey" | "queryKeyHashFn" | "initialData" | "initialDataUpdatedAt" | "placeholderData" | "structuralSharing" | "throwOnError" | "meta" | "query" | "pollingInterval";
|
|
10
|
+
/**
|
|
11
|
+
* Remove TanStack behavioral options from a query config object so only domain
|
|
12
|
+
* parameters remain for the lower-level factory.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const params = filterQueryOptions({
|
|
17
|
+
* query: { enabled: false },
|
|
18
|
+
* gcTime: 60_000,
|
|
19
|
+
* owner: "0xabc",
|
|
20
|
+
* });
|
|
21
|
+
* // => { owner: "0xabc" }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function filterQueryOptions<TOptions extends Record<string, unknown>>(options: TOptions): Omit<TOptions, StrippedQueryOptionKeys>;
|
|
25
|
+
/**
|
|
26
|
+
* Stable hash function for query keys.
|
|
27
|
+
* Sorts object keys recursively and converts bigint values to strings.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* bigint values are serialized as decimal strings, so `42n` and `"42"` hash to
|
|
31
|
+
* the same token when they occupy the same position. This collision is accepted
|
|
32
|
+
* by design for the current query-key conventions in this package.
|
|
33
|
+
*/
|
|
34
|
+
declare function hashFn(queryKey: readonly unknown[]): string;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/query/token-metadata.d.ts
|
|
37
|
+
/** ERC-20 token metadata returned by {@link tokenMetadataQueryOptions}. */
|
|
38
|
+
interface TokenMetadata {
|
|
39
|
+
/** Human-readable token name. */
|
|
40
|
+
name: string;
|
|
41
|
+
/** Token ticker symbol. */
|
|
42
|
+
symbol: string;
|
|
43
|
+
/** Number of decimals the token uses. */
|
|
44
|
+
decimals: number;
|
|
45
|
+
}
|
|
46
|
+
/** Configuration for {@link tokenMetadataQueryOptions}. */
|
|
47
|
+
interface TokenMetadataQueryConfig {
|
|
48
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
49
|
+
query?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
/** Builds TanStack Query options for reading an ERC-20 token's name, symbol, and decimals. */
|
|
52
|
+
declare function tokenMetadataQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config?: TokenMetadataQueryConfig): QueryFactoryOptions<TokenMetadata, Error, TokenMetadata, ReturnType<typeof zamaQueryKeys.tokenMetadata.token>>;
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/query/is-confidential.d.ts
|
|
55
|
+
/** Configuration for {@link isConfidentialQueryOptions} and {@link isWrapperQueryOptions}. */
|
|
56
|
+
interface IsConfidentialQueryConfig {
|
|
57
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
58
|
+
query?: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
/** Builds TanStack Query options for reading whether a token address implements the confidential (ERC-7984) token interface. */
|
|
61
|
+
declare function isConfidentialQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config?: IsConfidentialQueryConfig): QueryFactoryOptions<boolean, Error, boolean, ReturnType<typeof zamaQueryKeys.isConfidential.token>>;
|
|
62
|
+
/** Builds TanStack Query options for reading whether a token address is a confidential wrapper (ERC-7984 wrapper) contract. */
|
|
63
|
+
declare function isWrapperQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config?: IsConfidentialQueryConfig): QueryFactoryOptions<boolean, Error, boolean, ReturnType<typeof zamaQueryKeys.isWrapper.token>>;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/query/total-supply.d.ts
|
|
66
|
+
/** Configuration for {@link totalSupplyQueryOptions}. */
|
|
67
|
+
interface TotalSupplyQueryConfig {
|
|
68
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
69
|
+
query?: Record<string, unknown>;
|
|
70
|
+
}
|
|
71
|
+
/** Builds TanStack Query options for reading a token's total supply. */
|
|
72
|
+
declare function totalSupplyQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config?: TotalSupplyQueryConfig): QueryFactoryOptions<bigint, Error, bigint, ReturnType<typeof zamaQueryKeys.totalSupply.token>>;
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/query/wrapper-discovery.d.ts
|
|
75
|
+
/** Configuration for {@link wrapperDiscoveryQueryOptions}. */
|
|
76
|
+
interface WrapperDiscoveryQueryConfig {
|
|
77
|
+
/**
|
|
78
|
+
* Address of any confidential token you control.
|
|
79
|
+
* Used to scope the query cache key and to gate whether the query
|
|
80
|
+
* is enabled — it does not affect which wrapper the registry returns.
|
|
81
|
+
*/
|
|
82
|
+
tokenAddress?: Address;
|
|
83
|
+
/**
|
|
84
|
+
* The ERC-20 token address to discover the confidential wrapper for.
|
|
85
|
+
* The registry is resolved automatically from chain config.
|
|
86
|
+
*/
|
|
87
|
+
erc20Address?: Address;
|
|
88
|
+
/**
|
|
89
|
+
* The resolved registry contract address for the current chain.
|
|
90
|
+
* Included in the query key so that switching chains invalidates
|
|
91
|
+
* stale cached results. Pass `undefined` when the chain ID is not
|
|
92
|
+
* yet known — the query will be disabled.
|
|
93
|
+
*/
|
|
94
|
+
registryAddress?: Address;
|
|
95
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
96
|
+
query?: Record<string, unknown>;
|
|
97
|
+
}
|
|
98
|
+
/** Builds TanStack Query options for discovering the confidential wrapper address for a given ERC-20 token (resolves to `null` when none is registered). */
|
|
99
|
+
declare function wrapperDiscoveryQueryOptions(registry: WrappersRegistry, config: WrapperDiscoveryQueryConfig): QueryFactoryOptions<Address | null, Error, Address | null, ReturnType<typeof zamaQueryKeys.wrapperDiscovery.token>>;
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/query/underlying-allowance.d.ts
|
|
102
|
+
/** Configuration for {@link underlyingAllowanceQueryOptions}. */
|
|
103
|
+
interface UnderlyingAllowanceQueryConfig {
|
|
104
|
+
/** Owner whose underlying-token allowance to read; the query stays disabled until provided. */
|
|
105
|
+
owner?: Address;
|
|
106
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
107
|
+
query?: Record<string, unknown>;
|
|
108
|
+
}
|
|
109
|
+
/** Builds TanStack Query options for reading the ERC-20 allowance the owner has granted a confidential wrapper on its underlying token. */
|
|
110
|
+
declare function underlyingAllowanceQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config: UnderlyingAllowanceQueryConfig): QueryFactoryOptions<bigint, Error, bigint, ReturnType<typeof zamaQueryKeys.underlyingAllowance.scope>>;
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/query/pending-unshield.d.ts
|
|
113
|
+
/** Configuration for {@link pendingUnshieldQueryOptions}. */
|
|
114
|
+
interface PendingUnshieldQueryConfig {
|
|
115
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
116
|
+
query?: Record<string, unknown>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Query options for reading the unwrap tx hash of an unshield that was
|
|
120
|
+
* interrupted between its two phases (returns `null` if none is pending).
|
|
121
|
+
*
|
|
122
|
+
* Backed by {@link ZamaSDK} storage via `WrappedToken.getPendingUnshield()`.
|
|
123
|
+
* `staleTime: 0` so the value reflects storage on mount; the unshield/unwrap
|
|
124
|
+
* mutations also invalidate this key on success.
|
|
125
|
+
*/
|
|
126
|
+
declare function pendingUnshieldQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config?: PendingUnshieldQueryConfig): QueryFactoryOptions<Hex | null, Error, Hex | null, ReturnType<typeof zamaQueryKeys.pendingUnshield.token>>;
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/query/confidential-is-operator.d.ts
|
|
129
|
+
/** Configuration for {@link confidentialIsOperatorQueryOptions}. */
|
|
130
|
+
interface ConfidentialIsOperatorQueryConfig {
|
|
131
|
+
/** Token holder whose operator authorization to check; the query stays disabled until provided. */
|
|
132
|
+
holder?: Address;
|
|
133
|
+
/** Spender address to check for operator authorization; the query stays disabled until provided. */
|
|
134
|
+
spender?: Address;
|
|
135
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
136
|
+
query?: Record<string, unknown>;
|
|
137
|
+
}
|
|
138
|
+
/** Builds TanStack Query options for reading whether a spender is an authorized operator of a holder on a confidential token. */
|
|
139
|
+
declare function confidentialIsOperatorQueryOptions(sdk: ZamaSDK, tokenAddress: Address | undefined, config: ConfidentialIsOperatorQueryConfig): QueryFactoryOptions<boolean, Error, boolean, ReturnType<typeof zamaQueryKeys.confidentialIsOperator.scope>>;
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/query/confidential-balance.d.ts
|
|
142
|
+
/** Configuration for {@link confidentialBalanceQueryOptions}. */
|
|
143
|
+
interface ConfidentialBalanceQueryConfig {
|
|
144
|
+
/** Address of the confidential token to read the balance of. */
|
|
145
|
+
tokenAddress: Address;
|
|
146
|
+
/** Account whose confidential balance to read; the query stays disabled until provided. */
|
|
147
|
+
account?: Address;
|
|
148
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
149
|
+
query?: Record<string, unknown>;
|
|
150
|
+
}
|
|
151
|
+
/** Query options for a single confidential token balance. Auto-gated on `account`. */
|
|
152
|
+
declare function confidentialBalanceQueryOptions(token: Token, config: ConfidentialBalanceQueryConfig, signerContext?: SignerQueryContext): QueryFactoryOptions<bigint, Error, bigint, ReturnType<typeof zamaQueryKeys.confidentialBalance.owner>>;
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/query/confidential-balances.d.ts
|
|
155
|
+
/** Configuration for {@link confidentialBalancesQueryOptions}. */
|
|
156
|
+
interface ConfidentialBalancesQueryConfig {
|
|
157
|
+
/** Account whose confidential balances to read; the query stays disabled until provided. */
|
|
158
|
+
account?: Address;
|
|
159
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
160
|
+
query?: Record<string, unknown>;
|
|
161
|
+
}
|
|
162
|
+
/** Builds TanStack Query options for reading the confidential balances of several tokens for one account in a single batch. */
|
|
163
|
+
declare function confidentialBalancesQueryOptions(tokens: Token[], config?: ConfidentialBalancesQueryConfig, signerContext?: SignerQueryContext): QueryFactoryOptions<BatchBalancesResult, Error, BatchBalancesResult, ReturnType<typeof zamaQueryKeys.confidentialBalances.tokens>>;
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/query/wrappers-registry.d.ts
|
|
166
|
+
/** Base configuration shared by the wrappers-registry query option factories. */
|
|
167
|
+
interface WrappersRegistryQueryConfig {
|
|
168
|
+
/** Registry contract address for the current chain; used as a query key discriminator. */
|
|
169
|
+
registryAddress: Address | undefined;
|
|
170
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
171
|
+
query?: Record<string, unknown>;
|
|
172
|
+
}
|
|
173
|
+
/** Builds TanStack Query options for reading all token wrapper pairs registered in the wrappers registry. */
|
|
174
|
+
declare function tokenPairsQueryOptions(sdk: ZamaSDK, config: WrappersRegistryQueryConfig): QueryFactoryOptions<readonly TokenWrapperPair[], Error, readonly TokenWrapperPair[], ReturnType<typeof zamaQueryKeys.wrappersRegistry.tokenPairs>>;
|
|
175
|
+
/** Configuration for {@link confidentialTokenAddressQueryOptions}. */
|
|
176
|
+
interface ConfidentialTokenAddressQueryConfig extends WrappersRegistryQueryConfig {
|
|
177
|
+
/** Underlying ERC-20 token address whose confidential counterpart to look up. */
|
|
178
|
+
tokenAddress?: Address;
|
|
179
|
+
}
|
|
180
|
+
/** Builds TanStack Query options for reading the confidential token address registered for a given underlying ERC-20 token. */
|
|
181
|
+
declare function confidentialTokenAddressQueryOptions(sdk: ZamaSDK, config: ConfidentialTokenAddressQueryConfig): QueryFactoryOptions<readonly [boolean, Address], Error, readonly [boolean, Address], ReturnType<typeof zamaQueryKeys.wrappersRegistry.confidentialTokenAddress>>;
|
|
182
|
+
/** Configuration for {@link tokenAddressQueryOptions}. */
|
|
183
|
+
interface TokenAddressQueryConfig extends WrappersRegistryQueryConfig {
|
|
184
|
+
/** Confidential token address whose underlying ERC-20 counterpart to look up. */
|
|
185
|
+
confidentialTokenAddress?: Address;
|
|
186
|
+
}
|
|
187
|
+
/** Builds TanStack Query options for reading the underlying ERC-20 token address registered for a given confidential token. */
|
|
188
|
+
declare function tokenAddressQueryOptions(sdk: ZamaSDK, config: TokenAddressQueryConfig): QueryFactoryOptions<readonly [boolean, Address], Error, readonly [boolean, Address], ReturnType<typeof zamaQueryKeys.wrappersRegistry.tokenAddress>>;
|
|
189
|
+
/** Builds TanStack Query options for reading the total number of token wrapper pairs in the registry. */
|
|
190
|
+
declare function tokenPairsLengthQueryOptions(sdk: ZamaSDK, config: WrappersRegistryQueryConfig): QueryFactoryOptions<bigint, Error, bigint, ReturnType<typeof zamaQueryKeys.wrappersRegistry.tokenPairsLength>>;
|
|
191
|
+
/** Configuration for {@link tokenPairsSliceQueryOptions}. */
|
|
192
|
+
interface TokenPairsSliceQueryConfig extends WrappersRegistryQueryConfig {
|
|
193
|
+
/** Zero-based index of the first pair in the slice (inclusive). */
|
|
194
|
+
fromIndex?: bigint;
|
|
195
|
+
/** Index bounding the end of the slice. */
|
|
196
|
+
toIndex?: bigint;
|
|
197
|
+
}
|
|
198
|
+
/** Builds TanStack Query options for reading a contiguous slice of the registry's token wrapper pairs. */
|
|
199
|
+
declare function tokenPairsSliceQueryOptions(sdk: ZamaSDK, config: TokenPairsSliceQueryConfig): QueryFactoryOptions<readonly TokenWrapperPair[], Error, readonly TokenWrapperPair[], ReturnType<typeof zamaQueryKeys.wrappersRegistry.tokenPairsSlice>>;
|
|
200
|
+
/** Configuration for {@link tokenPairQueryOptions}. */
|
|
201
|
+
interface TokenPairQueryConfig extends WrappersRegistryQueryConfig {
|
|
202
|
+
/** Zero-based index of the token wrapper pair to read. */
|
|
203
|
+
index?: bigint;
|
|
204
|
+
}
|
|
205
|
+
/** Builds TanStack Query options for reading a single token wrapper pair by its index in the registry. */
|
|
206
|
+
declare function tokenPairQueryOptions(sdk: ZamaSDK, config: TokenPairQueryConfig): QueryFactoryOptions<TokenWrapperPair, Error, TokenWrapperPair, ReturnType<typeof zamaQueryKeys.wrappersRegistry.tokenPair>>;
|
|
207
|
+
/** Configuration for {@link isConfidentialTokenValidQueryOptions}. */
|
|
208
|
+
interface IsConfidentialTokenValidQueryConfig extends WrappersRegistryQueryConfig {
|
|
209
|
+
/** Confidential token address to validate against the registry. */
|
|
210
|
+
confidentialTokenAddress?: Address;
|
|
211
|
+
}
|
|
212
|
+
/** Builds TanStack Query options for checking whether a confidential token is registered and valid in the registry. */
|
|
213
|
+
declare function isConfidentialTokenValidQueryOptions(sdk: ZamaSDK, config: IsConfidentialTokenValidQueryConfig): QueryFactoryOptions<boolean, Error, boolean, ReturnType<typeof zamaQueryKeys.wrappersRegistry.isConfidentialTokenValid>>;
|
|
214
|
+
/** Configuration for {@link listPairsQueryOptions}. */
|
|
215
|
+
interface ListPairsQueryConfig {
|
|
216
|
+
/**
|
|
217
|
+
* The registry address for this chain — used as a query key discriminator.
|
|
218
|
+
* The registry instance already knows how to resolve the address for the
|
|
219
|
+
* current chain; this field just keeps the TanStack Query cache isolated
|
|
220
|
+
* per registry contract.
|
|
221
|
+
*/
|
|
222
|
+
registryAddress: Address | undefined;
|
|
223
|
+
/** 1-based page number to fetch; defaults to `1`. */
|
|
224
|
+
page?: number;
|
|
225
|
+
/** Number of pairs per page; defaults to `100`. */
|
|
226
|
+
pageSize?: number;
|
|
227
|
+
/** When `true`, resolve each pair's on-chain metadata; defaults to `false`. */
|
|
228
|
+
metadata?: boolean;
|
|
229
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
230
|
+
query?: Record<string, unknown>;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Query options for paginated listing of token wrapper pairs.
|
|
234
|
+
*
|
|
235
|
+
* Accepts a {@link WrappersRegistry} instance rather than a raw provider so that the
|
|
236
|
+
* class-level TTL cache is shared across multiple `queryFn` executions. Pass
|
|
237
|
+
* `sdk.registry` (the ZamaSDK lazy singleton) to ensure a single shared cache.
|
|
238
|
+
*/
|
|
239
|
+
declare function listPairsQueryOptions(registry: WrappersRegistry, config: ListPairsQueryConfig): QueryFactoryOptions<PaginatedResult<TokenWrapperPair | TokenWrapperPairWithMetadata>, Error, PaginatedResult<TokenWrapperPair | TokenWrapperPairWithMetadata>, ReturnType<typeof zamaQueryKeys.wrappersRegistry.listPairs>>;
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/query/shield.d.ts
|
|
242
|
+
/** Variables for {@link shieldMutationOptions}. */
|
|
243
|
+
interface ShieldParams extends ShieldOptions {
|
|
244
|
+
/** Amount of the public ERC-20 to shield, in the token's base units. */
|
|
245
|
+
amount: bigint;
|
|
246
|
+
}
|
|
247
|
+
/** Builds TanStack Query mutation options for {@link WrappedToken.shield | shielding} a public ERC-20 into its confidential form. @see {@link ShieldParams} */
|
|
248
|
+
declare function shieldMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.shield", Address], ShieldParams, TransactionResult>;
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/query/transfer.d.ts
|
|
251
|
+
/** Variables for {@link confidentialTransferMutationOptions}. */
|
|
252
|
+
interface ConfidentialTransferParams extends TransferOptions {
|
|
253
|
+
/** Recipient address. */
|
|
254
|
+
to: Address;
|
|
255
|
+
/** Amount of tokens to transfer, in the token's base units. */
|
|
256
|
+
amount: bigint;
|
|
257
|
+
}
|
|
258
|
+
/** Builds TanStack Query mutation options for {@link Token.confidentialTransfer | transferring} confidential tokens. @see {@link ConfidentialTransferParams} */
|
|
259
|
+
declare function confidentialTransferMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.confidentialTransfer", Address], ConfidentialTransferParams, TransactionResult>;
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/query/transfer-and-call.d.ts
|
|
262
|
+
/** Variables for {@link confidentialTransferAndCallMutationOptions}. */
|
|
263
|
+
interface ConfidentialTransferAndCallParams extends TransferOptions {
|
|
264
|
+
/** Recipient address. */
|
|
265
|
+
to: Address;
|
|
266
|
+
/** Amount of tokens to transfer, in the token's base units. */
|
|
267
|
+
amount: bigint;
|
|
268
|
+
/** Opaque bytes forwarded to the recipient's ERC-7984 receiver hook. */
|
|
269
|
+
data: Hex;
|
|
270
|
+
}
|
|
271
|
+
/** Builds TanStack Query mutation options for {@link Token.confidentialTransferAndCall | transferring} confidential tokens and invoking the recipient's receiver hook. @see {@link ConfidentialTransferAndCallParams} */
|
|
272
|
+
declare function confidentialTransferAndCallMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.confidentialTransferAndCall", Address], ConfidentialTransferAndCallParams, TransactionResult>;
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/query/transfer-from.d.ts
|
|
275
|
+
/** Variables for {@link confidentialTransferFromMutationOptions}. */
|
|
276
|
+
interface ConfidentialTransferFromParams {
|
|
277
|
+
/** Address to transfer from. */
|
|
278
|
+
from: Address;
|
|
279
|
+
/** Recipient address. */
|
|
280
|
+
to: Address;
|
|
281
|
+
/** Amount of tokens to transfer, in the token's base units. */
|
|
282
|
+
amount: bigint;
|
|
283
|
+
/** Optional progress callbacks for the multi-step transfer flow. */
|
|
284
|
+
callbacks?: TransferCallbacks;
|
|
285
|
+
}
|
|
286
|
+
/** Builds TanStack Query mutation options for {@link Token.confidentialTransferFrom | transferring} confidential tokens from another account (operator flow). @see {@link ConfidentialTransferFromParams} */
|
|
287
|
+
declare function confidentialTransferFromMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.confidentialTransferFrom", Address], ConfidentialTransferFromParams, TransactionResult>;
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region src/query/transfer-from-and-call.d.ts
|
|
290
|
+
/** Variables for {@link confidentialTransferFromAndCallMutationOptions}. */
|
|
291
|
+
interface ConfidentialTransferFromAndCallParams {
|
|
292
|
+
/** Address to transfer from. */
|
|
293
|
+
from: Address;
|
|
294
|
+
/** Recipient address. */
|
|
295
|
+
to: Address;
|
|
296
|
+
/** Amount of tokens to transfer, in the token's base units. */
|
|
297
|
+
amount: bigint;
|
|
298
|
+
/** Opaque bytes forwarded to the recipient's ERC-7984 receiver hook. */
|
|
299
|
+
data: Hex;
|
|
300
|
+
/** Optional progress callbacks for the multi-step transfer flow. */
|
|
301
|
+
callbacks?: TransferCallbacks;
|
|
302
|
+
}
|
|
303
|
+
/** Builds TanStack Query mutation options for {@link Token.confidentialTransferFromAndCall | transferring} confidential tokens from another account and invoking the recipient's receiver hook. @see {@link ConfidentialTransferFromAndCallParams} */
|
|
304
|
+
declare function confidentialTransferFromAndCallMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.confidentialTransferFromAndCall", Address], ConfidentialTransferFromAndCallParams, TransactionResult>;
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/query/set-operator.d.ts
|
|
307
|
+
/** Variables for {@link confidentialSetOperatorMutationOptions}. */
|
|
308
|
+
interface ConfidentialSetOperatorParams {
|
|
309
|
+
/** Operator address to authorize. */
|
|
310
|
+
operator: Address;
|
|
311
|
+
/** Unix timestamp (seconds) when the operator authorization expires; defaults to one hour from now. */
|
|
312
|
+
until?: number;
|
|
313
|
+
}
|
|
314
|
+
/** Builds TanStack Query mutation options for {@link Token.setOperator | authorizing} an operator on a confidential token. @see {@link ConfidentialSetOperatorParams} */
|
|
315
|
+
declare function confidentialSetOperatorMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.confidentialSetOperator", Address], ConfidentialSetOperatorParams, TransactionResult>;
|
|
316
|
+
//#endregion
|
|
317
|
+
//#region src/query/approve-underlying.d.ts
|
|
318
|
+
/** Variables for {@link approveUnderlyingMutationOptions}. */
|
|
319
|
+
interface ApproveUnderlyingParams {
|
|
320
|
+
/** Amount of the underlying ERC-20 to approve, in its base units; omit for a max approval. */
|
|
321
|
+
amount?: bigint;
|
|
322
|
+
}
|
|
323
|
+
/** Builds TanStack Query mutation options for {@link WrappedToken.approveUnderlying | approving} the wrapper to spend the underlying ERC-20. @see {@link ApproveUnderlyingParams} */
|
|
324
|
+
declare function approveUnderlyingMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.approveUnderlying", Address], ApproveUnderlyingParams, TransactionResult>;
|
|
325
|
+
//#endregion
|
|
326
|
+
//#region src/query/unshield.d.ts
|
|
327
|
+
/** Variables for {@link unshieldMutationOptions}. */
|
|
328
|
+
interface UnshieldParams extends UnshieldOptions {
|
|
329
|
+
/** Amount of tokens to unshield, in the token's base units. */
|
|
330
|
+
amount: bigint;
|
|
331
|
+
}
|
|
332
|
+
/** Builds TanStack Query mutation options for {@link WrappedToken.unshield | unshielding} a confidential token back into its public ERC-20. @see {@link UnshieldParams} */
|
|
333
|
+
declare function unshieldMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.unshield", Address], UnshieldParams, TransactionResult>;
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/query/unshield-all.d.ts
|
|
336
|
+
/** Variables for {@link unshieldAllMutationOptions}. */
|
|
337
|
+
interface UnshieldAllParams extends UnshieldCallbacks {}
|
|
338
|
+
/** Builds TanStack Query mutation options for {@link WrappedToken.unshieldAll | unshielding} the entire confidential balance back into the public ERC-20. @see {@link UnshieldAllParams} */
|
|
339
|
+
declare function unshieldAllMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.unshieldAll", Address], UnshieldAllParams | void, TransactionResult>;
|
|
340
|
+
//#endregion
|
|
341
|
+
//#region src/query/resume-unshield.d.ts
|
|
342
|
+
/** Variables for {@link resumeUnshieldMutationOptions}. */
|
|
343
|
+
interface ResumeUnshieldParams extends UnshieldCallbacks {
|
|
344
|
+
/** Hash of the earlier unwrap request transaction to resume from. */
|
|
345
|
+
unwrapTxHash: Hex;
|
|
346
|
+
}
|
|
347
|
+
/** Builds TanStack Query mutation options for {@link WrappedToken.resumeUnshield | resuming} an interrupted unshield from its unwrap request transaction. @see {@link ResumeUnshieldParams} */
|
|
348
|
+
declare function resumeUnshieldMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.resumeUnshield", Address], ResumeUnshieldParams, TransactionResult>;
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region src/query/unwrap.d.ts
|
|
351
|
+
/** Variables for {@link unwrapMutationOptions}. */
|
|
352
|
+
interface UnwrapParams {
|
|
353
|
+
/** Amount of tokens to unwrap, in the token's base units. */
|
|
354
|
+
amount: bigint;
|
|
355
|
+
}
|
|
356
|
+
/** Builds TanStack Query mutation options for {@link WrappedToken.unwrap | unwrapping} a confidential token (request phase of the two-phase unwrap). @see {@link UnwrapParams} */
|
|
357
|
+
declare function unwrapMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.unwrap", Address], UnwrapParams, UnwrapResult>;
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region src/query/wrap.d.ts
|
|
360
|
+
/** Variables for {@link wrapMutationOptions}. */
|
|
361
|
+
interface WrapParams extends WrapOptions {
|
|
362
|
+
/** Amount of the public ERC-20 to wrap, in the token's base units. */
|
|
363
|
+
amount: bigint;
|
|
364
|
+
}
|
|
365
|
+
/** Builds TanStack Query mutation options for {@link WrappedToken.wrap | wrapping} a public ERC-20 into its confidential form. @see {@link WrapParams} */
|
|
366
|
+
declare function wrapMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.wrap", Address], WrapParams, TransactionResult>;
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region src/query/unwrap-all.d.ts
|
|
369
|
+
/** Builds TanStack Query mutation options for {@link WrappedToken.unwrapAll | unwrapping} the entire confidential balance. */
|
|
370
|
+
declare function unwrapAllMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.unwrapAll", Address], void, UnwrapResult>;
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region src/query/finalize-unwrap.d.ts
|
|
373
|
+
/** Variables for {@link finalizeUnwrapMutationOptions}. */
|
|
374
|
+
type FinalizeUnwrapParams = {
|
|
375
|
+
/** Identifier from an `UnwrapRequested` event. */
|
|
376
|
+
unwrapRequestId: EncryptedValue;
|
|
377
|
+
};
|
|
378
|
+
/** Builds TanStack Query mutation options for {@link WrappedToken.finalizeUnwrap | finalizing} a previously requested unwrap. @see {@link FinalizeUnwrapParams} */
|
|
379
|
+
declare function finalizeUnwrapMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.finalizeUnwrap", Address], FinalizeUnwrapParams, TransactionResult>;
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/query/encrypt.d.ts
|
|
382
|
+
/** Builds TanStack Query mutation options for {@link ZamaSDK.encrypt | encrypting} plaintext inputs into an encrypted payload. */
|
|
383
|
+
declare function encryptMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.encrypt"], EncryptParams, EncryptResult>;
|
|
384
|
+
//#endregion
|
|
385
|
+
//#region src/query/delegated-decrypt.d.ts
|
|
386
|
+
/** Variables for {@link delegatedDecryptValuesMutationOptions}. */
|
|
387
|
+
interface DelegatedDecryptValuesMutationParams {
|
|
388
|
+
/** Encrypted values (with their contract addresses) to decrypt. */
|
|
389
|
+
encryptedInputs: EncryptedInput[];
|
|
390
|
+
/** Address of the account that delegated decryption rights to the connected wallet. */
|
|
391
|
+
delegatorAddress: Address;
|
|
392
|
+
}
|
|
393
|
+
/** Builds TanStack Query mutation options for {@link Decryption.delegatedDecryptValues | decrypting} encrypted values via delegated decryption credentials. @see {@link DelegatedDecryptValuesMutationParams} */
|
|
394
|
+
declare function delegatedDecryptValuesMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.delegatedDecryptValues"], DelegatedDecryptValuesMutationParams, Readonly<Record<EncryptedValue, ClearValue>>>;
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/query/public-decrypt.d.ts
|
|
397
|
+
/** Builds TanStack Query mutation options for {@link Decryption.decryptPublicValues | publicly decrypting} encrypted values, caching each clear result. */
|
|
398
|
+
declare function decryptPublicValuesMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.decryptPublicValues"], EncryptedValue[], DecryptPublicValuesResult>;
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region src/query/grant-permit.d.ts
|
|
401
|
+
/** Builds TanStack Query mutation options for {@link Permits.grantPermit | granting} decryption permits for the given contract addresses. */
|
|
402
|
+
declare function grantPermitMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.grantPermit"], Address[], void>;
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/query/prepare-permit.d.ts
|
|
405
|
+
/** Builds TanStack Query mutation options for {@link Offline.preparePermit | preparing} an offline decryption permit. */
|
|
406
|
+
declare function preparePermitMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.preparePermit"], PreparePermitRequest, PreparedPermit>;
|
|
407
|
+
//#endregion
|
|
408
|
+
//#region src/query/register-permit.d.ts
|
|
409
|
+
/** Parameters for {@link registerPermitMutationOptions}. */
|
|
410
|
+
interface RegisterPermitParams {
|
|
411
|
+
/** The payload `sdk.offline.preparePermit` returned. */
|
|
412
|
+
prepared: PreparedPermit;
|
|
413
|
+
/** The `eth_signTypedData_v4` signature over `prepared.eip712`. */
|
|
414
|
+
signature: Hex;
|
|
415
|
+
}
|
|
416
|
+
/** Builds TanStack Query mutation options for {@link Permits.registerPermit | registering} a signed offline permit. */
|
|
417
|
+
declare function registerPermitMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.registerPermit"], RegisterPermitParams, void>;
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/query/has-permit.d.ts
|
|
420
|
+
/** Configuration for {@link hasPermitQueryOptions}. */
|
|
421
|
+
interface HasPermitQueryConfig {
|
|
422
|
+
/** Contract addresses to check credentials against. */
|
|
423
|
+
contractAddresses: Address[];
|
|
424
|
+
/**
|
|
425
|
+
* Standard TanStack query options. `hasPermit` intentionally overrides cache
|
|
426
|
+
* timing because permit state is wallet-local, not server state: every fetch
|
|
427
|
+
* should read the SDK credential service directly.
|
|
428
|
+
*/
|
|
429
|
+
query?: Record<string, unknown>;
|
|
430
|
+
}
|
|
431
|
+
/** Builds TanStack Query options for reading whether the connected wallet holds a valid decryption permit for the given contracts. */
|
|
432
|
+
declare function hasPermitQueryOptions(sdk: ZamaSDK, config: HasPermitQueryConfig, signerContext?: SignerQueryContext): QueryFactoryOptions<boolean, Error, boolean, ReturnType<typeof zamaQueryKeys.hasPermit.scope>>;
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region src/query/revoke-permits.d.ts
|
|
435
|
+
/** TanStack Query mutation factory for {@link Permits.revokePermits}. */
|
|
436
|
+
declare function revokePermitsMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.revokePermits"], Address[] | void, void>;
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/query/clear-credentials.d.ts
|
|
439
|
+
/** TanStack Query mutation factory for {@link Permits.clear}. */
|
|
440
|
+
declare function clearCredentialsMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.clearCredentials"], void, void>;
|
|
441
|
+
//#endregion
|
|
442
|
+
//#region src/query/delegate-decryption.d.ts
|
|
443
|
+
/** Variables for {@link delegateDecryptionMutationOptions}. */
|
|
444
|
+
interface DelegateDecryptionParams {
|
|
445
|
+
/** Address to grant delegated decryption rights to. */
|
|
446
|
+
delegateAddress: Address;
|
|
447
|
+
/** When the delegation expires; omit for no expiry. */
|
|
448
|
+
expirationDate?: Date;
|
|
449
|
+
}
|
|
450
|
+
/** Builds TanStack Query mutation options for {@link Delegations.delegateDecryption | granting} delegated decryption rights on a contract. @see {@link DelegateDecryptionParams} */
|
|
451
|
+
declare function delegateDecryptionMutationOptions(sdk: ZamaSDK, contractAddress: Address): MutationFactoryOptions<readonly ["zama.delegateDecryption", Address], DelegateDecryptionParams, TransactionResult>;
|
|
452
|
+
//#endregion
|
|
453
|
+
//#region src/query/decrypt-balance-as.d.ts
|
|
454
|
+
/** Variables for {@link decryptBalanceAsMutationOptions}. */
|
|
455
|
+
interface DecryptBalanceAsParams {
|
|
456
|
+
/** Address of the account that delegated decryption rights to the connected wallet. */
|
|
457
|
+
delegatorAddress: Address;
|
|
458
|
+
/** Account whose on-chain balance to read; defaults to the delegator address. */
|
|
459
|
+
accountAddress?: Address;
|
|
460
|
+
}
|
|
461
|
+
/** Builds TanStack Query mutation options for {@link Token.decryptBalanceAs | decrypting} a balance via delegated decryption credentials. @see {@link DecryptBalanceAsParams} */
|
|
462
|
+
declare function decryptBalanceAsMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.decryptBalanceAs", Address], DecryptBalanceAsParams, bigint>;
|
|
463
|
+
//#endregion
|
|
464
|
+
//#region src/query/batch-decrypt-balances-as.d.ts
|
|
465
|
+
/** Variables for {@link batchDecryptBalancesAsMutationOptions}. */
|
|
466
|
+
type BatchDecryptBalancesAsParams = BatchDecryptAsOptions;
|
|
467
|
+
/** Builds TanStack Query mutation options for {@link Token.batchDecryptBalancesAs | decrypting} multiple token balances via delegated decryption credentials. @see {@link BatchDecryptBalancesAsParams} */
|
|
468
|
+
declare function batchDecryptBalancesAsMutationOptions(tokens: Token[]): MutationFactoryOptions<readonly ["zama.batchDecryptBalancesAs", ...Address[]], BatchDecryptBalancesAsParams, Map<Address, bigint>>;
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region src/query/revoke-delegation.d.ts
|
|
471
|
+
/** Variables for {@link revokeDelegationMutationOptions}. */
|
|
472
|
+
interface RevokeDelegationParams {
|
|
473
|
+
/** Address whose delegated decryption rights to revoke. */
|
|
474
|
+
delegateAddress: Address;
|
|
475
|
+
}
|
|
476
|
+
/** Builds TanStack Query mutation options for {@link Delegations.revokeDelegation | revoking} delegated decryption rights on a contract. @see {@link RevokeDelegationParams} */
|
|
477
|
+
declare function revokeDelegationMutationOptions(sdk: ZamaSDK, contractAddress: Address): MutationFactoryOptions<readonly ["zama.revokeDelegation", Address], RevokeDelegationParams, TransactionResult>;
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region src/query/delegation-status.d.ts
|
|
480
|
+
/** Configuration for {@link delegationStatusQueryOptions}. */
|
|
481
|
+
interface DelegationStatusQueryConfig {
|
|
482
|
+
/** Contract the delegation applies to; pass `undefined` to keep the query disabled. */
|
|
483
|
+
contractAddress: Address | undefined;
|
|
484
|
+
/** Address granting the delegated decryption rights; the query stays disabled until provided. */
|
|
485
|
+
delegatorAddress?: Address;
|
|
486
|
+
/** Address receiving the delegated decryption rights; the query stays disabled until provided. */
|
|
487
|
+
delegateAddress?: Address;
|
|
488
|
+
/** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
|
|
489
|
+
query?: Record<string, unknown>;
|
|
490
|
+
}
|
|
491
|
+
/** Builds TanStack Query options for reading the decryption-delegation status between a delegator and a delegate on a contract. */
|
|
492
|
+
declare function delegationStatusQueryOptions(sdk: ZamaSDK, config: DelegationStatusQueryConfig): QueryFactoryOptions<DelegationStatus, Error, DelegationStatus, ReturnType<typeof zamaQueryKeys.delegationStatus.scope>>;
|
|
493
|
+
//#endregion
|
|
494
|
+
export { type ApprovalStrategy, type ApproveUnderlyingParams, type ApproveUnderlyingRequest, type ApproveUnderlyingSubmittedEvent, type BaseEvent, type BatchBalancesResult, type BatchDecryptAsOptions, type BatchDecryptBalancesAsParams, type BatchDecryptItem, type BatchDecryptResult, type ChecksummedAddress, type ClearValue, type ConfidentialBalanceQueryConfig, type ConfidentialBalancesQueryConfig, type ConfidentialIsOperatorQueryConfig, type ConfidentialSetOperatorParams, type ConfidentialTokenAddressQueryConfig, type ConfidentialTransferAndCallParams, type ConfidentialTransferEvent, type ConfidentialTransferFromAndCallParams, type ConfidentialTransferFromParams, type ConfidentialTransferFromRequest, type ConfidentialTransferParams, type ConfidentialTransferRequest, type ContractAbi, type DecryptBalanceAsParams, type DecryptEndEvent, type DecryptErrorEvent, type EncryptedInput as DecryptInput, type DecryptPublicValuesResult, type DecryptResult, type DecryptStartEvent, type Decryption, type DelegateDecryptionParams, type DelegateDecryptionRequest, type DelegatedDecryptOptions, type DelegatedDecryptValuesMutationParams, type DelegationStatus, type DelegationStatusQueryConfig, type DelegationSubmittedEvent, type Delegations, type EIP712TypedData, type EncryptEndEvent, type EncryptErrorEvent, type EncryptInput, type EncryptParams, type EncryptResult, type EncryptStartEvent, type EncryptedValue, type FheChain, type FheChainAuth, type FhevmClient, type FhevmRelayerOptions, type FhevmRuntimeConfig, type FinalizeUnwrapParams, type FinalizeUnwrapRequest, type FinalizeUnwrapSubmittedEvent, type GenericLogger, type GenericProvider, type GenericSigner, type GenericStorage, type HasPermitQueryConfig, type IsConfidentialQueryConfig, type IsConfidentialTokenValidQueryConfig, type ListPairsOptions, type ListPairsQueryConfig, type MutationFactoryOptions, type Offline, type OnChainEvent, type PaginatedResult, type PendingUnshieldQueryConfig, type PermitErrorEvent, type PermitOperation, type Permits, type PrepareFees, type PrepareOptions, type PreparePermitRequest, type PrepareTransactionRequest, type PreparedFor, type PreparedPermit, type PreparedTransaction, type QueryClientLike, type QueryFactoryOptions, type QueryFilterLike, type QueryLike, type RawLog, type ReadContractArgs, type ReadContractConfig, type ReadContractReturnType, type ReadFunctionName, type RegisterPermitParams, type RelayerSDK, type ResumeUnshieldParams, type RevokeDelegationParams, type RevokeDelegationRequest, type RevokeDelegationSubmittedEvent, type SerializedPermitEip712, type SerializedTransportKeyPair, type SetOperatorRequest, type SetOperatorSubmittedEvent, type ShieldCallbacks, type ShieldOptions, type ShieldParams, type ShieldPath, type ShieldSubmittedEvent, type SignerQueryContext, type StrippedQueryOptionKeys, type Token, type TokenAddressQueryConfig, type TokenMetadata, type TokenMetadataQueryConfig, type TokenPairQueryConfig, type TokenPairsSliceQueryConfig, type TokenWrapperPair, type TokenWrapperPairWithMetadata, type TotalSupplyQueryConfig, type TransactionErrorEvent, type TransactionKind, type TransactionOperation, type TransactionReceipt, type TransactionResult, type TransferAndCallRequest, type TransferCallbacks, type TransferFromSubmittedEvent, type TransferOptions, type TransferSubmittedEvent, type UnderlyingAllowanceQueryConfig, type UnshieldAllParams, type UnshieldCallbacks, type UnshieldOptions, type UnshieldParams, type UnshieldPhase1SubmittedEvent, type UnshieldPhase2StartedEvent, type UnshieldPhase2SubmittedEvent, type UnwrapAllRequest, type UnwrapFinalizedEvent, type UnwrapParams, type UnwrapRequest, type UnwrapRequestedEvent, type UnwrapResult, type UnwrapSubmittedEvent, type WalletAccount, type WalletAccountChange, type WalletAccountListener, type WalletAccountStore, type WrapEvent, type WrapOptions, type WrapParams, type WrapRequest, type WrapSubmittedEvent, type WrappedToken, type WrapperDiscoveryQueryConfig, type WrappersRegistry, type WrappersRegistryConfig, type WrappersRegistryQueryConfig, type WriteContractArgs, type WriteContractConfig, type WriteFunctionName, type ZamaConfig, type ZamaError, type ZamaErrorCode, type ZamaSDK, type ZamaSDKEvent, type ZamaSDKEventListener, ZamaSDKEvents, type ZamaSDKOptions, approveUnderlyingMutationOptions, batchDecryptBalancesAsMutationOptions, clearCredentialsMutationOptions, confidentialBalanceQueryOptions, confidentialBalancesQueryOptions, confidentialIsOperatorQueryOptions, confidentialSetOperatorMutationOptions, confidentialTokenAddressQueryOptions, confidentialTransferAndCallMutationOptions, confidentialTransferFromAndCallMutationOptions, confidentialTransferFromMutationOptions, confidentialTransferMutationOptions, decryptBalanceAsMutationOptions, decryptPublicValuesMutationOptions, decryptValuesQueryOptions, delegateDecryptionMutationOptions, delegatedDecryptValuesMutationOptions, delegationStatusQueryOptions, encryptMutationOptions, filterQueryOptions, finalizeUnwrapMutationOptions, grantPermitMutationOptions, hasPermitQueryOptions, hashFn, invalidateAfterApproveUnderlying, invalidateAfterSetOperator, invalidateAfterShield, invalidateAfterTransfer, invalidateAfterUnshield, invalidateAfterUnshieldSettled, invalidateAfterUnwrap, invalidateAfterWrap, invalidateBalanceQueries, invalidateWagmiBalanceQueries, invalidateWalletLifecycleQueries, isConfidentialQueryOptions, isConfidentialTokenValidQueryOptions, isWrapperQueryOptions, listPairsQueryOptions, pendingUnshieldQueryOptions, preparePermitMutationOptions, registerPermitMutationOptions, resumeUnshieldMutationOptions, revokeDelegationMutationOptions, revokePermitsMutationOptions, shieldMutationOptions, tokenAddressQueryOptions, tokenMetadataQueryOptions, tokenPairQueryOptions, tokenPairsLengthQueryOptions, tokenPairsQueryOptions, tokenPairsSliceQueryOptions, totalSupplyQueryOptions, underlyingAllowanceQueryOptions, unshieldAllMutationOptions, unshieldMutationOptions, unwrapAllMutationOptions, unwrapMutationOptions, wrapMutationOptions, wrapperDiscoveryQueryOptions, zamaQueryKeys };
|
|
495
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/query/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as e}from"../relayer-B6Zo6EkX.js";import{A as t,N as n,Z as r,a as i,b as a,d as o,f as s,h as c,i as l,k as u,n as d,o as f,r as ee,s as p,t as m,v as h,x as g,z as _}from"../wrappers-registry-BfQr2QHn.js";import{t as v}from"../token-BMQ6xlrk.js";import{r as y}from"../assertions-Ca1ePdRJ.js";import{getAddress as b,zeroAddress as x}from"viem";import{z as S}from"zod/mini";function te(e){if(!C(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!C(n)||!n.hasOwnProperty(`isPrototypeOf`))}function C(e){return Object.prototype.toString.call(e)===`[object Object]`}function w(e){let{gcTime:t,staleTime:n,enabled:r,select:i,refetchInterval:a,refetchOnMount:o,refetchOnWindowFocus:s,refetchOnReconnect:c,retry:l,retryDelay:u,retryOnMount:d,queryFn:f,queryKey:ee,queryKeyHashFn:p,initialData:m,initialDataUpdatedAt:h,placeholderData:g,structuralSharing:_,throwOnError:v,meta:y,query:b,pollingInterval:x,...S}=e;return S}function T(e){return JSON.stringify(e,(e,t)=>te(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):typeof t==`bigint`?t.toString():t)}const E=e=>e.map(e=>b(e)),D=e=>e===void 0?void 0:b(e),O=e=>e?{walletAddress:b(e.address),walletChainId:e.chainId}:{},k={confidentialBalance:{all:[`zama.confidentialBalance`],token:e=>[`zama.confidentialBalance`,{tokenAddress:b(e)}],owner:(e,t,n)=>[`zama.confidentialBalance`,{tokenAddress:b(e),...O(n),...t?{owner:b(t)}:{}}]},confidentialBalances:{all:[`zama.confidentialBalances`],tokens:(e,t,n)=>[`zama.confidentialBalances`,{tokenAddresses:E(e),...O(n),...t?{owner:b(t)}:{}}]},tokenMetadata:{all:[`zama.tokenMetadata`],token:e=>[`zama.tokenMetadata`,{tokenAddress:b(e)}]},isConfidential:{all:[`zama.isConfidential`],token:e=>[`zama.isConfidential`,{tokenAddress:b(e)}]},isWrapper:{all:[`zama.isWrapper`],token:e=>[`zama.isWrapper`,{tokenAddress:b(e)}]},wrapperDiscovery:{all:[`zama.wrapperDiscovery`],token:(e,t,n)=>{let r=D(e),i=D(t),a=D(n);return[`zama.wrapperDiscovery`,{...r?{tokenAddress:r}:{},...i?{erc20Address:i}:{},...a?{registryAddress:a}:{}}]}},underlyingAllowance:{all:[`zama.underlyingAllowance`],token:e=>[`zama.underlyingAllowance`,{tokenAddress:b(e)}],scope:(e,t)=>[`zama.underlyingAllowance`,{tokenAddress:b(e),...t?{owner:b(t)}:{}}]},confidentialIsOperator:{all:[`zama.confidentialIsOperator`],token:e=>{let t=D(e);return[`zama.confidentialIsOperator`,t?{tokenAddress:t}:{}]},scope:(e,t,n)=>{let r=D(e),i=D(t),a=D(n);return[`zama.confidentialIsOperator`,{...r?{tokenAddress:r}:{},...i?{holder:i}:{},...a?{spender:a}:{}}]}},totalSupply:{all:[`zama.totalSupply`],token:e=>[`zama.totalSupply`,{tokenAddress:b(e)}]},pendingUnshield:{all:[`zama.pendingUnshield`],token:e=>[`zama.pendingUnshield`,{tokenAddress:b(e)}]},hasPermit:{all:[`zama.hasPermit`],scope:(e,t)=>[`zama.hasPermit`,{...O(t),contractAddresses:E(e).sort()}]},delegationStatus:{all:[`zama.delegationStatus`],contract:e=>{let t=D(e);return[`zama.delegationStatus`,t?{contractAddress:t}:{}]},scope:(e,t,n)=>{let r=D(e),i=D(t),a=D(n);return[`zama.delegationStatus`,{...r?{contractAddress:r}:{},...i?{delegatorAddress:i}:{},...a?{delegateAddress:a}:{}}]}},decryption:{all:[`zama.decryption`],encryptedValue:(e,t)=>[`zama.decryption`,{encryptedValue:e,...t===void 0?{}:{contractAddress:b(t)}}],encryptedInputs:(e,t)=>[`zama.decryption`,{...O(t),encryptedInputs:[...e].sort((e,t)=>e.encryptedValue.localeCompare(t.encryptedValue)).map(e=>({encryptedValue:e.encryptedValue,contractAddress:b(e.contractAddress)}))}]},wrappersRegistry:{all:[`zama.wrappersRegistry`],chainId:()=>[`zama.wrappersRegistry`,{type:`chainId`}],tokenPairs:e=>[`zama.wrappersRegistry`,{type:`tokenPairs`,registryAddress:b(e)}],confidentialTokenAddress:(e,t)=>[`zama.wrappersRegistry`,{type:`confidentialTokenAddress`,registryAddress:b(e),tokenAddress:b(t)}],tokenAddress:(e,t)=>[`zama.wrappersRegistry`,{type:`tokenAddress`,registryAddress:b(e),confidentialTokenAddress:b(t)}],tokenPairsLength:e=>[`zama.wrappersRegistry`,{type:`tokenPairsLength`,registryAddress:b(e)}],tokenPairsSlice:(e,t,n)=>[`zama.wrappersRegistry`,{type:`tokenPairsSlice`,registryAddress:b(e),fromIndex:t,toIndex:n}],tokenPair:(e,t)=>[`zama.wrappersRegistry`,{type:`tokenPair`,registryAddress:b(e),index:t}],isConfidentialTokenValid:(e,t)=>[`zama.wrappersRegistry`,{type:`isConfidentialTokenValid`,registryAddress:b(e),confidentialTokenAddress:b(t)}],listPairs:(e,t,n,r)=>[`zama.wrappersRegistry`,{type:`listPairs`,registryAddress:b(e),page:t,pageSize:n,metadata:r}]}};function A(e,t){e.invalidateQueries({queryKey:k.underlyingAllowance.token(t)})}function j(e,t){e.invalidateQueries({queryKey:k.pendingUnshield.token(t)})}function M(e,t){P(e,t),A(e,t),j(e,t),q(e)}function N(e,t){P(e,t),A(e,t),q(e)}function P(e,t){e.invalidateQueries({queryKey:k.confidentialBalance.token(t)}),e.invalidateQueries({queryKey:k.confidentialBalances.all})}function F(e,t){P(e,t),A(e,t),q(e)}function I(e,t){P(e,t),A(e,t),j(e,t),q(e)}function L(e,t){j(e,t)}function R(e,t){P(e,t)}function z(e,t){A(e,t)}function B(e,t){e.invalidateQueries({queryKey:k.confidentialIsOperator.token(t)})}function V(e){return Array.isArray(e.queryKey)&&typeof e.queryKey[0]==`string`?e.queryKey[0].startsWith(`zama.`):!1}const H=S.enum([`balanceOf`,`confidentialBalanceOf`]),U=S.object({functionName:H}),W=S.object({contracts:S.array(S.unknown())});function G(e){if(U.safeParse(e).success)return!0;let t=W.safeParse(e);return t.success&&t.data.contracts.some(e=>U.safeParse(e).success)}function K(e){return Array.isArray(e.queryKey)&&e.queryKey.some(G)}function q(e){e.invalidateQueries({predicate:K})}function J(e){e.removeQueries({queryKey:k.decryption.all}),e.removeQueries({queryKey:k.hasPermit.all}),e.invalidateQueries({predicate:V}),q(e)}function Y(e,t,n){let r=k.tokenMetadata.token(t);return{...w(n?.query??{}),queryKey:r,queryFn:async t=>{let[,{tokenAddress:n}]=t.queryKey,[r,i,o]=await Promise.all([e.provider.readContract(a(n)),e.provider.readContract(g(n)),e.provider.readContract(h(n))]);return{name:r,symbol:i,decimals:o}},staleTime:1/0,enabled:n?.query?.enabled!==!1}}function X(t,n,r){let i=k.isConfidential.token(n);return{...w(r?.query??{}),queryKey:i,queryFn:async n=>{let[,{tokenAddress:r}]=n.queryKey;try{return await t.provider.readContract(o(r))}catch(t){if(e(t))return!1;throw t}},staleTime:1/0,enabled:r?.query?.enabled!==!1}}function Z(t,n,r){let i=k.isWrapper.token(n);return{...w(r?.query??{}),queryKey:i,queryFn:async n=>{let[,{tokenAddress:r}]=n.queryKey;try{return await t.provider.readContract(s(r))}catch(t){if(e(t))return!1;throw t}},staleTime:1/0,enabled:r?.query?.enabled!==!1}}function Q(e,t,n){let r=k.totalSupply.token(t);return{...w(n?.query??{}),queryKey:r,queryFn:async t=>{let[,{tokenAddress:n}]=t.queryKey;return e.provider.readContract(u(n))},staleTime:3e4,enabled:n?.query?.enabled!==!1}}function ne(e,t){let n=k.wrapperDiscovery.token(t.tokenAddress,t.erc20Address,t.registryAddress);return{...w(t.query??{}),queryKey:n,queryFn:async t=>{let[,{erc20Address:n}]=t.queryKey;y(n,`wrapperDiscoveryQueryOptions: erc20Address`);let r=await e.getConfidentialToken(n);return r?r.confidentialTokenAddress:null},staleTime:1/0,enabled:!!(t.tokenAddress&&t.erc20Address&&t.registryAddress)&&t.query?.enabled!==!1}}function re(e,t,r){let i=r.owner,a=r.query?.enabled!==!1,o=k.underlyingAllowance.scope(t,i);return{...w(r.query??{}),queryKey:o,queryFn:async t=>{let[,{tokenAddress:r,owner:i}]=t.queryKey;y(i,`underlyingAllowanceQueryOptions: owner`);let a=await e.provider.readContract(n(r));return e.provider.readContract(c(a,i,r))},staleTime:3e4,enabled:!!i&&a}}function ie(e,t,n){let r=k.pendingUnshield.token(t);return{...w(n?.query??{}),queryKey:r,queryFn:async t=>{let[,{tokenAddress:n}]=t.queryKey;return e.createWrappedToken(n).getPendingUnshield()},staleTime:0,enabled:n?.query?.enabled!==!1}}function ae(e,n,r){let i=r.holder,a=r.spender,o=r.query?.enabled!==!1,s=k.confidentialIsOperator.scope(n,i,a);return{...w(r.query??{}),queryKey:s,queryFn:async n=>{let[,{tokenAddress:r,holder:i,spender:a}]=n.queryKey;return y(r,`confidentialIsOperatorQueryOptions: tokenAddress`),y(i,`confidentialIsOperatorQueryOptions: holder`),y(a,`confidentialIsOperatorQueryOptions: spender`),e.provider.readContract(t(r,i,a))},staleTime:3e4,enabled:!!(n&&i&&a)&&o}}function oe(e,t,n={}){let r=t.query??{};return{...w(r),queryKey:k.confidentialBalance.owner(t.tokenAddress,t.account,n.walletAccount),queryFn:async t=>{let[,{owner:n}]=t.queryKey;return y(n,`confidentialBalanceQueryOptions: owner`),e.balanceOf(n)},enabled:!!t.account&&n.walletAccount!==void 0&&r?.enabled!==!1}}function se(e,t,n={}){let r=t?.account,i=n.walletAccount,a=t?.query??{},o=e.map(e=>e.address);return{...w(a),queryKey:k.confidentialBalances.tokens(o,r,i),queryFn:async t=>{let[,{owner:n}]=t.queryKey;return y(n,`confidentialBalancesQueryOptions: owner`),v.batchBalancesOf(e,n)},enabled:!!r&&e.length>0&&i!==void 0&&a?.enabled!==!1}}function ce(e,t){let n=!!t.registryAddress&&t.query?.enabled!==!1,r=k.wrappersRegistry.tokenPairs(t.registryAddress??x);return{...w(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n}]=t.queryKey;return e.provider.readContract(l(n))},staleTime:e.registry.ttlMs,enabled:n}}function le(e,t){let n=!!t.registryAddress&&!!t.tokenAddress&&t.query?.enabled!==!1,r=k.wrappersRegistry.confidentialTokenAddress(t.registryAddress??x,t.tokenAddress??x);return{...w(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,tokenAddress:r}]=t.queryKey;return e.provider.readContract(m(n,r))},staleTime:e.registry.ttlMs,enabled:n}}function ue(e,t){let n=!!t.registryAddress&&!!t.confidentialTokenAddress&&t.query?.enabled!==!1,r=k.wrappersRegistry.tokenAddress(t.registryAddress??x,t.confidentialTokenAddress??x);return{...w(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,confidentialTokenAddress:r}]=t.queryKey;return e.provider.readContract(d(n,r))},staleTime:e.registry.ttlMs,enabled:n}}function de(e,t){let n=!!t.registryAddress&&t.query?.enabled!==!1,r=k.wrappersRegistry.tokenPairsLength(t.registryAddress??x);return{...w(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n}]=t.queryKey;return e.provider.readContract(i(n))},staleTime:e.registry.ttlMs,enabled:n}}function fe(e,t){let n=!!t.registryAddress&&t.fromIndex!==void 0&&t.toIndex!==void 0&&t.query?.enabled!==!1,r=k.wrappersRegistry.tokenPairsSlice(t.registryAddress??x,String(t.fromIndex??0n),String(t.toIndex??0n));return{...w(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,fromIndex:r,toIndex:i}]=t.queryKey;return e.provider.readContract(f(n,BigInt(r),BigInt(i)))},staleTime:e.registry.ttlMs,enabled:n}}function pe(e,t){let n=!!t.registryAddress&&t.index!==void 0&&t.query?.enabled!==!1,r=k.wrappersRegistry.tokenPair(t.registryAddress??x,String(t.index??0n));return{...w(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,index:r}]=t.queryKey;return e.provider.readContract(ee(n,BigInt(r)))},staleTime:e.registry.ttlMs,enabled:n}}function me(e,t){let n=!!t.registryAddress&&!!t.confidentialTokenAddress&&t.query?.enabled!==!1,r=k.wrappersRegistry.isConfidentialTokenValid(t.registryAddress??x,t.confidentialTokenAddress??x);return{...w(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,confidentialTokenAddress:r}]=t.queryKey;return e.provider.readContract(p(n,r))},staleTime:e.registry.ttlMs,enabled:n}}function he(e,t){let n=!!t.registryAddress&&t.query?.enabled!==!1,r=k.wrappersRegistry.listPairs(t.registryAddress??x,t.page??1,t.pageSize??100,t.metadata??!1);return{...w(t.query??{}),queryKey:r,queryFn:async t=>{let[,{page:n,pageSize:r,metadata:i}]=t.queryKey;return e.listPairs({page:n,pageSize:r,metadata:i})},staleTime:e.ttlMs,enabled:n}}function ge(e){return{mutationKey:[`zama.shield`,e.address],mutationFn:async({amount:t,...n})=>e.shield(t,n)}}function _e(e){return{mutationKey:[`zama.confidentialTransfer`,e.address],mutationFn:async({to:t,amount:n,...r})=>e.confidentialTransfer(t,n,r)}}function ve(e){return{mutationKey:[`zama.confidentialTransferAndCall`,e.address],mutationFn:async({to:t,amount:n,data:r,...i})=>e.confidentialTransferAndCall(t,n,r,i)}}function ye(e){return{mutationKey:[`zama.confidentialTransferFrom`,e.address],mutationFn:async({from:t,to:n,amount:r,callbacks:i})=>e.confidentialTransferFrom(t,n,r,i)}}function be(e){return{mutationKey:[`zama.confidentialTransferFromAndCall`,e.address],mutationFn:async({from:t,to:n,amount:r,data:i,callbacks:a})=>e.confidentialTransferFromAndCall(t,n,r,i,a)}}function xe(e){return{mutationKey:[`zama.confidentialSetOperator`,e.address],mutationFn:async({operator:t,until:n})=>e.setOperator(t,n)}}function Se(e){return{mutationKey:[`zama.approveUnderlying`,e.address],mutationFn:async({amount:t})=>e.approveUnderlying(t)}}function Ce(e){return{mutationKey:[`zama.unshield`,e.address],mutationFn:async({amount:t,...n})=>e.unshield(t,n)}}function we(e){return{mutationKey:[`zama.unshieldAll`,e.address],mutationFn:async t=>e.unshieldAll(t||void 0)}}function Te(e){return{mutationKey:[`zama.resumeUnshield`,e.address],mutationFn:async({unwrapTxHash:t,...n})=>e.resumeUnshield(t,n)}}function Ee(e){return{mutationKey:[`zama.unwrap`,e.address],mutationFn:async({amount:t})=>e.unwrap(t)}}function De(e){return{mutationKey:[`zama.wrap`,e.address],mutationFn:async({amount:t,...n})=>e.wrap(t,n)}}function Oe(e){return{mutationKey:[`zama.unwrapAll`,e.address],mutationFn:async()=>e.unwrapAll()}}function ke(e){return{mutationKey:[`zama.finalizeUnwrap`,e.address],mutationFn:async({unwrapRequestId:t})=>e.finalizeUnwrap(t)}}function Ae(e){return{mutationKey:[`zama.encrypt`],mutationFn:async t=>e.encrypt(t)}}function je(e){return{mutationKey:[`zama.delegatedDecryptValues`],mutationFn:async t=>e.decryption.delegatedDecryptValues(t.encryptedInputs,t.delegatorAddress)}}function Me(e){return{mutationKey:[`zama.decryptPublicValues`],mutationFn:async t=>e.decryption.decryptPublicValues(t),onSuccess:(e,t,n,r)=>{for(let[t,n]of Object.entries(e.clearValues))r.client.setQueryData(k.decryption.encryptedValue(t),n)}}}function Ne(e){return{mutationKey:[`zama.grantPermit`],mutationFn:t=>e.permits.grantPermit(t)}}function Pe(e){return{mutationKey:[`zama.preparePermit`],mutationFn:t=>e.offline.preparePermit(t)}}function $(e){return{mutationKey:[`zama.registerPermit`],mutationFn:({prepared:t,signature:n})=>e.permits.registerPermit(t,n)}}function Fe(e,t,n={}){let r=t.query?.enabled!==!1;return{...w(t?.query??{}),queryKey:k.hasPermit.scope(t.contractAddresses,n.walletAccount),queryFn:t=>{let[,{contractAddresses:n}]=t.queryKey;return e.permits.hasPermit(n)},staleTime:0,gcTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1,enabled:r&&n.walletAccount!==void 0&&t.contractAddresses.length>0}}function Ie(e){return{mutationKey:[`zama.revokePermits`],mutationFn:t=>t===void 0?e.permits.revokePermits():e.permits.revokePermits(t)}}function Le(e){return{mutationKey:[`zama.clearCredentials`],mutationFn:()=>e.permits.clear()}}function Re(e,t){return{mutationKey:[`zama.delegateDecryption`,t],mutationFn:async({delegateAddress:n,expirationDate:r})=>e.delegations.delegateDecryption({contractAddress:t,delegateAddress:n,expirationDate:r})}}function ze(e,t,n={}){return{queryKey:k.decryption.encryptedInputs(t,n.walletAccount),queryFn:t=>{let[,{encryptedInputs:n}]=t.queryKey;return e.decryption.decryptValues(n)},staleTime:1/0,enabled:t.length>0&&n.walletAccount!==void 0}}function Be(e){return{mutationKey:[`zama.decryptBalanceAs`,e.address],mutationFn:async({delegatorAddress:t,accountAddress:n})=>e.decryptBalanceAs({delegatorAddress:t,accountAddress:n})}}function Ve(e){return{mutationKey:[`zama.batchDecryptBalancesAs`,...e.map(e=>e.address)],mutationFn:async t=>v.batchDecryptBalancesAs(e,t)}}function He(e,t){return{mutationKey:[`zama.revokeDelegation`,t],mutationFn:async({delegateAddress:n})=>e.delegations.revokeDelegation({contractAddress:t,delegateAddress:n})}}function Ue(e){return{mutationKey:[`zama.invalidateDecryptionSignatures`],mutationFn:async t=>e.permits.invalidateDecryptionSignatures(t?.timestamp)}}function We(e,t){return{...w(t.query??{}),queryKey:k.delegationStatus.scope(t.contractAddress,t.delegatorAddress,t.delegateAddress),queryFn:async t=>{let[,{contractAddress:n,delegatorAddress:r,delegateAddress:i}]=t.queryKey;return y(n,`delegationStatusQueryOptions: contractAddress`),y(r,`delegationStatusQueryOptions: delegatorAddress`),y(i,`delegationStatusQueryOptions: delegateAddress`),e.delegations.getStatus({contractAddress:n,delegatorAddress:r,delegateAddress:i})},enabled:!!(t.contractAddress&&t.delegatorAddress&&t.delegateAddress)&&t.query?.enabled!==!1}}export{_ as WILDCARD_PERMIT,r as ZamaSDKEvents,Se as approveUnderlyingMutationOptions,Ve as batchDecryptBalancesAsMutationOptions,Le as clearCredentialsMutationOptions,oe as confidentialBalanceQueryOptions,se as confidentialBalancesQueryOptions,ae as confidentialIsOperatorQueryOptions,xe as confidentialSetOperatorMutationOptions,le as confidentialTokenAddressQueryOptions,ve as confidentialTransferAndCallMutationOptions,be as confidentialTransferFromAndCallMutationOptions,ye as confidentialTransferFromMutationOptions,_e as confidentialTransferMutationOptions,Be as decryptBalanceAsMutationOptions,Me as decryptPublicValuesMutationOptions,ze as decryptValuesQueryOptions,Re as delegateDecryptionMutationOptions,je as delegatedDecryptValuesMutationOptions,We as delegationStatusQueryOptions,Ae as encryptMutationOptions,w as filterQueryOptions,ke as finalizeUnwrapMutationOptions,Ne as grantPermitMutationOptions,Fe as hasPermitQueryOptions,T as hashFn,z as invalidateAfterApproveUnderlying,B as invalidateAfterSetOperator,F as invalidateAfterShield,R as invalidateAfterTransfer,I as invalidateAfterUnshield,L as invalidateAfterUnshieldSettled,M as invalidateAfterUnwrap,N as invalidateAfterWrap,P as invalidateBalanceQueries,Ue as invalidateDecryptionSignaturesMutationOptions,q as invalidateWagmiBalanceQueries,J as invalidateWalletLifecycleQueries,X as isConfidentialQueryOptions,me as isConfidentialTokenValidQueryOptions,Z as isWrapperQueryOptions,he as listPairsQueryOptions,ie as pendingUnshieldQueryOptions,Pe as preparePermitMutationOptions,$ as registerPermitMutationOptions,Te as resumeUnshieldMutationOptions,He as revokeDelegationMutationOptions,Ie as revokePermitsMutationOptions,ge as shieldMutationOptions,ue as tokenAddressQueryOptions,Y as tokenMetadataQueryOptions,pe as tokenPairQueryOptions,de as tokenPairsLengthQueryOptions,ce as tokenPairsQueryOptions,fe as tokenPairsSliceQueryOptions,Q as totalSupplyQueryOptions,re as underlyingAllowanceQueryOptions,we as unshieldAllMutationOptions,Ce as unshieldMutationOptions,Oe as unwrapAllMutationOptions,Ee as unwrapMutationOptions,De as wrapMutationOptions,ne as wrapperDiscoveryQueryOptions,k as zamaQueryKeys};
|
|
1
|
+
import{f as e}from"../relayer-CVKO9GmQ.js";import{C as t,E as n,M as r,S as i,a,c as o,d as s,i as c,m as l,p as u}from"../erc165-DbMOt-s6.js";import{t as d}from"../token-CRJ8eCr7.js";import{a as f,i as ee,n as p,o as m,r as h,s as g,t as _}from"../wrappers-registry-Cm3JJeqx.js";import{r as v}from"../assertions-Ca1ePdRJ.js";import{a as y,c as b,d as x,f as S,i as C,l as w,m as T,n as E,o as D,p as O,r as k,s as A,t as j,u as M}from"../invalidation-BgFjmXeQ.js";import{zeroAddress as N}from"viem";function P(e,t,n){let r=S.tokenMetadata.token(t);return{...O(n?.query??{}),queryKey:r,queryFn:async t=>{let[,{tokenAddress:n}]=t.queryKey,[r,i,a]=await Promise.all([e.provider.readContract(u(n)),e.provider.readContract(l(n)),e.provider.readContract(s(n))]);return{name:r,symbol:i,decimals:a}},staleTime:1/0,enabled:n?.query?.enabled!==!1}}function F(t,n,r){let i=S.isConfidential.token(n);return{...O(r?.query??{}),queryKey:i,queryFn:async n=>{let[,{tokenAddress:r}]=n.queryKey;try{return await t.provider.readContract(c(r))}catch(t){if(e(t))return!1;throw t}},staleTime:1/0,enabled:r?.query?.enabled!==!1}}function I(t,n,r){let i=S.isWrapper.token(n);return{...O(r?.query??{}),queryKey:i,queryFn:async n=>{let[,{tokenAddress:r}]=n.queryKey;try{return await t.provider.readContract(a(r))}catch(t){if(e(t))return!1;throw t}},staleTime:1/0,enabled:r?.query?.enabled!==!1}}function L(e,t,n){let r=S.totalSupply.token(t);return{...O(n?.query??{}),queryKey:r,queryFn:async t=>{let[,{tokenAddress:n}]=t.queryKey;return e.provider.readContract(i(n))},staleTime:3e4,enabled:n?.query?.enabled!==!1}}function R(e,t){let n=S.wrapperDiscovery.token(t.tokenAddress,t.erc20Address,t.registryAddress);return{...O(t.query??{}),queryKey:n,queryFn:async t=>{let[,{erc20Address:n}]=t.queryKey;v(n,`wrapperDiscoveryQueryOptions: erc20Address`);let r=await e.getConfidentialToken(n);return r?r.confidentialTokenAddress:null},staleTime:1/0,enabled:!!(t.tokenAddress&&t.erc20Address&&t.registryAddress)&&t.query?.enabled!==!1}}function z(e,t,r){let i=r.owner,a=r.query?.enabled!==!1,s=S.underlyingAllowance.scope(t,i);return{...O(r.query??{}),queryKey:s,queryFn:async t=>{let[,{tokenAddress:r,owner:i}]=t.queryKey;v(i,`underlyingAllowanceQueryOptions: owner`);let a=await e.provider.readContract(n(r));return e.provider.readContract(o(a,i,r))},staleTime:3e4,enabled:!!i&&a}}function B(e,t,n){let r=S.pendingUnshield.token(t);return{...O(n?.query??{}),queryKey:r,queryFn:async t=>{let[,{tokenAddress:n}]=t.queryKey;return e.createWrappedToken(n).getPendingUnshield()},staleTime:0,enabled:n?.query?.enabled!==!1}}function V(e,n,r){let i=r.holder,a=r.spender,o=r.query?.enabled!==!1,s=S.confidentialIsOperator.scope(n,i,a);return{...O(r.query??{}),queryKey:s,queryFn:async n=>{let[,{tokenAddress:r,holder:i,spender:a}]=n.queryKey;return v(r,`confidentialIsOperatorQueryOptions: tokenAddress`),v(i,`confidentialIsOperatorQueryOptions: holder`),v(a,`confidentialIsOperatorQueryOptions: spender`),e.provider.readContract(t(r,i,a))},staleTime:3e4,enabled:!!(n&&i&&a)&&o}}function H(e,t,n={}){let r=t.query??{};return{...O(r),queryKey:S.confidentialBalance.owner(t.tokenAddress,t.account,n.walletAccount),queryFn:async t=>{let[,{owner:n}]=t.queryKey;return v(n,`confidentialBalanceQueryOptions: owner`),e.balanceOf(n)},enabled:!!t.account&&n.walletAccount!==void 0&&r?.enabled!==!1}}function U(e,t,n={}){let r=t?.account,i=n.walletAccount,a=t?.query??{},o=e.map(e=>e.address);return{...O(a),queryKey:S.confidentialBalances.tokens(o,r,i),queryFn:async t=>{let[,{owner:n}]=t.queryKey;return v(n,`confidentialBalancesQueryOptions: owner`),d.batchBalancesOf(e,n)},enabled:!!r&&e.length>0&&i!==void 0&&a?.enabled!==!1}}function W(e,t){let n=!!t.registryAddress&&t.query?.enabled!==!1,r=S.wrappersRegistry.tokenPairs(t.registryAddress??N);return{...O(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n}]=t.queryKey;return e.provider.readContract(ee(n))},staleTime:e.registry.ttlMs,enabled:n}}function G(e,t){let n=!!t.registryAddress&&!!t.tokenAddress&&t.query?.enabled!==!1,r=S.wrappersRegistry.confidentialTokenAddress(t.registryAddress??N,t.tokenAddress??N);return{...O(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,tokenAddress:r}]=t.queryKey;return e.provider.readContract(_(n,r))},staleTime:e.registry.ttlMs,enabled:n}}function K(e,t){let n=!!t.registryAddress&&!!t.confidentialTokenAddress&&t.query?.enabled!==!1,r=S.wrappersRegistry.tokenAddress(t.registryAddress??N,t.confidentialTokenAddress??N);return{...O(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,confidentialTokenAddress:r}]=t.queryKey;return e.provider.readContract(p(n,r))},staleTime:e.registry.ttlMs,enabled:n}}function q(e,t){let n=!!t.registryAddress&&t.query?.enabled!==!1,r=S.wrappersRegistry.tokenPairsLength(t.registryAddress??N);return{...O(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n}]=t.queryKey;return e.provider.readContract(f(n))},staleTime:e.registry.ttlMs,enabled:n}}function J(e,t){let n=!!t.registryAddress&&t.fromIndex!==void 0&&t.toIndex!==void 0&&t.query?.enabled!==!1,r=S.wrappersRegistry.tokenPairsSlice(t.registryAddress??N,String(t.fromIndex??0n),String(t.toIndex??0n));return{...O(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,fromIndex:r,toIndex:i}]=t.queryKey;return e.provider.readContract(m(n,BigInt(r),BigInt(i)))},staleTime:e.registry.ttlMs,enabled:n}}function te(e,t){let n=!!t.registryAddress&&t.index!==void 0&&t.query?.enabled!==!1,r=S.wrappersRegistry.tokenPair(t.registryAddress??N,String(t.index??0n));return{...O(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,index:r}]=t.queryKey;return e.provider.readContract(h(n,BigInt(r)))},staleTime:e.registry.ttlMs,enabled:n}}function Y(e,t){let n=!!t.registryAddress&&!!t.confidentialTokenAddress&&t.query?.enabled!==!1,r=S.wrappersRegistry.isConfidentialTokenValid(t.registryAddress??N,t.confidentialTokenAddress??N);return{...O(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,confidentialTokenAddress:r}]=t.queryKey;return e.provider.readContract(g(n,r))},staleTime:e.registry.ttlMs,enabled:n}}function X(e,t){let n=!!t.registryAddress&&t.query?.enabled!==!1,r=S.wrappersRegistry.listPairs(t.registryAddress??N,t.page??1,t.pageSize??100,t.metadata??!1);return{...O(t.query??{}),queryKey:r,queryFn:async t=>{let[,{page:n,pageSize:r,metadata:i}]=t.queryKey;return e.listPairs({page:n,pageSize:r,metadata:i})},staleTime:e.ttlMs,enabled:n}}function Z(e){return{mutationKey:[`zama.shield`,e.address],mutationFn:async({amount:t,...n})=>e.shield(t,n)}}function Q(e){return{mutationKey:[`zama.confidentialTransfer`,e.address],mutationFn:async({to:t,amount:n,...r})=>e.confidentialTransfer(t,n,r)}}function ne(e){return{mutationKey:[`zama.confidentialTransferAndCall`,e.address],mutationFn:async({to:t,amount:n,data:r,...i})=>e.confidentialTransferAndCall(t,n,r,i)}}function re(e){return{mutationKey:[`zama.confidentialTransferFrom`,e.address],mutationFn:async({from:t,to:n,amount:r,callbacks:i})=>e.confidentialTransferFrom(t,n,r,i)}}function ie(e){return{mutationKey:[`zama.confidentialTransferFromAndCall`,e.address],mutationFn:async({from:t,to:n,amount:r,data:i,callbacks:a})=>e.confidentialTransferFromAndCall(t,n,r,i,a)}}function ae(e){return{mutationKey:[`zama.confidentialSetOperator`,e.address],mutationFn:async({operator:t,until:n})=>e.setOperator(t,n)}}function oe(e){return{mutationKey:[`zama.approveUnderlying`,e.address],mutationFn:async({amount:t})=>e.approveUnderlying(t)}}function se(e){return{mutationKey:[`zama.unshield`,e.address],mutationFn:async({amount:t,...n})=>e.unshield(t,n)}}function ce(e){return{mutationKey:[`zama.unshieldAll`,e.address],mutationFn:async t=>e.unshieldAll(t||void 0)}}function le(e){return{mutationKey:[`zama.resumeUnshield`,e.address],mutationFn:async({unwrapTxHash:t,...n})=>e.resumeUnshield(t,n)}}function ue(e){return{mutationKey:[`zama.unwrap`,e.address],mutationFn:async({amount:t})=>e.unwrap(t)}}function de(e){return{mutationKey:[`zama.wrap`,e.address],mutationFn:async({amount:t,...n})=>e.wrap(t,n)}}function fe(e){return{mutationKey:[`zama.unwrapAll`,e.address],mutationFn:async()=>e.unwrapAll()}}function pe(e){return{mutationKey:[`zama.finalizeUnwrap`,e.address],mutationFn:async({unwrapRequestId:t})=>e.finalizeUnwrap(t)}}function me(e){return{mutationKey:[`zama.encrypt`],mutationFn:async t=>e.encrypt(t)}}function he(e){return{mutationKey:[`zama.delegatedDecryptValues`],mutationFn:async t=>e.decryption.delegatedDecryptValues(t.encryptedInputs,t.delegatorAddress)}}function ge(e){return{mutationKey:[`zama.decryptPublicValues`],mutationFn:async t=>e.decryption.decryptPublicValues(t),onSuccess:(e,t,n,r)=>{for(let[t,n]of Object.entries(e.clearValues))r.client.setQueryData(S.decryption.encryptedValue(t),n)}}}function _e(e){return{mutationKey:[`zama.grantPermit`],mutationFn:t=>e.permits.grantPermit(t)}}function ve(e){return{mutationKey:[`zama.preparePermit`],mutationFn:t=>e.offline.preparePermit(t)}}function ye(e){return{mutationKey:[`zama.registerPermit`],mutationFn:({prepared:t,signature:n})=>e.permits.registerPermit(t,n)}}function be(e,t,n={}){let r=t.query?.enabled!==!1;return{...O(t?.query??{}),queryKey:S.hasPermit.scope(t.contractAddresses,n.walletAccount),queryFn:t=>{let[,{contractAddresses:n}]=t.queryKey;return e.permits.hasPermit(n)},staleTime:0,gcTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1,enabled:r&&n.walletAccount!==void 0&&t.contractAddresses.length>0}}function $(e){return{mutationKey:[`zama.revokePermits`],mutationFn:t=>t===void 0?e.permits.revokePermits():e.permits.revokePermits(t)}}function xe(e){return{mutationKey:[`zama.clearCredentials`],mutationFn:()=>e.permits.clear()}}function Se(e,t){return{mutationKey:[`zama.delegateDecryption`,t],mutationFn:async({delegateAddress:n,expirationDate:r})=>e.delegations.delegateDecryption({contractAddress:t,delegateAddress:n,expirationDate:r})}}function Ce(e,t,n={}){return{queryKey:S.decryption.encryptedInputs(t,n.walletAccount),queryFn:t=>{let[,{encryptedInputs:n}]=t.queryKey;return e.decryption.decryptValues(n)},staleTime:1/0,enabled:t.length>0&&n.walletAccount!==void 0}}function we(e){return{mutationKey:[`zama.decryptBalanceAs`,e.address],mutationFn:async({delegatorAddress:t,accountAddress:n})=>e.decryptBalanceAs({delegatorAddress:t,accountAddress:n})}}function Te(e){return{mutationKey:[`zama.batchDecryptBalancesAs`,...e.map(e=>e.address)],mutationFn:async t=>d.batchDecryptBalancesAs(e,t)}}function Ee(e,t){return{mutationKey:[`zama.revokeDelegation`,t],mutationFn:async({delegateAddress:n})=>e.delegations.revokeDelegation({contractAddress:t,delegateAddress:n})}}function De(e,t){return{...O(t.query??{}),queryKey:S.delegationStatus.scope(t.contractAddress,t.delegatorAddress,t.delegateAddress),queryFn:async t=>{let[,{contractAddress:n,delegatorAddress:r,delegateAddress:i}]=t.queryKey;return v(n,`delegationStatusQueryOptions: contractAddress`),v(r,`delegationStatusQueryOptions: delegatorAddress`),v(i,`delegationStatusQueryOptions: delegateAddress`),e.delegations.getStatus({contractAddress:n,delegatorAddress:r,delegateAddress:i})},enabled:!!(t.contractAddress&&t.delegatorAddress&&t.delegateAddress)&&t.query?.enabled!==!1}}export{r as ZamaSDKEvents,oe as approveUnderlyingMutationOptions,Te as batchDecryptBalancesAsMutationOptions,xe as clearCredentialsMutationOptions,H as confidentialBalanceQueryOptions,U as confidentialBalancesQueryOptions,V as confidentialIsOperatorQueryOptions,ae as confidentialSetOperatorMutationOptions,G as confidentialTokenAddressQueryOptions,ne as confidentialTransferAndCallMutationOptions,ie as confidentialTransferFromAndCallMutationOptions,re as confidentialTransferFromMutationOptions,Q as confidentialTransferMutationOptions,we as decryptBalanceAsMutationOptions,ge as decryptPublicValuesMutationOptions,Ce as decryptValuesQueryOptions,Se as delegateDecryptionMutationOptions,he as delegatedDecryptValuesMutationOptions,De as delegationStatusQueryOptions,me as encryptMutationOptions,O as filterQueryOptions,pe as finalizeUnwrapMutationOptions,_e as grantPermitMutationOptions,be as hasPermitQueryOptions,T as hashFn,j as invalidateAfterApproveUnderlying,E as invalidateAfterSetOperator,k as invalidateAfterShield,C as invalidateAfterTransfer,y as invalidateAfterUnshield,D as invalidateAfterUnshieldSettled,A as invalidateAfterUnwrap,b as invalidateAfterWrap,w as invalidateBalanceQueries,M as invalidateWagmiBalanceQueries,x as invalidateWalletLifecycleQueries,F as isConfidentialQueryOptions,Y as isConfidentialTokenValidQueryOptions,I as isWrapperQueryOptions,X as listPairsQueryOptions,B as pendingUnshieldQueryOptions,ve as preparePermitMutationOptions,ye as registerPermitMutationOptions,le as resumeUnshieldMutationOptions,Ee as revokeDelegationMutationOptions,$ as revokePermitsMutationOptions,Z as shieldMutationOptions,K as tokenAddressQueryOptions,P as tokenMetadataQueryOptions,te as tokenPairQueryOptions,q as tokenPairsLengthQueryOptions,W as tokenPairsQueryOptions,J as tokenPairsSliceQueryOptions,L as totalSupplyQueryOptions,z as underlyingAllowanceQueryOptions,ce as unshieldAllMutationOptions,se as unshieldMutationOptions,fe as unwrapAllMutationOptions,ue as unwrapMutationOptions,de as wrapMutationOptions,R as wrapperDiscoveryQueryOptions,S as zamaQueryKeys};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|