@zama-fhe/sdk 3.6.0 → 3.7.0-alpha.1

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 (79) 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/chains.cjs +1 -1
  4. package/dist/cjs/chains.cjs.map +1 -1
  5. package/dist/cjs/ethers/index.cjs +1 -1
  6. package/dist/cjs/ethers/index.cjs.map +1 -1
  7. package/dist/cjs/fhevm-relayer.cjs +2 -2
  8. package/dist/cjs/fhevm-relayer.cjs.map +1 -1
  9. package/dist/cjs/index.cjs +1 -1
  10. package/dist/cjs/index.cjs.map +1 -1
  11. package/dist/cjs/query/index.cjs +1 -1
  12. package/dist/cjs/query/index.cjs.map +1 -1
  13. package/dist/cjs/relayer.cjs +1 -1
  14. package/dist/cjs/relayer.cjs.map +1 -1
  15. package/dist/cjs/token.cjs +1 -1
  16. package/dist/cjs/token.cjs.map +1 -1
  17. package/dist/cjs/viem/index.cjs +1 -1
  18. package/dist/cjs/viem/index.cjs.map +1 -1
  19. package/dist/cjs/wrappers-registry.cjs +1 -1
  20. package/dist/cjs/wrappers-registry.cjs.map +1 -1
  21. package/dist/esm/base-signer-BB5y3-NC.js +2 -0
  22. package/dist/esm/base-signer-BB5y3-NC.js.map +1 -0
  23. package/dist/esm/{base-signer-Iu5Lszrf.d.ts → base-signer-DlSb15WN.d.ts} +2 -2
  24. package/dist/esm/chains/index.d.ts +1 -1
  25. package/dist/esm/chains/index.js +1 -1
  26. package/dist/esm/chains-DEpKup1n.js +2 -0
  27. package/dist/esm/chains-DEpKup1n.js.map +1 -0
  28. package/dist/esm/cleartext/index.d.ts +2 -2
  29. package/dist/esm/cleartext/index.js +1 -1
  30. package/dist/esm/{cleartext-B2DI8fgm.d.ts → cleartext-CROV-hgJ.d.ts} +2 -2
  31. package/dist/esm/{cleartext-iE4sWgSP.js → cleartext-ClC0vjWl.js} +2 -2
  32. package/dist/esm/{cleartext-iE4sWgSP.js.map → cleartext-ClC0vjWl.js.map} +1 -1
  33. package/dist/esm/encrypt.worker.js +51 -51
  34. package/dist/esm/{encryption-BKoalB4o.js → encryption-kKFwg89L.js} +2 -2
  35. package/dist/esm/{encryption-BKoalB4o.js.map → encryption-kKFwg89L.js.map} +1 -1
  36. package/dist/esm/ethers/index.d.ts +4 -4
  37. package/dist/esm/ethers/index.js +1 -1
  38. package/dist/esm/ethers/index.js.map +1 -1
  39. package/dist/esm/fhevm-relayer-Bh-_Ngak.js +8 -0
  40. package/dist/esm/fhevm-relayer-Bh-_Ngak.js.map +1 -0
  41. package/dist/esm/{index-BCh3VaZo.d.ts → index-CxgmG5MO.d.ts} +164 -39
  42. package/dist/esm/{index-S6QjPkZE.d.ts → index-DnWijpGT.d.ts} +4 -4
  43. package/dist/esm/{index-ijgDL4IC.d.ts → index-Gk1S0gjO.d.ts} +14 -1
  44. package/dist/esm/index.d.ts +8 -8
  45. package/dist/esm/index.js +1 -1
  46. package/dist/esm/index.js.map +1 -1
  47. package/dist/esm/node/index.d.ts +4 -4
  48. package/dist/esm/node/index.js +1 -1
  49. package/dist/esm/query/index.d.ts +11 -7
  50. package/dist/esm/query/index.js +1 -1
  51. package/dist/esm/query/index.js.map +1 -1
  52. package/dist/esm/relayer-_TF7Dign.js +2 -0
  53. package/dist/esm/relayer-_TF7Dign.js.map +1 -0
  54. package/dist/esm/token-67R06DRQ.js +2 -0
  55. package/dist/esm/{token-BejFVO8m.js.map → token-67R06DRQ.js.map} +1 -1
  56. package/dist/esm/{types-CFDG6lIJ.d.ts → types-CeLa3fMJ.d.ts} +3 -3
  57. package/dist/esm/{types-Ce9Lhvrf.d.ts → types-kqUexcdj.d.ts} +3 -3
  58. package/dist/esm/{types-D3W3J65M.d.ts → types-xCRG0yhi.d.ts} +31 -4
  59. package/dist/esm/{validation-BRu06AM_.js → validation-SxWOOONy.js} +2 -2
  60. package/dist/esm/{validation-BRu06AM_.js.map → validation-SxWOOONy.js.map} +1 -1
  61. package/dist/esm/viem/index.d.ts +4 -4
  62. package/dist/esm/viem/index.js +1 -1
  63. package/dist/esm/viem/index.js.map +1 -1
  64. package/dist/esm/web/index.d.ts +1 -1
  65. package/dist/esm/web/index.js +1 -1
  66. package/dist/esm/wrappers-registry-DqsZPwr9.js +2 -0
  67. package/dist/esm/wrappers-registry-DqsZPwr9.js.map +1 -0
  68. package/package.json +2 -2
  69. package/dist/esm/base-signer-DGIEzavu.js +0 -2
  70. package/dist/esm/base-signer-DGIEzavu.js.map +0 -1
  71. package/dist/esm/chains-ByyCdrrd.js +0 -2
  72. package/dist/esm/chains-ByyCdrrd.js.map +0 -1
  73. package/dist/esm/fhevm-relayer-Cm-ZR1vP.js +0 -8
  74. package/dist/esm/fhevm-relayer-Cm-ZR1vP.js.map +0 -1
  75. package/dist/esm/relayer-CVKO9GmQ.js +0 -2
  76. package/dist/esm/relayer-CVKO9GmQ.js.map +0 -1
  77. package/dist/esm/token-BejFVO8m.js +0 -2
  78. package/dist/esm/wrappers-registry-BLe7PkZi.js +0 -2
  79. package/dist/esm/wrappers-registry-BLe7PkZi.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { a as hoodi, c as polygon, f as FheChain, i as hardhat, l as polygonAmoy, n as bscTestnet, o as ingenTestnet, p as FheChainAuth, r as chains, s as mainnet, t as anvil, u as sepolia } from "../index-ijgDL4IC.js";
