@zama-fhe/sdk 3.4.0-alpha.8 → 3.4.0

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.
Files changed (73) hide show
  1. package/dist/cjs/base-signer.cjs +1 -1
  2. package/dist/cjs/base-signer.cjs.map +1 -1
  3. package/dist/cjs/ethers/index.cjs +1 -1
  4. package/dist/cjs/ethers/index.cjs.map +1 -1
  5. package/dist/cjs/fhevm-relayer.cjs +1 -1
  6. package/dist/cjs/fhevm-relayer.cjs.map +1 -1
  7. package/dist/cjs/index.cjs +1 -1
  8. package/dist/cjs/index.cjs.map +1 -1
  9. package/dist/cjs/node/index.cjs.map +1 -1
  10. package/dist/cjs/query/index.cjs +1 -1
  11. package/dist/cjs/query/index.cjs.map +1 -1
  12. package/dist/cjs/relayer.cjs +1 -1
  13. package/dist/cjs/relayer.cjs.map +1 -1
  14. package/dist/cjs/sdk-events.cjs +2 -0
  15. package/dist/cjs/sdk-events.cjs.map +1 -0
  16. package/dist/cjs/token.cjs +1 -1
  17. package/dist/cjs/token.cjs.map +1 -1
  18. package/dist/cjs/viem/index.cjs +1 -1
  19. package/dist/cjs/viem/index.cjs.map +1 -1
  20. package/dist/esm/{base-signer-Ds8CoYy0.d.ts → base-signer-BvL-jMNO.d.ts} +15 -2
  21. package/dist/esm/base-signer-YpkEmlp2.js +2 -0
  22. package/dist/esm/base-signer-YpkEmlp2.js.map +1 -0
  23. package/dist/esm/chains/index.d.ts +1 -1
  24. package/dist/esm/cleartext/index.d.ts +2 -2
  25. package/dist/esm/cleartext/index.js +1 -1
  26. package/dist/esm/{cleartext-_RCZVPOe.d.ts → cleartext-CxlICeUh.d.ts} +2 -2
  27. package/dist/esm/{cleartext-DfX0GUj1.js → cleartext-Qqh5JohW.js} +2 -2
  28. package/dist/esm/{cleartext-DfX0GUj1.js.map → cleartext-Qqh5JohW.js.map} +1 -1
  29. package/dist/esm/ethers/index.d.ts +53 -5
  30. package/dist/esm/ethers/index.js +1 -1
  31. package/dist/esm/ethers/index.js.map +1 -1
  32. package/dist/esm/fhevm-relayer-4Zd4QkKq.js +2 -0
  33. package/dist/esm/fhevm-relayer-4Zd4QkKq.js.map +1 -0
  34. package/dist/esm/{index-C4Hn6K9c.d.ts → index-DLaQtvYu.d.ts} +213 -400
  35. package/dist/esm/index-DNofJMCK.d.ts +61 -0
  36. package/dist/esm/{index-doNE2KoX.d.ts → index-S6_V7aAH.d.ts} +10 -1
  37. package/dist/esm/index.d.ts +8 -8
  38. package/dist/esm/index.js +1 -1
  39. package/dist/esm/index.js.map +1 -1
  40. package/dist/esm/node/index.d.ts +5 -5
  41. package/dist/esm/node/index.js +1 -1
  42. package/dist/esm/node/index.js.map +1 -1
  43. package/dist/esm/query/index.d.ts +143 -9
  44. package/dist/esm/query/index.js +1 -1
  45. package/dist/esm/query/index.js.map +1 -1
  46. package/dist/esm/relayer-BWHOLVcG.js +2 -0
  47. package/dist/esm/relayer-BWHOLVcG.js.map +1 -0
  48. package/dist/esm/sdk-events-D68bJ5jT.js +2 -0
  49. package/dist/esm/sdk-events-D68bJ5jT.js.map +1 -0
  50. package/dist/esm/token-Bn8I7xAu.js +2 -0
  51. package/dist/esm/token-Bn8I7xAu.js.map +1 -0
  52. package/dist/esm/{types-Tk8PiPCk.d.ts → types-BEz-VgR_.d.ts} +6 -3
  53. package/dist/esm/{types-CELdIAFG.d.ts → types-CWPSTRF6.d.ts} +98 -146
  54. package/dist/esm/{types-DlSUyFe2.d.ts → types-Dr7AmEs1.d.ts} +3 -3
  55. package/dist/esm/viem/index.d.ts +34 -5
  56. package/dist/esm/viem/index.js +1 -1
  57. package/dist/esm/viem/index.js.map +1 -1
  58. package/dist/esm/web/index.d.ts +2 -2
  59. package/dist/esm/web/index.js +1 -1
  60. package/package.json +3 -3
  61. package/dist/cjs/wrappers-registry.cjs +0 -2
  62. package/dist/cjs/wrappers-registry.cjs.map +0 -1
  63. package/dist/esm/base-signer-9CqICeQ8.js +0 -2
  64. package/dist/esm/base-signer-9CqICeQ8.js.map +0 -1
  65. package/dist/esm/fhevm-relayer-Bb_-KFJA.js +0 -2
  66. package/dist/esm/fhevm-relayer-Bb_-KFJA.js.map +0 -1
  67. package/dist/esm/index-9Cn2VKDw.d.ts +0 -329
  68. package/dist/esm/relayer-DLlyoabr.js +0 -2
  69. package/dist/esm/relayer-DLlyoabr.js.map +0 -1
  70. package/dist/esm/token-oxpZ2kAk.js +0 -2
  71. package/dist/esm/token-oxpZ2kAk.js.map +0 -1
  72. package/dist/esm/wrappers-registry-B1GuTt5t.js +0 -2
  73. package/dist/esm/wrappers-registry-B1GuTt5t.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { a as hoodi, c as sepolia, i as hardhat, n as bscTestnet, o as ingenTestnet, r as chains, s as mainnet, t as anvil } from "../index-doNE2KoX.js";
