import { a as CofheConfig, c as CofheClientParams, b as CofheClient, d as CofheClientConnectionState, F as FheTypes } from './clientTypes-BJbFeeno.cjs'; export { h as CofheClientPermits, C as CofheInputConfig, f as CofheInternalConfig, G as DecryptEndpoint, $ as DecryptForTxBuilder, a0 as DecryptForTxResult, _ as DecryptForViewBuilder, B as DecryptPollCallbackContext, D as DecryptPollCallbackFunction, Z as EncryptInputsBuilder, H as EncryptSetStateFn, Q as EncryptStep, J as EncryptStepCallbackContext, N as Encryptable, o as EncryptableAddress, i as EncryptableBool, E as EncryptableItem, z as EncryptableToEncryptedItemInputMap, n as EncryptableUint128, k as EncryptableUint16, l as EncryptableUint32, m as EncryptableUint64, j as EncryptableUint8, x as EncryptedAddressInput, r as EncryptedBoolInput, q as EncryptedItemInput, y as EncryptedItemInputs, p as EncryptedNumber, w as EncryptedUint128Input, t as EncryptedUint16Input, u as EncryptedUint32Input, v as EncryptedUint64Input, s as EncryptedUint8Input, M as FheAllUTypes, V as FheKeyDeserializer, A as FheTypeValue, K as FheUintUTypes, I as IStorage, X as KeysStorage, Y as KeysStore, L as LiteralToPrimitive, P as Primitive, U as UnsealedItem, a1 as ZkBuilderAndCrsGenerator, a2 as ZkProveWorkerFunction, a3 as ZkProveWorkerRequest, a4 as ZkProveWorkerResponse, S as assertCorrectEncryptedItemInput, e as createCofheConfigBase, W as createKeysStore, T as fetchKeys, g as getCofheConfigItem, O as isEncryptableItem, R as isLastEncryptionStep, a5 as zkProveWithWorker } from './clientTypes-BJbFeeno.cjs'; import { Hex, PublicClient } from 'viem'; import './types-C07FK-cL.cjs'; import 'zod'; import './permit-DnVMDT5h.cjs'; import 'zustand/vanilla'; declare const InitialConnectStore: CofheClientConnectionState; /** * Creates a CoFHE client instance (base implementation) * @param {CofheClientParams} opts - Initialization options including config and platform-specific serializers * @returns {CofheClient} - The CoFHE client instance */ declare function createCofheClientBase(opts: CofheClientParams): CofheClient; declare enum CofheErrorCode { InternalError = "INTERNAL_ERROR", UnknownEnvironment = "UNKNOWN_ENVIRONMENT", InitTfheFailed = "INIT_TFHE_FAILED", InitViemFailed = "INIT_VIEM_FAILED", InitEthersFailed = "INIT_ETHERS_FAILED", NotConnected = "NOT_CONNECTED", MissingPublicClient = "MISSING_PUBLIC_CLIENT", MissingWalletClient = "MISSING_WALLET_CLIENT", MissingProviderParam = "MISSING_PROVIDER_PARAM", EmptySecurityZonesParam = "EMPTY_SECURITY_ZONES_PARAM", InvalidPermitData = "INVALID_PERMIT_DATA", InvalidPermitDomain = "INVALID_PERMIT_DOMAIN", PermitNotFound = "PERMIT_NOT_FOUND", CannotRemoveLastPermit = "CANNOT_REMOVE_LAST_PERMIT", AccountUninitialized = "ACCOUNT_UNINITIALIZED", ChainIdUninitialized = "CHAIN_ID_UNINITIALIZED", SealOutputFailed = "SEAL_OUTPUT_FAILED", SealOutputReturnedNull = "SEAL_OUTPUT_RETURNED_NULL", InvalidUtype = "INVALID_UTYPE", DecryptFailed = "DECRYPT_FAILED", DecryptReturnedNull = "DECRYPT_RETURNED_NULL", ZkMocksInsertCtHashesFailed = "ZK_MOCKS_INSERT_CT_HASHES_FAILED", ZkMocksCalcCtHashesFailed = "ZK_MOCKS_CALC_CT_HASHES_FAILED", ZkMocksVerifySignFailed = "ZK_MOCKS_VERIFY_SIGN_FAILED", ZkMocksCreateProofSignatureFailed = "ZK_MOCKS_CREATE_PROOF_SIGNATURE_FAILED", ZkVerifyFailed = "ZK_VERIFY_FAILED", ZkPackFailed = "ZK_PACK_FAILED", ZkProveFailed = "ZK_PROVE_FAILED", EncryptRemainingInItems = "ENCRYPT_REMAINING_IN_ITEMS", ZkUninitialized = "ZK_UNINITIALIZED", ZkVerifierUrlUninitialized = "ZK_VERIFIER_URL_UNINITIALIZED", ThresholdNetworkUrlUninitialized = "THRESHOLD_NETWORK_URL_UNINITIALIZED", MissingConfig = "MISSING_CONFIG", UnsupportedChain = "UNSUPPORTED_CHAIN", MissingZkBuilderAndCrsGenerator = "MISSING_ZK_BUILDER_AND_CRS_GENERATOR", MissingTfhePublicKeyDeserializer = "MISSING_TFHE_PUBLIC_KEY_DESERIALIZER", MissingCompactPkeCrsDeserializer = "MISSING_COMPACT_PKE_CRS_DESERIALIZER", MissingFheKey = "MISSING_FHE_KEY", MissingCrs = "MISSING_CRS", FetchKeysFailed = "FETCH_KEYS_FAILED", PublicWalletGetChainIdFailed = "PUBLIC_WALLET_GET_CHAIN_ID_FAILED", PublicWalletGetAddressesFailed = "PUBLIC_WALLET_GET_ADDRESSES_FAILED", RehydrateKeysStoreFailed = "REHYDRATE_KEYS_STORE_FAILED" } type CofheErrorParams = { code: CofheErrorCode; message: string; cause?: Error; hint?: string; context?: Record; }; /** * CofheError class * This class is used to create errors that are specific to the CoFHE SDK * It extends the Error class and adds a code, cause, hint, and context * The code is used to identify the type of error * The cause is used to indicate the inner error that caused the CofheError * The hint is used to provide a hint about how to fix the error * The context is used to provide additional context about the state that caused the error * The serialize method is used to serialize the error to a JSON string * The toString method is used to provide a human-readable string representation of the error */ declare class CofheError extends Error { readonly code: CofheErrorCode; readonly cause?: Error; readonly hint?: string; readonly context?: Record; constructor({ code, message, cause, hint, context }: CofheErrorParams); /** * Creates a CofheError from an unknown error * If the error is a CofheError, it is returned unchanged, else a new CofheError is created * If a wrapperError is provided, it is used to create the new CofheError, else a default is used */ static fromError(error: unknown, wrapperError?: CofheErrorParams): CofheError; /** * Serializes the error to JSON string with proper handling of Error objects */ serialize(): string; /** * Returns a human-readable string representation of the error */ toString(): string; } declare const isCofheError: (error: unknown) => error is CofheError; /** Main Task Manager contract address */ declare const TASK_MANAGER_ADDRESS: "0xeA30c4B8b44078Bbf8a6ef5b9f1eC1626C7848D9"; /** Mock ZK Verifier contract address (used for testing) */ declare const MOCKS_ZK_VERIFIER_ADDRESS: "0x0000000000000000000000000000000000005001"; /** Mock Threshold Network contract address (used for testing) */ declare const MOCKS_THRESHOLD_NETWORK_ADDRESS: "0x0000000000000000000000000000000000005002"; /** Test Bed contract address (used for testing) */ declare const TEST_BED_ADDRESS: "0x0000000000000000000000000000000000005003"; /** Private key for the Mock ZK Verifier signer account */ declare const MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY: "0x6C8D7F768A6BB4AAFE85E8A2F5A9680355239C7E14646ED62B044E39DE154512"; /** Address for the Mock ZK Verifier signer account */ declare const MOCKS_ZK_VERIFIER_SIGNER_ADDRESS: "0x6E12D8C87503D4287c294f2Fdef96ACd9DFf6bd2"; /** Private key for the Mock decrypt result signer account */ declare const MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY: "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"; /** Maximum total bits for ZK proof packing */ declare const TFHE_RS_ZK_MAX_BITS: 2048; /** Size limit for safe_serialize/safe_deserialize (1 GB) */ declare const TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT: bigint; /** * Verifies a decrypt result signature **locally** (no `ctHash`/plaintext sent over RPC). * * The recovered signer must equal the on-chain configured `decryptResultSigner`. * * This mirrors the TaskManager decrypt-result hash format: * `keccak256(abi.encodePacked(result, encType, chainId, ctHash))` * * The only on-chain read performed is `TaskManager.decryptResultSigner()` (via `eth_call`). * * Works with both production and mock deployments. */ declare function verifyDecryptResult(handle: bigint | string, cleartext: bigint, signature: Hex, publicClient: PublicClient): Promise; /** * Converts FheTypes enum to string representation for serialization * Used when passing data to Web Workers or other serialization contexts */ declare function fheTypeToString(utype: FheTypes): string; export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofheClient, CofheClientConnectionState, CofheClientParams, CofheConfig, CofheError, CofheErrorCode, type CofheErrorParams, FheTypes, MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY, MOCKS_THRESHOLD_NETWORK_ADDRESS, MOCKS_ZK_VERIFIER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY, TASK_MANAGER_ADDRESS, TEST_BED_ADDRESS, TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT, TFHE_RS_ZK_MAX_BITS, createCofheClientBase, fheTypeToString, isCofheError, verifyDecryptResult };