2
- import { $t as ClearValue, c as GenericStorage, cn as FhevmClientOptions, dn as RelayerOptions, en as DecryptPublicValuesResult, in as EncryptParams, ln as FhevmRelayerOptions, n as RelayerConfig, nn as EIP712TypedData, on as EncryptedValue, rn as EncryptInput, s as GenericLogger, t as CleartextRelayerConfig, un as FhevmRuntimeConfig } from "../types-D3W3J65M.js";
3
- import { t as cleartext } from "../cleartext-B2DI8fgm.js";
4
- import { i as node, n as asyncLocalStorage, r as NodeRelayerConfig, t as AsyncLocalMapStorage } from "../index-S6QjPkZE.js";
1
+ import { a as hoodi, c as polygon, f as FheChain, i as hardhat, l as polygonAmoy, n as bscTestnet, o as ingenTestnet, p as FheChainAuth, r as chains, s as mainnet, t as anvil, u as sepolia } from "../index-Gk1S0gjO.js";
2
+ import { $t as ClearValue, c as GenericStorage, cn as FhevmClientOptions, dn as RelayerOptions, en as DecryptPublicValuesResult, in as EncryptParams, ln as FhevmRelayerOptions, n as RelayerConfig, nn as EIP712TypedData, on as EncryptedValue, rn as EncryptInput, s as GenericLogger, t as CleartextRelayerConfig, un as FhevmRuntimeConfig } from "../types-xCRG0yhi.js";
3
+ import { t as cleartext } from "../cleartext-CROV-hgJ.js";
4
+ import { i as node, n as asyncLocalStorage, r as NodeRelayerConfig, t as AsyncLocalMapStorage } from "../index-DnWijpGT.js";
5
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, polygon, polygonAmoy, sepolia };
@@ -1,2 +1,2 @@
1
- import{t as e}from"../fhevm-relayer-Cm-ZR1vP.js";import{t}from"../cleartext-iE4sWgSP.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"../chains-ByyCdrrd.js";import{AsyncLocalStorage as f}from"node:async_hooks";function p(t){return{type:`node`,createRelayer:(n,r)=>new e({chain:n,options:t,logger:r})}}var m=class{#e=new f;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 h=new m;export{m as AsyncLocalMapStorage,u as anvil,h as asyncLocalStorage,o as bscTestnet,c as chains,t as cleartext,i as hardhat,n as hoodi,s as ingenTestnet,l as mainnet,p as node,r as polygon,a as polygonAmoy,d as sepolia};
1
+ import{t as e}from"../fhevm-relayer-Bh-_Ngak.js";import{t}from"../cleartext-ClC0vjWl.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"../chains-DEpKup1n.js";import{AsyncLocalStorage as f}from"node:async_hooks";function p(t){return{type:`node`,createRelayer:(n,r)=>new e({chain:n,options:t,logger:r})}}var m=class{#e=new f;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 h=new m;export{m as AsyncLocalMapStorage,u as anvil,h as asyncLocalStorage,o as bscTestnet,c as chains,t as cleartext,i as hardhat,n as hoodi,s as ingenTestnet,l as mainnet,p as node,r as polygon,a as polygonAmoy,d as sepolia};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
- import { f as FheChain, p as FheChainAuth } from "../index-ijgDL4IC.js";
2
- import { $ as SetOperatorSubmittedEvent, $t as ClearValue, A as WalletAccountListener, B as ApproveUnderlyingSubmittedEvent, C as TransferAndCallRequest, Ct as UnshieldCallbacks, D as GenericSigner, Dt as ConfidentialTransferEvent, E as WrapRequest, F as ReadContractReturnType, Ft as WrapEvent, G as DelegationSubmittedEvent, H as DecryptEndEvent, I as ReadFunctionName, J as EncryptStartEvent, K as EncryptEndEvent, L as WriteContractArgs, M as ContractAbi, N as ReadContractArgs, Nt as UnwrapFinalizedEvent, O as WalletAccount, P as ReadContractConfig, Pt as UnwrapRequestedEvent, Q as RevokeDelegationSubmittedEvent, Qt as TransactionResult, R as WriteContractConfig, S as TransactionKind, St as TransferCallbacks, T as UnwrapRequest, U as DecryptErrorEvent, V as BaseEvent, W as DecryptStartEvent, X as PermitErrorEvent, Xt as RawLog, Y as FinalizeUnwrapSubmittedEvent, Z as PermitOperation, Zt as TransactionReceipt, _ as PrepareTransactionRequest, _t as TransferOptions, an as EncryptResult, at as UnshieldPhase1SubmittedEvent, b as RevokeDelegationRequest, bt as WrapOptions, c as GenericStorage, ct as UnwrapSubmittedEvent, d as ConfidentialTransferFromRequest, dt as ZamaSDKEventListener, en as DecryptPublicValuesResult, et as ShieldSubmittedEvent, f as ConfidentialTransferRequest, fn as RelayerSDK, g as PrepareOptions, gt as ShieldPath, h as PrepareFees, ht as ShieldOptions, i as ZamaConfig, in as EncryptParams, it as TransferSubmittedEvent, j as WalletAccountStore, k as WalletAccountChange, kt as OnChainEvent, l as GenericProvider, ln as FhevmRelayerOptions, lt as WrapSubmittedEvent, m as FinalizeUnwrapRequest, mt as ApprovalStrategy, nn as EIP712TypedData, nt as TransactionOperation, on as EncryptedValue, ot as UnshieldPhase2StartedEvent, p as DelegateDecryptionRequest, pt as ZamaSDKEvents, q as EncryptErrorEvent, rn as EncryptInput, rt as TransferFromSubmittedEvent, s as GenericLogger, sn as FhevmClient, st as UnshieldPhase2SubmittedEvent, tt as TransactionErrorEvent, u as ApproveUnderlyingRequest, un as FhevmRuntimeConfig, ut as ZamaSDKEvent, v as PreparedFor, vt as UnshieldOptions, w as UnwrapAllRequest, x as SetOperatorRequest, xt as ShieldCallbacks, y as PreparedTransaction, yt as UnwrapResult, z as WriteFunctionName } from "../types-D3W3J65M.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-BCh3VaZo.js";
4
- import "../index-S6QjPkZE.js";
1
+ import { f as FheChain, p as FheChainAuth } from "../index-Gk1S0gjO.js";
2
+ import { $ as SetOperatorSubmittedEvent, $t as ClearValue, A as WalletAccountListener, B as ApproveUnderlyingSubmittedEvent, C as TransferAndCallRequest, Ct as UnshieldCallbacks, D as GenericSigner, Dt as ConfidentialTransferEvent, E as WrapRequest, F as ReadContractReturnType, Ft as WrapEvent, G as DelegationSubmittedEvent, H as DecryptEndEvent, I as ReadFunctionName, J as EncryptStartEvent, K as EncryptEndEvent, L as WriteContractArgs, M as ContractAbi, N as ReadContractArgs, Nt as UnwrapFinalizedEvent, O as WalletAccount, P as ReadContractConfig, Pt as UnwrapRequestedEvent, Q as RevokeDelegationSubmittedEvent, Qt as TransactionResult, R as WriteContractConfig, S as TransactionKind, St as TransferCallbacks, T as UnwrapRequest, U as DecryptErrorEvent, V as BaseEvent, W as DecryptStartEvent, X as PermitErrorEvent, Xt as RawLog, Y as FinalizeUnwrapSubmittedEvent, Z as PermitOperation, Zt as TransactionReceipt, _ as PrepareTransactionRequest, _t as TransferOptions, an as EncryptResult, at as UnshieldPhase1SubmittedEvent, b as RevokeDelegationRequest, bt as WrapOptions, c as GenericStorage, ct as UnwrapSubmittedEvent, d as ConfidentialTransferFromRequest, dt as ZamaSDKEventListener, en as DecryptPublicValuesResult, et as ShieldSubmittedEvent, f as ConfidentialTransferRequest, fn as RelayerSDK, g as PrepareOptions, gt as ShieldPath, h as PrepareFees, ht as ShieldOptions, i as ZamaConfig, in as EncryptParams, it as TransferSubmittedEvent, j as WalletAccountStore, k as WalletAccountChange, kt as OnChainEvent, l as GenericProvider, ln as FhevmRelayerOptions, lt as WrapSubmittedEvent, m as FinalizeUnwrapRequest, mt as ApprovalStrategy, nn as EIP712TypedData, nt as TransactionOperation, on as EncryptedValue, ot as UnshieldPhase2StartedEvent, p as DelegateDecryptionRequest, pt as ZamaSDKEvents, q as EncryptErrorEvent, rn as EncryptInput, rt as TransferFromSubmittedEvent, s as GenericLogger, sn as FhevmClient, st as UnshieldPhase2SubmittedEvent, tt as TransactionErrorEvent, u as ApproveUnderlyingRequest, un as FhevmRuntimeConfig, ut as ZamaSDKEvent, v as PreparedFor, vt as UnshieldOptions, w as UnwrapAllRequest, x as SetOperatorRequest, xt as ShieldCallbacks, y as PreparedTransaction, yt as UnwrapResult, z as WriteFunctionName } from "../types-xCRG0yhi.js";
3
+ import { A as BatchDecryptAsOptions, At as ZamaErrorCode, Bt as PreparedPermitV1, C as ZamaSDKOptions, D as WrappersRegistryConfig, E as WrappersRegistry, F as Permits, Gt as WILDCARD_PERMIT, Kt as WildcardPermit, Lt as PreparePermitRequest, M as Offline, N as Delegations, O as WrappedToken, P as DelegationStatus, Qt as TokenWrapperPairWithMetadata, Rt as PreparedPermit, S as ZamaSDK, T as ListPairsOptions, Ut as SerializedPermitEip712, Vt as PreparedPermitV2, Wt as SerializedTransportKeyPair, Xt as PaginatedResult, Zt as TokenWrapperPair, _ as decryptValuesQueryOptions, b as MutationFactoryOptions, d as Decryption, f as BatchDecryptItem, g as EncryptedInput, h as DecryptResult, j as Token, k as BatchBalancesResult, kt as ZamaError, m as DelegatedDecryptOptions, p as BatchDecryptResult, qt as ChecksummedAddress, v as SignerQueryContext, x as QueryFactoryOptions, y as zamaQueryKeys, zt as PreparedPermitBase } from "../index-CxgmG5MO.js";
4
+ import "../index-DnWijpGT.js";
5
5
  import { Address, Hex } from "viem";