2
- import { It as ClearValue, Kt as FhevmRelayerSDK, Lt as DecryptPublicValuesResult, Vt as EncryptParams, n as RelayerConfig, s as GenericLogger, zt as EIP712TypedData } from "../types-CELdIAFG.js";
3
- import { t as cleartext } from "../cleartext-_RCZVPOe.js";
4
- import { i as node, n as asyncLocalStorage, r as NodeRelayerConfig, t as AsyncLocalMapStorage } from "../index-9Cn2VKDw.js";
5
- export { AsyncLocalMapStorage, type ClearValue, type DecryptPublicValuesResult, type EIP712TypedData, type EncryptParams, type GenericLogger, type NodeRelayerConfig, type RelayerConfig, type FhevmRelayerSDK as RelayerSDK, anvil, asyncLocalStorage, bscTestnet, chains, cleartext, hardhat, hoodi, ingenTestnet, mainnet, node, sepolia };
1
+ import { a as hoodi, c as sepolia, d as FheChainAuth, i as hardhat, n as bscTestnet, o as ingenTestnet, r as chains, s as mainnet, t as anvil, u as FheChain } from "../index-S6_V7aAH.js";
2
+ import { Ft as DecryptPublicValuesResult, Gt as FhevmRuntimeConfig, Kt as RelayerOptions, Lt as EIP712TypedData, Pt as ClearValue, Rt as EncryptInput, Ut as FhevmClientOptions, Vt as EncryptedValue, Wt as FhevmRelayerOptions, c as GenericStorage, n as RelayerConfig, s as GenericLogger, t as CleartextRelayerConfig, zt as EncryptParams } from "../types-CWPSTRF6.js";
3
+ import { t as cleartext } from "../cleartext-CxlICeUh.js";
4
+ import { i as node, n as asyncLocalStorage, r as NodeRelayerConfig, t as AsyncLocalMapStorage } from "../index-DNofJMCK.js";
5
+ export { AsyncLocalMapStorage, type ClearValue, type CleartextRelayerConfig, type DecryptPublicValuesResult, type EIP712TypedData, type EncryptInput, type EncryptParams, type EncryptedValue, type FheChain, type FheChainAuth, type FhevmClientOptions, type FhevmRelayerOptions, type FhevmRuntimeConfig, type GenericLogger, type GenericStorage, type NodeRelayerConfig, type RelayerConfig, type RelayerOptions, anvil, asyncLocalStorage, bscTestnet, chains, cleartext, hardhat, hoodi, ingenTestnet, mainnet, node, sepolia };
@@ -1,2 +1,2 @@
1
- import{t as e}from"../fhevm-relayer-Bb_-KFJA.js";import{t}from"../cleartext-DfX0GUj1.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"../chains-CLv9HEJ_.js";import{AsyncLocalStorage as u}from"node:async_hooks";function d(t){return{type:`node`,createRelayer:n=>new e({chain:n,options:t})}}var f=class{#e=new u;run(e){return this.#e.run(new Map,e)}async get(e){return this.#e.getStore()?.get(e)??null}async set(e,t){this.#e.getStore()?.set(e,t)}async delete(e){this.#e.getStore()?.delete(e)}};const p=new f;export{f as AsyncLocalMapStorage,l as anvil,p as asyncLocalStorage,a as bscTestnet,s as chains,t as cleartext,i as hardhat,n as hoodi,o as ingenTestnet,c as mainnet,d as node,r as sepolia};
1
+ import{t as e}from"../fhevm-relayer-4Zd4QkKq.js";import{t}from"../cleartext-Qqh5JohW.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"../chains-CLv9HEJ_.js";import{AsyncLocalStorage as u}from"node:async_hooks";function d(t){return{type:`node`,createRelayer:n=>new e({chain:n,options:t})}}var f=class{#e=new u;run(e){return this.#e.run(new Map,e)}async get(e){return this.#e.getStore()?.get(e)??null}async set(e,t){this.#e.getStore()?.set(e,t)}async delete(e){this.#e.getStore()?.delete(e)}};const p=new f;export{f as AsyncLocalMapStorage,l as anvil,p as asyncLocalStorage,a as bscTestnet,s as chains,t as cleartext,i as hardhat,n as hoodi,o as ingenTestnet,c as mainnet,d as node,r as sepolia};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["#als"],"sources":["../../../src/node/config.ts","../../../src/storage/async-local-storage.ts"],"sourcesContent":["import type { FheChain } from \"../chains/types\";\nimport type { RelayerConfig } from \"../config/types\";\nimport { FhevmRelayer } from \"../relayer/fhevm-relayer\";\nimport type { RelayerOptions } from \"../relayer/types\";\n\n/** Node transport — drives the FHE backend directly on the calling thread. */\nexport interface NodeRelayerConfig extends RelayerConfig {\n readonly type: \"node\";\n readonly createRelayer: (chain: FheChain) => FhevmRelayer;\n}\n\n/**\n * Node.js transport — drives `@fhevm/sdk` via {@link FhevmRelayer} on the calling thread.\n *\n * @example\n * ```ts\n * relayers: {\n * [sepolia.id]: node({ timeout: 5 * 60_000 }),\n * [mainnet.id]: node({ batchRpcCalls: true }),\n * }\n * ```\n */\nexport function node(options?: RelayerOptions): NodeRelayerConfig {\n return { type: \"node\", createRelayer: (chain) => new FhevmRelayer({ chain, options }) };\n}\n","import { AsyncLocalStorage } from \"node:async_hooks\";\nimport type { GenericStorage } from \"../types\";\n\n/**\n * {@link GenericStorage} backed by Node.js {@link AsyncLocalStorage}.\n *\n * Each async context (e.g. HTTP request) gets its own isolated `Map`,\n * so credentials from one request never leak into another.\n *\n * Call {@link run} to establish a context before using the SDK:\n *\n * ```ts\n * import { asyncLocalStorage } from \"@zama-fhe/sdk/node\";\n *\n * app.post(\"/api/transfer\", (req, res) => {\n * asyncLocalStorage.run(async () => {\n * const sdk = new ZamaSDK({ relayer, signer, storage: asyncLocalStorage });\n * // credentials are scoped to this request\n * });\n * });\n * ```\n */\nexport class AsyncLocalMapStorage implements GenericStorage {\n readonly #als = new AsyncLocalStorage<Map<string, unknown>>();\n\n /** Execute `fn` within an isolated storage context. */\n run<R>(fn: () => R | Promise<R>): R | Promise<R> {\n return this.#als.run(new Map(), fn);\n }\n\n async get<T = unknown>(key: string): Promise<T | null> {\n return (this.#als.getStore()?.get(key) as T) ?? null;\n }\n\n async set<T = unknown>(key: string, value: T): Promise<void> {\n this.#als.getStore()?.set(key, value);\n }\n\n async delete(key: string): Promise<void> {\n this.#als.getStore()?.delete(key);\n }\n}\n\n/** Default singleton for application-wide use. */\nexport const asyncLocalStorage = new AsyncLocalMapStorage();\n"],"mappings":"+NAsBA,SAAgB,EAAK,EAA6C,CAChE,MAAO,CAAE,KAAM,OAAQ,cAAgB,GAAU,IAAI,EAAa,CAAE,QAAO,SAAQ,CAAC,CAAE,CACxF,CCFA,IAAa,EAAb,KAA4D,CAC1D,GAAgB,IAAI,EAGpB,IAAO,EAA0C,CAC/C,OAAO,KAAKA,GAAK,IAAI,IAAI,IAAO,CAAE,CACpC,CAEA,MAAM,IAAiB,EAAgC,CACrD,OAAQ,KAAKA,GAAK,SAAS,CAAC,EAAE,IAAI,CAAG,GAAW,IAClD,CAEA,MAAM,IAAiB,EAAa,EAAyB,CAC3D,KAAKA,GAAK,SAAS,CAAC,EAAE,IAAI,EAAK,CAAK,CACtC,CAEA,MAAM,OAAO,EAA4B,CACvC,KAAKA,GAAK,SAAS,CAAC,EAAE,OAAO,CAAG,CAClC,CACF,EAGA,MAAa,EAAoB,IAAI"}
1
+ {"version":3,"file":"index.js","names":["#als"],"sources":["../../../src/node/config.ts","../../../src/storage/async-local-storage.ts"],"sourcesContent":["import type { FheChain } from \"../chains/types\";\nimport type { RelayerConfig } from \"../config/types\";\nimport { FhevmRelayer } from \"../relayer/fhevm-relayer\";\nimport type { RelayerOptions } from \"../relayer/types\";\n\n/** Node transport — drives the FHE backend directly on the calling thread. */\nexport interface NodeRelayerConfig extends RelayerConfig {\n /** Discriminant for the node transport. */\n readonly type: \"node\";\n /** @internal */\n readonly createRelayer: (chain: FheChain) => FhevmRelayer;\n}\n\n/**\n * Node.js transport — drives `@fhevm/sdk` via {@link FhevmRelayer} on the calling thread.\n *\n * @example\n * ```ts\n * relayers: {\n * [sepolia.id]: node({ timeout: 5 * 60_000 }),\n * [mainnet.id]: node({ batchRpcCalls: true }),\n * }\n * ```\n */\nexport function node(options?: RelayerOptions): NodeRelayerConfig {\n return { type: \"node\", createRelayer: (chain) => new FhevmRelayer({ chain, options }) };\n}\n","import { AsyncLocalStorage } from \"node:async_hooks\";\nimport type { GenericStorage } from \"../types\";\n\n/**\n * {@link GenericStorage} backed by Node.js {@link AsyncLocalStorage}.\n *\n * Each async context (e.g. HTTP request) gets its own isolated `Map`,\n * so credentials from one request never leak into another.\n *\n * Call {@link run} to establish a context before using the SDK:\n *\n * ```ts\n * import { asyncLocalStorage } from \"@zama-fhe/sdk/node\";\n *\n * app.post(\"/api/transfer\", (req, res) => {\n * asyncLocalStorage.run(async () => {\n * const sdk = new ZamaSDK({ relayer, signer, storage: asyncLocalStorage });\n * // credentials are scoped to this request\n * });\n * });\n * ```\n */\nexport class AsyncLocalMapStorage implements GenericStorage {\n readonly #als = new AsyncLocalStorage<Map<string, unknown>>();\n\n /** Execute `fn` within an isolated storage context. */\n run<R>(fn: () => R | Promise<R>): R | Promise<R> {\n return this.#als.run(new Map(), fn);\n }\n\n /**\n * Retrieve a value by key.\n * @returns The stored value, or `null` if the key does not exist.\n */\n async get<T = unknown>(key: string): Promise<T | null> {\n return (this.#als.getStore()?.get(key) as T) ?? null;\n }\n\n /** Store a value under the given key, overwriting any existing entry. */\n async set<T = unknown>(key: string, value: T): Promise<void> {\n this.#als.getStore()?.set(key, value);\n }\n\n /** Remove the entry for the given key (no-op if absent). */\n async delete(key: string): Promise<void> {\n this.#als.getStore()?.delete(key);\n }\n}\n\n/** Default singleton for application-wide use. */\nexport const asyncLocalStorage = new AsyncLocalMapStorage();\n"],"mappings":"+NAwBA,SAAgB,EAAK,EAA6C,CAChE,MAAO,CAAE,KAAM,OAAQ,cAAgB,GAAU,IAAI,EAAa,CAAE,QAAO,SAAQ,CAAC,CAAE,CACxF,CCJA,IAAa,EAAb,KAA4D,CAC1D,GAAgB,IAAI,EAGpB,IAAO,EAA0C,CAC/C,OAAO,KAAKA,GAAK,IAAI,IAAI,IAAO,CAAE,CACpC,CAMA,MAAM,IAAiB,EAAgC,CACrD,OAAQ,KAAKA,GAAK,SAAS,CAAC,EAAE,IAAI,CAAG,GAAW,IAClD,CAGA,MAAM,IAAiB,EAAa,EAAyB,CAC3D,KAAKA,GAAK,SAAS,CAAC,EAAE,IAAI,EAAK,CAAK,CACtC,CAGA,MAAM,OAAO,EAA4B,CACvC,KAAKA,GAAK,SAAS,CAAC,EAAE,OAAO,CAAG,CAClC,CACF,EAGA,MAAa,EAAoB,IAAI"}
@@ -1,8 +1,10 @@
1
- import { $ as ShieldPath, A as EncryptEndEvent, B as TransferSubmittedEvent, Bt as EncryptInput, D as DecryptErrorEvent, E as DecryptEndEvent, F as SetOperatorSubmittedEvent, Ft as TransactionResult, H as UnshieldPhase2StartedEvent, Ht as EncryptResult, I as ShieldSubmittedEvent, It as ClearValue, J as ZamaSDKEventListener, K as ZamaSDKEvent, Kt as FhevmRelayerSDK, L as TransactionErrorEvent, Lt as DecryptPublicValuesResult, M as EncryptStartEvent, N as FinalizeUnwrapSubmittedEvent, Nt as RawLog, O as DecryptStartEvent, P as RevokeDelegationSubmittedEvent, Pt as TransactionReceipt, Q as ShieldOptions, R as TransactionOperation, T as BaseEvent, U as UnshieldPhase2SubmittedEvent, Ut as EncryptedValue, V as UnshieldPhase1SubmittedEvent, Vt as EncryptParams, W as UnwrapSubmittedEvent, X as ZamaSDKEvents, Z as ApprovalStrategy, _t as UnwrapRequestedEvent, at as TransferCallbacks, c as GenericStorage, d as WalletAccount, et as TransferOptions, f as WalletAccountChange, ft as OnChainEvent, gt as UnwrapFinalizedEvent, i as ZamaConfig, it as ShieldCallbacks, j as EncryptErrorEvent, k as DelegationSubmittedEvent, nt as UnwrapResult, ot as UnshieldCallbacks, p as WalletAccountListener, q as ZamaSDKEventInput, rt as WrapOptions, tt as UnshieldOptions, u as GenericSigner, ut as ConfidentialTransferEvent, vt as WrapEvent, w as ApproveUnderlyingSubmittedEvent, z as TransferFromSubmittedEvent, zt as EIP712TypedData } from "../types-CELdIAFG.js";
2
- import { St as TokenWrapperPairWithMetadata, _ as BatchBalancesResult, _t as zamaQueryKeys, bt as PaginatedResult, d as ZamaSDK, dt as SerializedTransportKeyPair, g as WrappedToken, gt as SignerQueryContext, ht as decryptValuesQueryOptions, m as WrappersRegistry, mt as EncryptedInput, pt as DecryptResult, v as BatchDecryptAsOptions, vt as MutationFactoryOptions, xt as TokenWrapperPair, y as Token, yt as QueryFactoryOptions } from "../index-C4Hn6K9c.js";
3
- import "../index-9Cn2VKDw.js";
1
+ import { d as FheChainAuth, u as FheChain } from "../index-S6_V7aAH.js";
2
+ import { $ as UnshieldOptions, A as EncryptErrorEvent, B as UnshieldPhase1SubmittedEvent, Bt as EncryptResult, C as ApproveUnderlyingSubmittedEvent, D as DecryptStartEvent, E as DecryptErrorEvent, F as ShieldSubmittedEvent, Ft as DecryptPublicValuesResult, G as ZamaSDKEvent, Gt as FhevmRuntimeConfig, H as UnshieldPhase2SubmittedEvent, Ht as FhevmClient, I as TransactionErrorEvent, J as ZamaSDKEvents, K as ZamaSDKEventListener, L as TransactionOperation, Lt as EIP712TypedData, M as FinalizeUnwrapSubmittedEvent, Mt as TransactionReceipt, N as RevokeDelegationSubmittedEvent, Nt as TransactionResult, O as DelegationSubmittedEvent, P as SetOperatorSubmittedEvent, Pt as ClearValue, Q as TransferOptions, R as TransferFromSubmittedEvent, Rt as EncryptInput, S as WriteFunctionName, T as DecryptEndEvent, U as UnwrapSubmittedEvent, V as UnshieldPhase2StartedEvent, Vt as EncryptedValue, W as WrapSubmittedEvent, Wt as FhevmRelayerOptions, X as ShieldOptions, Y as ApprovalStrategy, Z as ShieldPath, _ as ReadContractConfig, b as WriteContractArgs, c as GenericStorage, ct as ConfidentialTransferEvent, d as WalletAccount, et as UnwrapResult, f as WalletAccountChange, g as ReadContractArgs, gt as WrapEvent, h as ContractAbi, ht as UnwrapRequestedEvent, i as ZamaConfig, it as UnshieldCallbacks, j as EncryptStartEvent, jt as RawLog, k as EncryptEndEvent, l as GenericProvider, m as WalletAccountStore, mt as UnwrapFinalizedEvent, nt as ShieldCallbacks, p as WalletAccountListener, qt as RelayerSDK, rt as TransferCallbacks, s as GenericLogger, tt as WrapOptions, u as GenericSigner, ut as OnChainEvent, v as ReadContractReturnType, w as BaseEvent, x as WriteContractConfig, y as ReadFunctionName, z as TransferSubmittedEvent, zt as EncryptParams } from "../types-CWPSTRF6.js";
3
+ import { A as BatchDecryptResult, C as BatchDecryptAsOptions, Ct as QueryFactoryOptions, D as DelegationStatus, E as Delegations, Et as TokenWrapperPairWithMetadata, O as Decryption, S as BatchBalancesResult, St as MutationFactoryOptions, T as Permits, Tt as TokenWrapperPair, _t as DecryptResult, bt as SignerQueryContext, d as ZamaSDK, h as WrappersRegistryConfig, j as DelegatedDecryptOptions, k as BatchDecryptItem, m as WrappersRegistry, mt as ZamaErrorCode, p as ListPairsOptions, pt as ZamaError, vt as EncryptedInput, w as Token, wt as PaginatedResult, x as WrappedToken, xt as zamaQueryKeys, y as SerializedTransportKeyPair, yt as decryptValuesQueryOptions } from "../index-DLaQtvYu.js";
4
+ import "../index-DNofJMCK.js";
4
5
  import { Address, Hex } from "viem";