6
6
  //#region src/query/utils.d.ts
7
7
  /** Union of TanStack Query option keys stripped by {@link filterQueryOptions}, leaving only domain parameters. */
@@ -440,8 +440,12 @@ declare function delegatedDecryptValuesMutationOptions(sdk: ZamaSDK): MutationFa
440
440
  declare function decryptPublicValuesMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.decryptPublicValues"], EncryptedValue[], DecryptPublicValuesResult>;
441
441
  //#endregion
442
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. */
444
- declare function grantPermitMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.grantPermit"], Address[], void>;
443
+ /**
444
+ * Builds TanStack Query mutation options for {@link Permits.grantPermit | granting}
445
+ * decryption permits for the given contract addresses, or {@link WILDCARD_PERMIT}
446
+ * for a permissive V2 permit covering every contract.
447
+ */
448
+ declare function grantPermitMutationOptions(sdk: ZamaSDK): MutationFactoryOptions<readonly ["zama.grantPermit"], Address[] | WildcardPermit, void>;
445
449
  //#endregion
446
450
  //#region src/query/prepare-permit.d.ts
447
451
  /** Builds TanStack Query mutation options for {@link Offline.preparePermit | preparing} an offline decryption permit. */
@@ -533,5 +537,5 @@ interface DelegationStatusQueryConfig {
533
537
  /** Builds TanStack Query options for reading the decryption-delegation status between a delegator and a delegate on a contract. */
534
538
  declare function delegationStatusQueryOptions(sdk: ZamaSDK, config: DelegationStatusQueryConfig): QueryFactoryOptions<DelegationStatus, Error, DelegationStatus, ReturnType<typeof zamaQueryKeys.delegationStatus.scope>>;
535
539
  //#endregion
536
- 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 };
540
+ 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 PreparedPermitBase, type PreparedPermitV1, type PreparedPermitV2, 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, WILDCARD_PERMIT, type WalletAccount, type WalletAccountChange, type WalletAccountListener, type WalletAccountStore, type WildcardPermit, 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 };
537
541
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- import{f as e}from"../relayer-CVKO9GmQ.js";import{A as t,N as n,a as r,b as i,d as a,f as o,h as s,i as c,k as l,n as u,o as d,r as f,s as p,t as m,v as ee,x as h,z as g}from"../wrappers-registry-BLe7PkZi.js";import{t as _}from"../token-BejFVO8m.js";import{r as v}from"../assertions-Ca1ePdRJ.js";import{getAddress as y,zeroAddress as b}from"viem";import{z as x}from"zod/mini";function S(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:p,queryKeyHashFn:m,initialData:ee,initialDataUpdatedAt:h,placeholderData:g,structuralSharing:_,throwOnError:v,meta:y,query:b,pollingInterval:x,...S}=e;return S}function te(e){return JSON.stringify(e,(e,t)=>S(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):typeof t==`bigint`?t.toString():t)}const T=e=>e.map(e=>y(e)),E=e=>e===void 0?void 0:y(e),D=e=>e?{walletAddress:y(e.address),walletChainId:e.chainId}:{},O={confidentialBalance:{all:[`zama.confidentialBalance`],token:e=>[`zama.confidentialBalance`,{tokenAddress:y(e)}],owner:(e,t,n)=>[`zama.confidentialBalance`,{tokenAddress:y(e),...D(n),...t?{owner:y(t)}:{}}]},confidentialBalances:{all:[`zama.confidentialBalances`],tokens:(e,t,n)=>[`zama.confidentialBalances`,{tokenAddresses:T(e),...D(n),...t?{owner:y(t)}:{}}]},tokenMetadata:{all:[`zama.tokenMetadata`],token:e=>[`zama.tokenMetadata`,{tokenAddress:y(e)}]},isConfidential:{all:[`zama.isConfidential`],token:e=>[`zama.isConfidential`,{tokenAddress:y(e)}]},isWrapper:{all:[`zama.isWrapper`],token:e=>[`zama.isWrapper`,{tokenAddress:y(e)}]},wrapperDiscovery:{all:[`zama.wrapperDiscovery`],token:(e,t,n)=>{let r=E(e),i=E(t),a=E(n);return[`zama.wrapperDiscovery`,{...r?{tokenAddress:r}:{},...i?{erc20Address:i}:{},...a?{registryAddress:a}:{}}]}},underlyingAllowance:{all:[`zama.underlyingAllowance`],token:e=>[`zama.underlyingAllowance`,{tokenAddress:y(e)}],scope:(e,t)=>[`zama.underlyingAllowance`,{tokenAddress:y(e),...t?{owner:y(t)}:{}}]},confidentialIsOperator:{all:[`zama.confidentialIsOperator`],token:e=>{let t=E(e);return[`zama.confidentialIsOperator`,t?{tokenAddress:t}:{}]},scope:(e,t,n)=>{let r=E(e),i=E(t),a=E(n);return[`zama.confidentialIsOperator`,{...r?{tokenAddress:r}:{},...i?{holder:i}:{},...a?{spender:a}:{}}]}},totalSupply:{all:[`zama.totalSupply`],token:e=>[`zama.totalSupply`,{tokenAddress:y(e)}]},pendingUnshield:{all:[`zama.pendingUnshield`],token:e=>[`zama.pendingUnshield`,{tokenAddress:y(e)}]},hasPermit:{all:[`zama.hasPermit`],scope:(e,t)=>[`zama.hasPermit`,{...D(t),contractAddresses:T(e).sort()}]},delegationStatus:{all:[`zama.delegationStatus`],contract:e=>{let t=E(e);return[`zama.delegationStatus`,t?{contractAddress:t}:{}]},scope:(e,t,n)=>{let r=E(e),i=E(t),a=E(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:y(t)}}],encryptedInputs:(e,t)=>[`zama.decryption`,{...D(t),encryptedInputs:[...e].sort((e,t)=>e.encryptedValue.localeCompare(t.encryptedValue)).map(e=>({encryptedValue:e.encryptedValue,contractAddress:y(e.contractAddress)}))}]},wrappersRegistry:{all:[`zama.wrappersRegistry`],chainId:()=>[`zama.wrappersRegistry`,{type:`chainId`}],tokenPairs:e=>[`zama.wrappersRegistry`,{type:`tokenPairs`,registryAddress:y(e)}],confidentialTokenAddress:(e,t)=>[`zama.wrappersRegistry`,{type:`confidentialTokenAddress`,registryAddress:y(e),tokenAddress:y(t)}],tokenAddress:(e,t)=>[`zama.wrappersRegistry`,{type:`tokenAddress`,registryAddress:y(e),confidentialTokenAddress:y(t)}],tokenPairsLength:e=>[`zama.wrappersRegistry`,{type:`tokenPairsLength`,registryAddress:y(e)}],tokenPairsSlice:(e,t,n)=>[`zama.wrappersRegistry`,{type:`tokenPairsSlice`,registryAddress:y(e),fromIndex:t,toIndex:n}],tokenPair:(e,t)=>[`zama.wrappersRegistry`,{type:`tokenPair`,registryAddress:y(e),index:t}],isConfidentialTokenValid:(e,t)=>[`zama.wrappersRegistry`,{type:`isConfidentialTokenValid`,registryAddress:y(e),confidentialTokenAddress:y(t)}],listPairs:(e,t,n,r)=>[`zama.wrappersRegistry`,{type:`listPairs`,registryAddress:y(e),page:t,pageSize:n,metadata:r}]}};function k(e,t){e.invalidateQueries({queryKey:O.underlyingAllowance.token(t)})}function A(e,t){e.invalidateQueries({queryKey:O.pendingUnshield.token(t)})}function j(e,t){N(e,t),k(e,t),A(e,t),K(e)}function M(e,t){N(e,t),k(e,t),K(e)}function N(e,t){e.invalidateQueries({queryKey:O.confidentialBalance.token(t)}),e.invalidateQueries({queryKey:O.confidentialBalances.all})}function P(e,t){N(e,t),k(e,t),K(e)}function F(e,t){N(e,t),k(e,t),A(e,t),K(e)}function I(e,t){A(e,t)}function L(e,t){N(e,t)}function R(e,t){k(e,t)}function z(e,t){e.invalidateQueries({queryKey:O.confidentialIsOperator.token(t)})}function B(e){return Array.isArray(e.queryKey)&&typeof e.queryKey[0]==`string`?e.queryKey[0].startsWith(`zama.`):!1}const V=x.enum([`balanceOf`,`confidentialBalanceOf`]),H=x.object({functionName:V}),U=x.object({contracts:x.array(x.unknown())});function W(e){if(H.safeParse(e).success)return!0;let t=U.safeParse(e);return t.success&&t.data.contracts.some(e=>H.safeParse(e).success)}function G(e){return Array.isArray(e.queryKey)&&e.queryKey.some(W)}function K(e){e.invalidateQueries({predicate:G})}function q(e){e.removeQueries({queryKey:O.decryption.all}),e.removeQueries({queryKey:O.hasPermit.all}),e.invalidateQueries({predicate:B}),K(e)}function J(e,t,n){let r=O.tokenMetadata.token(t);return{...w(n?.query??{}),queryKey:r,queryFn:async t=>{let[,{tokenAddress:n}]=t.queryKey,[r,a,o]=await Promise.all([e.provider.readContract(i(n)),e.provider.readContract(h(n)),e.provider.readContract(ee(n))]);return{name:r,symbol:a,decimals:o}},staleTime:1/0,enabled:n?.query?.enabled!==!1}}function Y(t,n,r){let i=O.isConfidential.token(n);return{...w(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 X(t,n,r){let i=O.isWrapper.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(e,t,n){let r=O.totalSupply.token(t);return{...w(n?.query??{}),queryKey:r,queryFn:async t=>{let[,{tokenAddress:n}]=t.queryKey;return e.provider.readContract(l(n))},staleTime:3e4,enabled:n?.query?.enabled!==!1}}function Q(e,t){let n=O.wrapperDiscovery.token(t.tokenAddress,t.erc20Address,t.registryAddress);return{...w(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 ne(e,t,r){let i=r.owner,a=r.query?.enabled!==!1,o=O.underlyingAllowance.scope(t,i);return{...w(r.query??{}),queryKey:o,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(s(a,i,r))},staleTime:3e4,enabled:!!i&&a}}function re(e,t,n){let r=O.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 ie(e,n,r){let i=r.holder,a=r.spender,o=r.query?.enabled!==!1,s=O.confidentialIsOperator.scope(n,i,a);return{...w(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 ae(e,t,n={}){let r=t.query??{};return{...w(r),queryKey:O.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 oe(e,t,n={}){let r=t?.account,i=n.walletAccount,a=t?.query??{},o=e.map(e=>e.address);return{...w(a),queryKey:O.confidentialBalances.tokens(o,r,i),queryFn:async t=>{let[,{owner:n}]=t.queryKey;return v(n,`confidentialBalancesQueryOptions: owner`),_.batchBalancesOf(e,n)},enabled:!!r&&e.length>0&&i!==void 0&&a?.enabled!==!1}}function se(e,t){let n=!!t.registryAddress&&t.query?.enabled!==!1,r=O.wrappersRegistry.tokenPairs(t.registryAddress??b);return{...w(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n}]=t.queryKey;return e.provider.readContract(c(n))},staleTime:e.registry.ttlMs,enabled:n}}function ce(e,t){let n=!!t.registryAddress&&!!t.tokenAddress&&t.query?.enabled!==!1,r=O.wrappersRegistry.confidentialTokenAddress(t.registryAddress??b,t.tokenAddress??b);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 le(e,t){let n=!!t.registryAddress&&!!t.confidentialTokenAddress&&t.query?.enabled!==!1,r=O.wrappersRegistry.tokenAddress(t.registryAddress??b,t.confidentialTokenAddress??b);return{...w(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,confidentialTokenAddress:r}]=t.queryKey;return e.provider.readContract(u(n,r))},staleTime:e.registry.ttlMs,enabled:n}}function ue(e,t){let n=!!t.registryAddress&&t.query?.enabled!==!1,i=O.wrappersRegistry.tokenPairsLength(t.registryAddress??b);return{...w(t.query??{}),queryKey:i,queryFn:async t=>{let[,{registryAddress:n}]=t.queryKey;return e.provider.readContract(r(n))},staleTime:e.registry.ttlMs,enabled:n}}function de(e,t){let n=!!t.registryAddress&&t.fromIndex!==void 0&&t.toIndex!==void 0&&t.query?.enabled!==!1,r=O.wrappersRegistry.tokenPairsSlice(t.registryAddress??b,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(d(n,BigInt(r),BigInt(i)))},staleTime:e.registry.ttlMs,enabled:n}}function fe(e,t){let n=!!t.registryAddress&&t.index!==void 0&&t.query?.enabled!==!1,r=O.wrappersRegistry.tokenPair(t.registryAddress??b,String(t.index??0n));return{...w(t.query??{}),queryKey:r,queryFn:async t=>{let[,{registryAddress:n,index:r}]=t.queryKey;return e.provider.readContract(f(n,BigInt(r)))},staleTime:e.registry.ttlMs,enabled:n}}function pe(e,t){let n=!!t.registryAddress&&!!t.confidentialTokenAddress&&t.query?.enabled!==!1,r=O.wrappersRegistry.isConfidentialTokenValid(t.registryAddress??b,t.confidentialTokenAddress??b);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 me(e,t){let n=!!t.registryAddress&&t.query?.enabled!==!1,r=O.wrappersRegistry.listPairs(t.registryAddress??b,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 he(e){return{mutationKey:[`zama.shield`,e.address],mutationFn:async({amount:t,...n})=>e.shield(t,n)}}function ge(e){return{mutationKey:[`zama.confidentialTransfer`,e.address],mutationFn:async({to:t,amount:n,...r})=>e.confidentialTransfer(t,n,r)}}function _e(e){return{mutationKey:[`zama.confidentialTransferAndCall`,e.address],mutationFn:async({to:t,amount:n,data:r,...i})=>e.confidentialTransferAndCall(t,n,r,i)}}function ve(e){return{mutationKey:[`zama.confidentialTransferFrom`,e.address],mutationFn:async({from:t,to:n,amount:r,callbacks:i})=>e.confidentialTransferFrom(t,n,r,i)}}function ye(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 be(e){return{mutationKey:[`zama.confidentialSetOperator`,e.address],mutationFn:async({operator:t,until:n})=>e.setOperator(t,n)}}function xe(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 we(e){return{mutationKey:[`zama.resumeUnshield`,e.address],mutationFn:async({unwrapTxHash:t,...n})=>e.resumeUnshield(t,n)}}function Te(e){return{mutationKey:[`zama.unwrap`,e.address],mutationFn:async({amount:t})=>e.unwrap(t)}}function Ee(e){return{mutationKey:[`zama.wrap`,e.address],mutationFn:async({amount:t,...n})=>e.wrap(t,n)}}function De(e){return{mutationKey:[`zama.unwrapAll`,e.address],mutationFn:async()=>e.unwrapAll()}}function Oe(e){return{mutationKey:[`zama.finalizeUnwrap`,e.address],mutationFn:async({unwrapRequestId:t})=>e.finalizeUnwrap(t)}}function ke(e){return{mutationKey:[`zama.encrypt`],mutationFn:async t=>e.encrypt(t)}}function Ae(e){return{mutationKey:[`zama.delegatedDecryptValues`],mutationFn:async t=>e.decryption.delegatedDecryptValues(t.encryptedInputs,t.delegatorAddress)}}function je(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(O.decryption.encryptedValue(t),n)}}}function Me(e){return{mutationKey:[`zama.grantPermit`],mutationFn:t=>e.permits.grantPermit(t)}}function Ne(e){return{mutationKey:[`zama.preparePermit`],mutationFn:t=>e.offline.preparePermit(t)}}function Pe(e){return{mutationKey:[`zama.registerPermit`],mutationFn:({prepared:t,signature:n})=>e.permits.registerPermit(t,n)}}function $(e,t,n={}){let r=t.query?.enabled!==!1;return{...w(t?.query??{}),queryKey:O.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 Fe(e){return{mutationKey:[`zama.revokePermits`],mutationFn:t=>t===void 0?e.permits.revokePermits():e.permits.revokePermits(t)}}function Ie(e){return{mutationKey:[`zama.clearCredentials`],mutationFn:()=>e.permits.clear()}}function Le(e,t){return{mutationKey:[`zama.delegateDecryption`,t],mutationFn:async({delegateAddress:n,expirationDate:r})=>e.delegations.delegateDecryption({contractAddress:t,delegateAddress:n,expirationDate:r})}}function Re(e,t,n={}){return{queryKey:O.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 ze(e){return{mutationKey:[`zama.decryptBalanceAs`,e.address],mutationFn:async({delegatorAddress:t,accountAddress:n})=>e.decryptBalanceAs({delegatorAddress:t,accountAddress:n})}}function Be(e){return{mutationKey:[`zama.batchDecryptBalancesAs`,...e.map(e=>e.address)],mutationFn:async t=>_.batchDecryptBalancesAs(e,t)}}function Ve(e,t){return{mutationKey:[`zama.revokeDelegation`,t],mutationFn:async({delegateAddress:n})=>e.delegations.revokeDelegation({contractAddress:t,delegateAddress:n})}}function He(e,t){return{...w(t.query??{}),queryKey:O.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{g as ZamaSDKEvents,xe as approveUnderlyingMutationOptions,Be as batchDecryptBalancesAsMutationOptions,Ie as clearCredentialsMutationOptions,ae as confidentialBalanceQueryOptions,oe as confidentialBalancesQueryOptions,ie as confidentialIsOperatorQueryOptions,be as confidentialSetOperatorMutationOptions,ce as confidentialTokenAddressQueryOptions,_e as confidentialTransferAndCallMutationOptions,ye as confidentialTransferFromAndCallMutationOptions,ve as confidentialTransferFromMutationOptions,ge as confidentialTransferMutationOptions,ze as decryptBalanceAsMutationOptions,je as decryptPublicValuesMutationOptions,Re as decryptValuesQueryOptions,Le as delegateDecryptionMutationOptions,Ae as delegatedDecryptValuesMutationOptions,He as delegationStatusQueryOptions,ke as encryptMutationOptions,w as filterQueryOptions,Oe as finalizeUnwrapMutationOptions,Me as grantPermitMutationOptions,$ as hasPermitQueryOptions,te as hashFn,R as invalidateAfterApproveUnderlying,z as invalidateAfterSetOperator,P as invalidateAfterShield,L as invalidateAfterTransfer,F as invalidateAfterUnshield,I as invalidateAfterUnshieldSettled,j as invalidateAfterUnwrap,M as invalidateAfterWrap,N as invalidateBalanceQueries,K as invalidateWagmiBalanceQueries,q as invalidateWalletLifecycleQueries,Y as isConfidentialQueryOptions,pe as isConfidentialTokenValidQueryOptions,X as isWrapperQueryOptions,me as listPairsQueryOptions,re as pendingUnshieldQueryOptions,Ne as preparePermitMutationOptions,Pe as registerPermitMutationOptions,we as resumeUnshieldMutationOptions,Ve as revokeDelegationMutationOptions,Fe as revokePermitsMutationOptions,he as shieldMutationOptions,le as tokenAddressQueryOptions,J as tokenMetadataQueryOptions,fe as tokenPairQueryOptions,ue as tokenPairsLengthQueryOptions,se as tokenPairsQueryOptions,de as tokenPairsSliceQueryOptions,Z as totalSupplyQueryOptions,ne as underlyingAllowanceQueryOptions,Ce as unshieldAllMutationOptions,Se as unshieldMutationOptions,De as unwrapAllMutationOptions,Te as unwrapMutationOptions,Ee as wrapMutationOptions,Q as wrapperDiscoveryQueryOptions,O as zamaQueryKeys};
1
+ import{f as e}from"../relayer-_TF7Dign.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-DqsZPwr9.js";import{t as v}from"../token-67R06DRQ.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,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,Ue 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,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};
2
2
  //# sourceMappingURL=index.js.map