5
6
  //#region src/query/utils.d.ts
7
+ /** Union of TanStack Query option keys stripped by {@link filterQueryOptions}, leaving only domain parameters. */
6
8
  type StrippedQueryOptionKeys = "gcTime" | "staleTime" | "enabled" | "select" | "refetchInterval" | "refetchOnMount" | "refetchOnWindowFocus" | "refetchOnReconnect" | "retry" | "retryDelay" | "retryOnMount" | "queryFn" | "queryKey" | "queryKeyHashFn" | "initialData" | "initialDataUpdatedAt" | "placeholderData" | "structuralSharing" | "throwOnError" | "meta" | "query" | "pollingInterval";
7
9
  /**
8
10
  * Remove TanStack behavioral options from a query config object so only domain
@@ -31,55 +33,88 @@ declare function filterQueryOptions<TOptions extends Record<string, unknown>>(op
31
33
  declare function hashFn(queryKey: readonly unknown[]): string;
32
34
  //#endregion
33
35
  //#region src/query/invalidation.d.ts
36
+ /** Minimal query shape read by the invalidation predicates. */
34
37
  interface QueryLike {
38
+ /** The query's cache key. */
35
39
  queryKey: readonly unknown[];
36
40
  }
41
+ /** Minimal filter shape accepted by the invalidation helpers, matching TanStack Query's `QueryFilters`. */
37
42
  interface QueryFilterLike {
43
+ /** Match queries whose key starts with this prefix. */
38
44
  queryKey?: readonly unknown[];
45
+ /** Match queries for which this returns `true`. */
39
46
  predicate?: (query: QueryLike) => boolean;
40
47
  }
48
+ /** Minimal `QueryClient` surface used by the invalidation helpers. */
41
49
  interface QueryClientLike {
50
+ /** Mark matching queries stale so they refetch. */
42
51
  invalidateQueries(filters: QueryFilterLike): void | Promise<void>;
52
+ /** Remove matching queries from the cache entirely. */
43
53
  removeQueries(filters: QueryFilterLike): void;
44
54
  }
55
+ /** Invalidates the caches affected by an unwrap: confidential balances, underlying allowance, and pending unshields. */
45
56
  declare function invalidateAfterUnwrap(queryClient: QueryClientLike, tokenAddress: Address): void;
57
+ /** Invalidates the caches affected by a wrap: confidential balances and underlying allowance. */
46
58
  declare function invalidateAfterWrap(queryClient: QueryClientLike, tokenAddress: Address): void;
59
+ /** Invalidates the confidential balance queries for a token (single-token and batched). */
47
60
  declare function invalidateBalanceQueries(queryClient: QueryClientLike, tokenAddress: Address): void;
61
+ /** Invalidates the caches affected by a shield: confidential balances and underlying allowance. */
48
62
  declare function invalidateAfterShield(queryClient: QueryClientLike, tokenAddress: Address): void;
63
+ /** Invalidates the caches affected by an unshield request: confidential balances, underlying allowance, and pending unshields. */
49
64
  declare function invalidateAfterUnshield(queryClient: QueryClientLike, tokenAddress: Address): void;
65
+ /** Invalidates the pending-unshield cache once an unshield has settled on-chain. */
50
66
  declare function invalidateAfterUnshieldSettled(queryClient: QueryClientLike, tokenAddress: Address): void;
67
+ /** Invalidates the confidential balance caches affected by a transfer. */
51
68
  declare function invalidateAfterTransfer(queryClient: QueryClientLike, tokenAddress: Address): void;
69
+ /** Invalidates the underlying-allowance cache after approving the underlying ERC-20. */
52
70
  declare function invalidateAfterApproveUnderlying(queryClient: QueryClientLike, tokenAddress: Address): void;
71
+ /** Invalidates the operator-status cache after changing a token operator. */
53
72
  declare function invalidateAfterSetOperator(queryClient: QueryClientLike, tokenAddress: Address): void;
73
+ /** Invalidates any wagmi `useBalance`/`readContract` balance queries so ERC-20 balances refresh. */
54
74
  declare function invalidateWagmiBalanceQueries(queryClient: QueryClientLike): void;
75
+ /** Clears wallet-local caches (decryption, permits) and invalidates all Zama queries — call on wallet connect/disconnect so a stale entitlement can't leak across accounts. */
55
76
  declare function invalidateWalletLifecycleQueries(queryClient: QueryClientLike): void;
56
77
  //#endregion
57
78
  //#region src/query/token-metadata.d.ts
58
79
  /** ERC-20 token metadata returned by {@link tokenMetadataQueryOptions}. */
59
80
  interface TokenMetadata {
81
+ /** Human-readable token name. */
60
82
  name: string;
83
+ /** Token ticker symbol. */
61
84
  symbol: string;
85
+ /** Number of decimals the token uses. */
62
86
  decimals: number;
63
87
  }
88
+ /** Configuration for {@link tokenMetadataQueryOptions}. */
64
89
  interface TokenMetadataQueryConfig {
90
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
65
91
  query?: Record<string, unknown>;
66
92
  }
93
+ /** Builds TanStack Query options for reading an ERC-20 token's name, symbol, and decimals. */
67
94
  declare function tokenMetadataQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config?: TokenMetadataQueryConfig): QueryFactoryOptions<TokenMetadata, Error, TokenMetadata, ReturnType<typeof zamaQueryKeys.tokenMetadata.token>>;
68
95
  //#endregion
69
96
  //#region src/query/is-confidential.d.ts
97
+ /** Configuration for {@link isConfidentialQueryOptions} and {@link isWrapperQueryOptions}. */
70
98
  interface IsConfidentialQueryConfig {
99
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
71
100
  query?: Record<string, unknown>;
72
101
  }
102
+ /** Builds TanStack Query options for reading whether a token address implements the confidential (ERC-7984) token interface. */
73
103
  declare function isConfidentialQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config?: IsConfidentialQueryConfig): QueryFactoryOptions<boolean, Error, boolean, ReturnType<typeof zamaQueryKeys.isConfidential.token>>;
104
+ /** Builds TanStack Query options for reading whether a token address is a confidential wrapper (ERC-7984 wrapper) contract. */
74
105
  declare function isWrapperQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config?: IsConfidentialQueryConfig): QueryFactoryOptions<boolean, Error, boolean, ReturnType<typeof zamaQueryKeys.isWrapper.token>>;
75
106
  //#endregion
76
107
  //#region src/query/total-supply.d.ts
108
+ /** Configuration for {@link totalSupplyQueryOptions}. */
77
109
  interface TotalSupplyQueryConfig {
110
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
78
111
  query?: Record<string, unknown>;
79
112
  }
113
+ /** Builds TanStack Query options for reading a token's total supply. */
80
114
  declare function totalSupplyQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config?: TotalSupplyQueryConfig): QueryFactoryOptions<bigint, Error, bigint, ReturnType<typeof zamaQueryKeys.totalSupply.token>>;
81
115
  //#endregion
82
116
  //#region src/query/wrapper-discovery.d.ts
117
+ /** Configuration for {@link wrapperDiscoveryQueryOptions}. */
83
118
  interface WrapperDiscoveryQueryConfig {
84
119
  /**
85
120
  * Address of any confidential token you control.
@@ -99,19 +134,27 @@ interface WrapperDiscoveryQueryConfig {
99
134
  * yet known — the query will be disabled.
100
135
  */
101
136
  registryAddress?: Address;
137
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
102
138
  query?: Record<string, unknown>;
103
139
  }
140
+ /** Builds TanStack Query options for discovering the confidential wrapper address for a given ERC-20 token (resolves to `null` when none is registered). */
104
141
  declare function wrapperDiscoveryQueryOptions(registry: WrappersRegistry, config: WrapperDiscoveryQueryConfig): QueryFactoryOptions<Address | null, Error, Address | null, ReturnType<typeof zamaQueryKeys.wrapperDiscovery.token>>;
105
142
  //#endregion
106
143
  //#region src/query/underlying-allowance.d.ts
144
+ /** Configuration for {@link underlyingAllowanceQueryOptions}. */
107
145
  interface UnderlyingAllowanceQueryConfig {
146
+ /** Owner whose underlying-token allowance to read; the query stays disabled until provided. */
108
147
  owner?: Address;
148
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
109
149
  query?: Record<string, unknown>;
110
150
  }
151
+ /** Builds TanStack Query options for reading the ERC-20 allowance the owner has granted a confidential wrapper on its underlying token. */
111
152
  declare function underlyingAllowanceQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config: UnderlyingAllowanceQueryConfig): QueryFactoryOptions<bigint, Error, bigint, ReturnType<typeof zamaQueryKeys.underlyingAllowance.scope>>;
112
153
  //#endregion
113
154
  //#region src/query/pending-unshield.d.ts
155
+ /** Configuration for {@link pendingUnshieldQueryOptions}. */
114
156
  interface PendingUnshieldQueryConfig {
157
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
115
158
  query?: Record<string, unknown>;
116
159
  }
117
160
  /**
@@ -125,57 +168,92 @@ interface PendingUnshieldQueryConfig {
125
168
  declare function pendingUnshieldQueryOptions(sdk: ZamaSDK, tokenAddress: Address, config?: PendingUnshieldQueryConfig): QueryFactoryOptions<Hex | null, Error, Hex | null, ReturnType<typeof zamaQueryKeys.pendingUnshield.token>>;
126
169
  //#endregion
127
170
  //#region src/query/confidential-is-operator.d.ts
171
+ /** Configuration for {@link confidentialIsOperatorQueryOptions}. */
128
172
  interface ConfidentialIsOperatorQueryConfig {
173
+ /** Token holder whose operator authorization to check; the query stays disabled until provided. */
129
174
  holder?: Address;
175
+ /** Spender address to check for operator authorization; the query stays disabled until provided. */
130
176
  spender?: Address;
177
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
131
178
  query?: Record<string, unknown>;
132
179
  }
180
+ /** Builds TanStack Query options for reading whether a spender is an authorized operator of a holder on a confidential token. */
133
181
  declare function confidentialIsOperatorQueryOptions(sdk: ZamaSDK, tokenAddress: Address | undefined, config: ConfidentialIsOperatorQueryConfig): QueryFactoryOptions<boolean, Error, boolean, ReturnType<typeof zamaQueryKeys.confidentialIsOperator.scope>>;
134
182
  //#endregion
135
183
  //#region src/query/confidential-balance.d.ts
184
+ /** Configuration for {@link confidentialBalanceQueryOptions}. */
136
185
  interface ConfidentialBalanceQueryConfig {
186
+ /** Address of the confidential token to read the balance of. */
137
187
  tokenAddress: Address;
188
+ /** Account whose confidential balance to read; the query stays disabled until provided. */
138
189
  account?: Address;
190
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
139
191
  query?: Record<string, unknown>;
140
192
  }
141
193
  /** Query options for a single confidential token balance. Auto-gated on `account`. */
142
194
  declare function confidentialBalanceQueryOptions(token: Token, config: ConfidentialBalanceQueryConfig, signerContext?: SignerQueryContext): QueryFactoryOptions<bigint, Error, bigint, ReturnType<typeof zamaQueryKeys.confidentialBalance.owner>>;
143
195
  //#endregion
144
196
  //#region src/query/confidential-balances.d.ts
197
+ /** Configuration for {@link confidentialBalancesQueryOptions}. */
145
198
  interface ConfidentialBalancesQueryConfig {
199
+ /** Account whose confidential balances to read; the query stays disabled until provided. */
146
200
  account?: Address;
201
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
147
202
  query?: Record<string, unknown>;
148
203
  }
204
+ /** Builds TanStack Query options for reading the confidential balances of several tokens for one account in a single batch. */
149
205
  declare function confidentialBalancesQueryOptions(tokens: Token[], config?: ConfidentialBalancesQueryConfig, signerContext?: SignerQueryContext): QueryFactoryOptions<BatchBalancesResult, Error, BatchBalancesResult, ReturnType<typeof zamaQueryKeys.confidentialBalances.tokens>>;
150
206
  //#endregion
151
207
  //#region src/query/wrappers-registry.d.ts
208
+ /** Base configuration shared by the wrappers-registry query option factories. */
152
209
  interface WrappersRegistryQueryConfig {
210
+ /** Registry contract address for the current chain; used as a query key discriminator. */
153
211
  registryAddress: Address | undefined;
212
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
154
213
  query?: Record<string, unknown>;
155
214
  }
215
+ /** Builds TanStack Query options for reading all token wrapper pairs registered in the wrappers registry. */
156
216
  declare function tokenPairsQueryOptions(sdk: ZamaSDK, config: WrappersRegistryQueryConfig): QueryFactoryOptions<readonly TokenWrapperPair[], Error, readonly TokenWrapperPair[], ReturnType<typeof zamaQueryKeys.wrappersRegistry.tokenPairs>>;
217
+ /** Configuration for {@link confidentialTokenAddressQueryOptions}. */
157
218
  interface ConfidentialTokenAddressQueryConfig extends WrappersRegistryQueryConfig {
219
+ /** Underlying ERC-20 token address whose confidential counterpart to look up. */
158
220
  tokenAddress?: Address;
159
221
  }
222
+ /** Builds TanStack Query options for reading the confidential token address registered for a given underlying ERC-20 token. */
160
223
  declare function confidentialTokenAddressQueryOptions(sdk: ZamaSDK, config: ConfidentialTokenAddressQueryConfig): QueryFactoryOptions<readonly [boolean, Address], Error, readonly [boolean, Address], ReturnType<typeof zamaQueryKeys.wrappersRegistry.confidentialTokenAddress>>;
224
+ /** Configuration for {@link tokenAddressQueryOptions}. */
161
225
  interface TokenAddressQueryConfig extends WrappersRegistryQueryConfig {
226
+ /** Confidential token address whose underlying ERC-20 counterpart to look up. */
162
227
  confidentialTokenAddress?: Address;
163
228
  }
229
+ /** Builds TanStack Query options for reading the underlying ERC-20 token address registered for a given confidential token. */
164
230
  declare function tokenAddressQueryOptions(sdk: ZamaSDK, config: TokenAddressQueryConfig): QueryFactoryOptions<readonly [boolean, Address], Error, readonly [boolean, Address], ReturnType<typeof zamaQueryKeys.wrappersRegistry.tokenAddress>>;
231
+ /** Builds TanStack Query options for reading the total number of token wrapper pairs in the registry. */
165
232
  declare function tokenPairsLengthQueryOptions(sdk: ZamaSDK, config: WrappersRegistryQueryConfig): QueryFactoryOptions<bigint, Error, bigint, ReturnType<typeof zamaQueryKeys.wrappersRegistry.tokenPairsLength>>;
233
+ /** Configuration for {@link tokenPairsSliceQueryOptions}. */
166
234
  interface TokenPairsSliceQueryConfig extends WrappersRegistryQueryConfig {
235
+ /** Zero-based index of the first pair in the slice (inclusive). */
167
236
  fromIndex?: bigint;
237
+ /** Index bounding the end of the slice. */
168
238
  toIndex?: bigint;
169
239
  }
240
+ /** Builds TanStack Query options for reading a contiguous slice of the registry's token wrapper pairs. */
170
241
  declare function tokenPairsSliceQueryOptions(sdk: ZamaSDK, config: TokenPairsSliceQueryConfig): QueryFactoryOptions<readonly TokenWrapperPair[], Error, readonly TokenWrapperPair[], ReturnType<typeof zamaQueryKeys.wrappersRegistry.tokenPairsSlice>>;
242
+ /** Configuration for {@link tokenPairQueryOptions}. */
171
243
  interface TokenPairQueryConfig extends WrappersRegistryQueryConfig {
244
+ /** Zero-based index of the token wrapper pair to read. */
172
245
  index?: bigint;
173
246
  }
247
+ /** Builds TanStack Query options for reading a single token wrapper pair by its index in the registry. */
174
248
  declare function tokenPairQueryOptions(sdk: ZamaSDK, config: TokenPairQueryConfig): QueryFactoryOptions<TokenWrapperPair, Error, TokenWrapperPair, ReturnType<typeof zamaQueryKeys.wrappersRegistry.tokenPair>>;
249
+ /** Configuration for {@link isConfidentialTokenValidQueryOptions}. */
175
250
  interface IsConfidentialTokenValidQueryConfig extends WrappersRegistryQueryConfig {
251
+ /** Confidential token address to validate against the registry. */
176
252
  confidentialTokenAddress?: Address;
177
253
  }
254
+ /** Builds TanStack Query options for checking whether a confidential token is registered and valid in the registry. */
178
255
  declare function isConfidentialTokenValidQueryOptions(sdk: ZamaSDK, config: IsConfidentialTokenValidQueryConfig): QueryFactoryOptions<boolean, Error, boolean, ReturnType<typeof zamaQueryKeys.wrappersRegistry.isConfidentialTokenValid>>;
256
+ /** Configuration for {@link listPairsQueryOptions}. */
179
257
  interface ListPairsQueryConfig {
180
258
  /**
181
259
  * The registry address for this chain — used as a query key discriminator.
@@ -184,9 +262,13 @@ interface ListPairsQueryConfig {
184
262
  * per registry contract.
185
263
  */
186
264
  registryAddress: Address | undefined;
265
+ /** 1-based page number to fetch; defaults to `1`. */
187
266
  page?: number;
267
+ /** Number of pairs per page; defaults to `100`. */
188
268
  pageSize?: number;
269
+ /** When `true`, resolve each pair's on-chain metadata; defaults to `false`. */
189
270
  metadata?: boolean;
271
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
190
272
  query?: Record<string, unknown>;
191
273
  }
192
274
  /**
@@ -201,101 +283,132 @@ declare function listPairsQueryOptions(registry: WrappersRegistry, config: ListP
201
283
  //#region src/query/shield.d.ts
202
284
  /** Variables for {@link shieldMutationOptions}. */
203
285
  interface ShieldParams extends ShieldOptions {
286
+ /** Amount of the public ERC-20 to shield, in the token's base units. */
204
287
  amount: bigint;
205
288
  }
289
+ /** Builds TanStack Query mutation options for {@link WrappedToken.shield | shielding} a public ERC-20 into its confidential form. @see {@link ShieldParams} */
206
290
  declare function shieldMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.shield", Address], ShieldParams, TransactionResult>;
207
291
  //#endregion
208
292
  //#region src/query/transfer.d.ts
209
293
  /** Variables for {@link confidentialTransferMutationOptions}. */
210
294
  interface ConfidentialTransferParams extends TransferOptions {
295
+ /** Recipient address. */
211
296
  to: Address;
297
+ /** Amount of tokens to transfer, in the token's base units. */
212
298
  amount: bigint;
213
299
  }
300
+ /** Builds TanStack Query mutation options for {@link Token.confidentialTransfer | transferring} confidential tokens. @see {@link ConfidentialTransferParams} */
214
301
  declare function confidentialTransferMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.confidentialTransfer", Address], ConfidentialTransferParams, TransactionResult>;
215
302
  //#endregion
216
303
  //#region src/query/transfer-and-call.d.ts
217
304
  /** Variables for {@link confidentialTransferAndCallMutationOptions}. */
218
305
  interface ConfidentialTransferAndCallParams extends TransferOptions {
306
+ /** Recipient address. */
219
307
  to: Address;
308
+ /** Amount of tokens to transfer, in the token's base units. */
220
309
  amount: bigint;
221
310
  /** Opaque bytes forwarded to the recipient's ERC-7984 receiver hook. */
222
311
  data: Hex;
223
312
  }
313
+ /** Builds TanStack Query mutation options for {@link Token.confidentialTransferAndCall | transferring} confidential tokens and invoking the recipient's receiver hook. @see {@link ConfidentialTransferAndCallParams} */
224
314
  declare function confidentialTransferAndCallMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.confidentialTransferAndCall", Address], ConfidentialTransferAndCallParams, TransactionResult>;
225
315
  //#endregion
226
316
  //#region src/query/transfer-from.d.ts
227
317
  /** Variables for {@link confidentialTransferFromMutationOptions}. */
228
318
  interface ConfidentialTransferFromParams {
319
+ /** Address to transfer from. */
229
320
  from: Address;
321
+ /** Recipient address. */
230
322
  to: Address;
323
+ /** Amount of tokens to transfer, in the token's base units. */
231
324
  amount: bigint;
232
325
  /** Optional progress callbacks for the multi-step transfer flow. */
233
326
  callbacks?: TransferCallbacks;
234
327
  }
328
+ /** Builds TanStack Query mutation options for {@link Token.confidentialTransferFrom | transferring} confidential tokens from another account (operator flow). @see {@link ConfidentialTransferFromParams} */
235
329
  declare function confidentialTransferFromMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.confidentialTransferFrom", Address], ConfidentialTransferFromParams, TransactionResult>;
236
330
  //#endregion
237
331
  //#region src/query/transfer-from-and-call.d.ts
238
332
  /** Variables for {@link confidentialTransferFromAndCallMutationOptions}. */
239
333
  interface ConfidentialTransferFromAndCallParams {
334
+ /** Address to transfer from. */
240
335
  from: Address;
336
+ /** Recipient address. */
241
337
  to: Address;
338
+ /** Amount of tokens to transfer, in the token's base units. */
242
339
  amount: bigint;
243
340
  /** Opaque bytes forwarded to the recipient's ERC-7984 receiver hook. */
244
341
  data: Hex;
245
342
  /** Optional progress callbacks for the multi-step transfer flow. */
246
343
  callbacks?: TransferCallbacks;
247
344
  }
345
+ /** 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} */
248
346
  declare function confidentialTransferFromAndCallMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.confidentialTransferFromAndCall", Address], ConfidentialTransferFromAndCallParams, TransactionResult>;
249
347
  //#endregion
250
348
  //#region src/query/set-operator.d.ts
251
349
  /** Variables for {@link confidentialSetOperatorMutationOptions}. */
252
350
  interface ConfidentialSetOperatorParams {
351
+ /** Operator address to authorize. */
253
352
  operator: Address;
353
+ /** Unix timestamp (seconds) when the operator authorization expires; defaults to one hour from now. */
254
354
  until?: number;
255
355
  }
356
+ /** Builds TanStack Query mutation options for {@link Token.setOperator | authorizing} an operator on a confidential token. @see {@link ConfidentialSetOperatorParams} */
256
357
  declare function confidentialSetOperatorMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.confidentialSetOperator", Address], ConfidentialSetOperatorParams, TransactionResult>;
257
358
  //#endregion
258
359
  //#region src/query/approve-underlying.d.ts
259
360
  /** Variables for {@link approveUnderlyingMutationOptions}. */
260
361
  interface ApproveUnderlyingParams {
362
+ /** Amount of the underlying ERC-20 to approve, in its base units; omit for a max approval. */
261
363
  amount?: bigint;
262
364
  }
365
+ /** Builds TanStack Query mutation options for {@link WrappedToken.approveUnderlying | approving} the wrapper to spend the underlying ERC-20. @see {@link ApproveUnderlyingParams} */
263
366
  declare function approveUnderlyingMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.approveUnderlying", Address], ApproveUnderlyingParams, TransactionResult>;
264
367
  //#endregion
265
368
  //#region src/query/unshield.d.ts
266
369
  /** Variables for {@link unshieldMutationOptions}. */
267
370
  interface UnshieldParams extends UnshieldOptions {
371
+ /** Amount of tokens to unshield, in the token's base units. */
268
372
  amount: bigint;
269
373
  }
374
+ /** Builds TanStack Query mutation options for {@link WrappedToken.unshield | unshielding} a confidential token back into its public ERC-20. @see {@link UnshieldParams} */
270
375
  declare function unshieldMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.unshield", Address], UnshieldParams, TransactionResult>;
271
376
  //#endregion
272
377
  //#region src/query/unshield-all.d.ts
273
378
  /** Variables for {@link unshieldAllMutationOptions}. */
274
379
  interface UnshieldAllParams extends UnshieldCallbacks {}
380
+ /** Builds TanStack Query mutation options for {@link WrappedToken.unshieldAll | unshielding} the entire confidential balance back into the public ERC-20. @see {@link UnshieldAllParams} */
275
381
  declare function unshieldAllMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.unshieldAll", Address], UnshieldAllParams | void, TransactionResult>;
276
382
  //#endregion
277
383
  //#region src/query/resume-unshield.d.ts
278
384
  /** Variables for {@link resumeUnshieldMutationOptions}. */
279
385
  interface ResumeUnshieldParams extends UnshieldCallbacks {
386
+ /** Hash of the earlier unwrap request transaction to resume from. */
280
387
  unwrapTxHash: Hex;
281
388
  }
389
+ /** Builds TanStack Query mutation options for {@link WrappedToken.resumeUnshield | resuming} an interrupted unshield from its unwrap request transaction. @see {@link ResumeUnshieldParams} */
282
390
  declare function resumeUnshieldMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.resumeUnshield", Address], ResumeUnshieldParams, TransactionResult>;
283
391
  //#endregion
284
392
  //#region src/query/unwrap.d.ts
285
393
  /** Variables for {@link unwrapMutationOptions}. */
286
394
  interface UnwrapParams {
395
+ /** Amount of tokens to unwrap, in the token's base units. */
287
396
  amount: bigint;
288
397
  }
398
+ /** Builds TanStack Query mutation options for {@link WrappedToken.unwrap | unwrapping} a confidential token (request phase of the two-phase unwrap). @see {@link UnwrapParams} */
289
399
  declare function unwrapMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.unwrap", Address], UnwrapParams, UnwrapResult>;
290
400
  //#endregion
291
401
  //#region src/query/wrap.d.ts
292
402
  /** Variables for {@link wrapMutationOptions}. */
293
403
  interface WrapParams extends WrapOptions {
404
+ /** Amount of the public ERC-20 to wrap, in the token's base units. */
294
405
  amount: bigint;
295
406
  }
407
+ /** Builds TanStack Query mutation options for {@link WrappedToken.wrap | wrapping} a public ERC-20 into its confidential form. @see {@link WrapParams} */
296
408
  declare function wrapMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.wrap", Address], WrapParams, TransactionResult>;
297
409
  //#endregion
298
410
  //#region src/query/unwrap-all.d.ts
411
+ /** Builds TanStack Query mutation options for {@link WrappedToken.unwrapAll | unwrapping} the entire confidential balance. */
299
412
  declare function unwrapAllMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.unwrapAll", Address], void, UnwrapResult>;
300
413
  //#endregion
301
414
  //#region src/query/finalize-unwrap.d.ts
@@ -304,25 +417,34 @@ type FinalizeUnwrapParams = {
304
417
  /** Identifier from an `UnwrapRequested` event. */
305
418
  unwrapRequestId: EncryptedValue;
306
419
  };
420
+ /** Builds TanStack Query mutation options for {@link WrappedToken.finalizeUnwrap | finalizing} a previously requested unwrap. @see {@link FinalizeUnwrapParams} */
307
421
  declare function finalizeUnwrapMutationOptions(token: WrappedToken): MutationFactoryOptions<readonly ["zama.finalizeUnwrap", Address], FinalizeUnwrapParams, TransactionResult>;
308
422
  //#endregion
309
423
  //#region src/query/encrypt.d.ts
424
+ /** Builds TanStack Query mutation options for {@link ZamaSDK.encrypt | encrypting} plaintext inputs into an encrypted payload. */
310
425
  declare function encryptMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.encrypt"], EncryptParams, EncryptResult>;
311
426
  //#endregion
312
427
  //#region src/query/delegated-decrypt.d.ts
428
+ /** Variables for {@link delegatedDecryptValuesMutationOptions}. */
313
429
  interface DelegatedDecryptValuesMutationParams {
430
+ /** Encrypted values (with their contract addresses) to decrypt. */
314
431
  encryptedInputs: EncryptedInput[];
432
+ /** Address of the account that delegated decryption rights to the connected wallet. */
315
433
  delegatorAddress: Address;
316
434
  }
435
+ /** Builds TanStack Query mutation options for {@link Decryption.delegatedDecryptValues | decrypting} encrypted values via delegated decryption credentials. @see {@link DelegatedDecryptValuesMutationParams} */
317
436
  declare function delegatedDecryptValuesMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.delegatedDecryptValues"], DelegatedDecryptValuesMutationParams, Readonly<Record<EncryptedValue, ClearValue>>>;
318
437
  //#endregion
319
438
  //#region src/query/public-decrypt.d.ts
439
+ /** Builds TanStack Query mutation options for {@link Decryption.decryptPublicValues | publicly decrypting} encrypted values, caching each clear result. */
320
440
  declare function decryptPublicValuesMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.decryptPublicValues"], EncryptedValue[], DecryptPublicValuesResult>;
321
441
  //#endregion
322
442
  //#region src/query/grant-permit.d.ts
443
+ /** Builds TanStack Query mutation options for {@link Permits.grantPermit | granting} decryption permits for the given contract addresses. */
323
444
  declare function grantPermitMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.grantPermit"], Address[], void>;
324
445
  //#endregion
325
446
  //#region src/query/has-permit.d.ts
447
+ /** Configuration for {@link hasPermitQueryOptions}. */
326
448
  interface HasPermitQueryConfig {
327
449
  /** Contract addresses to check credentials against. */
328
450
  contractAddresses: Address[];
@@ -333,6 +455,7 @@ interface HasPermitQueryConfig {
333
455
  */
334
456
  query?: Record<string, unknown>;
335
457
  }
458
+ /** Builds TanStack Query options for reading whether the connected wallet holds a valid decryption permit for the given contracts. */
336
459
  declare function hasPermitQueryOptions(sdk: ZamaSDK, config: HasPermitQueryConfig, signerContext?: SignerQueryContext): QueryFactoryOptions<boolean, Error, boolean, ReturnType<typeof zamaQueryKeys.hasPermit.scope>>;
337
460
  //#endregion
338
461
  //#region src/query/revoke-permits.d.ts
@@ -346,43 +469,54 @@ declare function clearCredentialsMutationOptions(sdk: ZamaSDK): MutationFactoryO
346
469
  //#region src/query/delegate-decryption.d.ts
347
470
  /** Variables for {@link delegateDecryptionMutationOptions}. */
348
471
  interface DelegateDecryptionParams {
472
+ /** Address to grant delegated decryption rights to. */
349
473
  delegateAddress: Address;
474
+ /** When the delegation expires; omit for no expiry. */
350
475
  expirationDate?: Date;
351
476
  }
477
+ /** Builds TanStack Query mutation options for {@link Delegations.delegateDecryption | granting} delegated decryption rights on a contract. @see {@link DelegateDecryptionParams} */
352
478
  declare function delegateDecryptionMutationOptions(sdk: ZamaSDK, contractAddress: Address): MutationFactoryOptions<readonly ["zama.delegateDecryption", Address], DelegateDecryptionParams, TransactionResult>;
353
479
  //#endregion
354
480
  //#region src/query/decrypt-balance-as.d.ts
355
481
  /** Variables for {@link decryptBalanceAsMutationOptions}. */
356
482
  interface DecryptBalanceAsParams {
483
+ /** Address of the account that delegated decryption rights to the connected wallet. */
357
484
  delegatorAddress: Address;
485
+ /** Account whose on-chain balance to read; defaults to the delegator address. */
358
486
  accountAddress?: Address;
359
487
  }
488
+ /** Builds TanStack Query mutation options for {@link Token.decryptBalanceAs | decrypting} a balance via delegated decryption credentials. @see {@link DecryptBalanceAsParams} */
360
489
  declare function decryptBalanceAsMutationOptions(token: Token): MutationFactoryOptions<readonly ["zama.decryptBalanceAs", Address], DecryptBalanceAsParams, bigint>;
361
490
  //#endregion
362
491
  //#region src/query/batch-decrypt-balances-as.d.ts
363
492
  /** Variables for {@link batchDecryptBalancesAsMutationOptions}. */
364
493
  type BatchDecryptBalancesAsParams = BatchDecryptAsOptions;
494
+ /** Builds TanStack Query mutation options for {@link Token.batchDecryptBalancesAs | decrypting} multiple token balances via delegated decryption credentials. @see {@link BatchDecryptBalancesAsParams} */
365
495
  declare function batchDecryptBalancesAsMutationOptions(tokens: Token[]): MutationFactoryOptions<readonly ["zama.batchDecryptBalancesAs", ...Address[]], BatchDecryptBalancesAsParams, Map<Address, bigint>>;
366
496
  //#endregion
367
497
  //#region src/query/revoke-delegation.d.ts
368
498
  /** Variables for {@link revokeDelegationMutationOptions}. */
369
499
  interface RevokeDelegationParams {
500
+ /** Address whose delegated decryption rights to revoke. */
370
501
  delegateAddress: Address;
371
502
  }
503
+ /** Builds TanStack Query mutation options for {@link Delegations.revokeDelegation | revoking} delegated decryption rights on a contract. @see {@link RevokeDelegationParams} */
372
504
  declare function revokeDelegationMutationOptions(sdk: ZamaSDK, contractAddress: Address): MutationFactoryOptions<readonly ["zama.revokeDelegation", Address], RevokeDelegationParams, TransactionResult>;
373
505
  //#endregion
374
506
  //#region src/query/delegation-status.d.ts
375
- interface DelegationStatusData {
376
- isActive: boolean;
377
- expiryTimestamp: bigint;
378
- }
507
+ /** Configuration for {@link delegationStatusQueryOptions}. */
379
508
  interface DelegationStatusQueryConfig {
509
+ /** Contract the delegation applies to; pass `undefined` to keep the query disabled. */
380
510
  contractAddress: Address | undefined;
511
+ /** Address granting the delegated decryption rights; the query stays disabled until provided. */
381
512
  delegatorAddress?: Address;
513
+ /** Address receiving the delegated decryption rights; the query stays disabled until provided. */
382
514
  delegateAddress?: Address;
515
+ /** Additional TanStack Query options merged into the generated query (e.g. `staleTime`, `enabled`). */
383
516
  query?: Record<string, unknown>;
384
517
  }
385
- declare function delegationStatusQueryOptions(sdk: ZamaSDK, config: DelegationStatusQueryConfig): QueryFactoryOptions<DelegationStatusData, Error, DelegationStatusData, ReturnType<typeof zamaQueryKeys.delegationStatus.scope>>;
518
+ /** Builds TanStack Query options for reading the decryption-delegation status between a delegator and a delegate on a contract. */
519
+ declare function delegationStatusQueryOptions(sdk: ZamaSDK, config: DelegationStatusQueryConfig): QueryFactoryOptions<DelegationStatus, Error, DelegationStatus, ReturnType<typeof zamaQueryKeys.delegationStatus.scope>>;
386
520
  //#endregion
387
- export { type ApprovalStrategy, type ApproveUnderlyingParams, type ApproveUnderlyingSubmittedEvent, type BaseEvent, type BatchBalancesResult, type BatchDecryptAsOptions, type BatchDecryptBalancesAsParams, type ClearValue, type ConfidentialBalanceQueryConfig, type ConfidentialBalancesQueryConfig, type ConfidentialIsOperatorQueryConfig, type ConfidentialSetOperatorParams, type ConfidentialTokenAddressQueryConfig, type ConfidentialTransferAndCallParams, type ConfidentialTransferEvent, type ConfidentialTransferFromAndCallParams, type ConfidentialTransferFromParams, type ConfidentialTransferParams, type DecryptBalanceAsParams, type DecryptEndEvent, type DecryptErrorEvent, type EncryptedInput as DecryptInput, type DecryptPublicValuesResult, type DecryptResult, type DecryptStartEvent, type DelegateDecryptionParams, type DelegatedDecryptValuesMutationParams, type DelegationStatusData, type DelegationStatusQueryConfig, type DelegationSubmittedEvent, type EIP712TypedData, type EncryptEndEvent, type EncryptErrorEvent, type EncryptInput, type EncryptParams, type EncryptResult, type EncryptStartEvent, type EncryptedValue, type FinalizeUnwrapParams, type FinalizeUnwrapSubmittedEvent, type GenericSigner, type GenericStorage, type HasPermitQueryConfig, type IsConfidentialQueryConfig, type IsConfidentialTokenValidQueryConfig, type ListPairsQueryConfig, type MutationFactoryOptions, type OnChainEvent, type PendingUnshieldQueryConfig, type QueryClientLike, type QueryFactoryOptions, type QueryFilterLike, type QueryLike, type RawLog, type FhevmRelayerSDK as RelayerSDK, type ResumeUnshieldParams, type RevokeDelegationParams, type RevokeDelegationSubmittedEvent, type SerializedTransportKeyPair, 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 TotalSupplyQueryConfig, type TransactionErrorEvent, type TransactionOperation, type TransactionReceipt, type TransactionResult, 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 UnwrapFinalizedEvent, type UnwrapParams, type UnwrapRequestedEvent, type UnwrapSubmittedEvent, type WalletAccount, type WalletAccountChange, type WalletAccountListener, type WrapEvent, type WrapParams, type WrappedToken, type WrapperDiscoveryQueryConfig, type WrappersRegistryQueryConfig, type ZamaConfig, type ZamaSDK, type ZamaSDKEvent, type ZamaSDKEventInput, type ZamaSDKEventListener, ZamaSDKEvents, 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, resumeUnshieldMutationOptions, revokeDelegationMutationOptions, revokePermitsMutationOptions, shieldMutationOptions, tokenAddressQueryOptions, tokenMetadataQueryOptions, tokenPairQueryOptions, tokenPairsLengthQueryOptions, tokenPairsQueryOptions, tokenPairsSliceQueryOptions, totalSupplyQueryOptions, underlyingAllowanceQueryOptions, unshieldAllMutationOptions, unshieldMutationOptions, unwrapAllMutationOptions, unwrapMutationOptions, wrapMutationOptions, wrapperDiscoveryQueryOptions, zamaQueryKeys };
521
+ export { type ApprovalStrategy, type ApproveUnderlyingParams, type ApproveUnderlyingSubmittedEvent, type BaseEvent, type BatchBalancesResult, type BatchDecryptAsOptions, type BatchDecryptBalancesAsParams, type BatchDecryptItem, type BatchDecryptResult, type ClearValue, type ConfidentialBalanceQueryConfig, type ConfidentialBalancesQueryConfig, type ConfidentialIsOperatorQueryConfig, type ConfidentialSetOperatorParams, type ConfidentialTokenAddressQueryConfig, type ConfidentialTransferAndCallParams, type ConfidentialTransferEvent, type ConfidentialTransferFromAndCallParams, type ConfidentialTransferFromParams, type ConfidentialTransferParams, type ContractAbi, type DecryptBalanceAsParams, type DecryptEndEvent, type DecryptErrorEvent, type EncryptedInput as DecryptInput, type DecryptPublicValuesResult, type DecryptResult, type DecryptStartEvent, type Decryption, type DelegateDecryptionParams, 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 FinalizeUnwrapSubmittedEvent, type GenericLogger, type GenericProvider, type GenericSigner, type GenericStorage, type HasPermitQueryConfig, type IsConfidentialQueryConfig, type IsConfidentialTokenValidQueryConfig, type ListPairsOptions, type ListPairsQueryConfig, type MutationFactoryOptions, type OnChainEvent, type PaginatedResult, type PendingUnshieldQueryConfig, type Permits, type QueryClientLike, type QueryFactoryOptions, type QueryFilterLike, type QueryLike, type RawLog, type ReadContractArgs, type ReadContractConfig, type ReadContractReturnType, type ReadFunctionName, type RelayerSDK, type ResumeUnshieldParams, type RevokeDelegationParams, type RevokeDelegationSubmittedEvent, type SerializedTransportKeyPair, 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 TransactionOperation, type TransactionReceipt, type TransactionResult, 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 UnwrapFinalizedEvent, type UnwrapParams, type UnwrapRequestedEvent, type UnwrapResult, type UnwrapSubmittedEvent, type WalletAccount, type WalletAccountChange, type WalletAccountListener, type WalletAccountStore, type WrapEvent, type WrapOptions, type WrapParams, 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, 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, resumeUnshieldMutationOptions, revokeDelegationMutationOptions, revokePermitsMutationOptions, shieldMutationOptions, tokenAddressQueryOptions, tokenMetadataQueryOptions, tokenPairQueryOptions, tokenPairsLengthQueryOptions, tokenPairsQueryOptions, tokenPairsSliceQueryOptions, totalSupplyQueryOptions, underlyingAllowanceQueryOptions, unshieldAllMutationOptions, unshieldMutationOptions, unwrapAllMutationOptions, unwrapMutationOptions, wrapMutationOptions, wrapperDiscoveryQueryOptions, zamaQueryKeys };
388
522
  //# sourceMappingURL=index.d.ts.map