import { CompactPkeCrs } from 'node-tfhe'; import type { Eip1193Provider } from 'ethers'; import type { ethers } from 'ethers'; import type { Provider } from 'ethers'; import { TfheClientKey } from 'node-tfhe'; import { TfheCompactPublicKey } from 'node-tfhe'; export declare abstract class AbstractRelayerProvider { #private; constructor({ relayerUrl, auth }: { relayerUrl: string; auth?: Auth; }); get url(): string; get keyUrl(): string; get inputProofUrl(): string; get publicDecryptUrl(): string; get userDecryptUrl(): string; get delegatedUserDecryptUrl(): string; abstract get version(): number; /** @internal */ fetchTFHEPkeParams(): Promise; private _fetchTFHEPkeParamsImpl; /** @internal */ fetchTFHEPkeUrls(): Promise; /** @internal */ fetchGetKeyUrl(): Promise; /** @internal */ fetchPostInputProofWithZKProof(params: { zkProof: ZKProof; extraData: BytesHex; }, options?: RelayerInputProofOptionsType): Promise<{ result: RelayerInputProofResult; fhevmHandles: FhevmHandle[]; }>; /** @internal */ abstract fetchPostInputProof(payload: RelayerInputProofPayload, options?: RelayerInputProofOptionsType): Promise; /** @internal */ abstract fetchPostPublicDecrypt(payload: RelayerPublicDecryptPayload, options?: RelayerPublicDecryptOptionsType): Promise; /** @internal */ abstract fetchPostUserDecrypt(payload: RelayerUserDecryptPayload, options?: RelayerUserDecryptOptionsType): Promise; /** @internal */ abstract fetchPostDelegatedUserDecrypt(payload: RelayerDelegatedUserDecryptPayload, options?: RelayerUserDecryptOptionsType): Promise; /** @internal */ private _fetchRelayerGet; } export declare class ACL { #private; /** * Creates an ACL instance for checking decryption permissions. * * @param aclContractAddress - The checksummed address of the ACL contract * @param provider - An ethers ContractRunner (provider or signer) for contract interactions * @param batchRpcCalls - Optional, execute RPC calls in parallel * @throws A {@link ChecksummedAddressError} If aclAddress is not a valid checksummed address * @throws A {@link ContractError} If provider is not provided */ constructor({ aclContractAddress, provider, batchRpcCalls, }: { aclContractAddress: ChecksummedAddress; provider: ethers.ContractRunner; batchRpcCalls?: boolean; }); /** * Returns whether each handle is allowed for decryption. * * @throws A {@link FhevmHandleError} If checkArguments is true and any handle is not a valid Bytes32Hex */ isAllowedForDecryption(handles: FhevmHandleLike[], options?: { checkArguments?: boolean; }): Promise; isAllowedForDecryption(handles: FhevmHandleLike, options?: { checkArguments?: boolean; }): Promise; /** * Throws ACLPublicDecryptionError if any handle is not allowed for decryption. * * @throws A {@link FhevmHandleError} If checkArguments is true and any handle is not a valid Bytes32Hex * @throws A {@link ACLPublicDecryptionError} If any handle is not allowed for public decryption */ checkAllowedForDecryption(handles: FhevmHandleLike[] | FhevmHandleLike, options?: { checkArguments?: boolean; }): Promise; /** * Returns whether account is allowed to decrypt handle. * * @throws A {@link FhevmHandleError} If checkArguments is true and any handle is not a valid Bytes32Hex * @throws A {@link ChecksummedAddressError} If checkArguments is true and any address is not a valid checksummed address */ persistAllowed(handleAddressPairs: Array<{ address: ChecksummedAddress; handle: FhevmHandleLike; }>, options?: { checkArguments?: boolean; }): Promise; persistAllowed(handleAddressPairs: { address: ChecksummedAddress; handle: FhevmHandleLike; }, options?: { checkArguments?: boolean; }): Promise; /** * Verifies that a user is allowed to decrypt handles through specific contracts. * * For each (handle, contractAddress) pair, checks that: * 1. The userAddress has permission to decrypt the handle * 2. The contractAddress has permission to decrypt the handle * 3. The userAddress is not equal to any contractAddress * * @throws A {@link FhevmHandleError} If checkArguments is true and any handle is not a valid Bytes32Hex * @throws A {@link ChecksummedAddressError} If checkArguments is true and any address is not a valid checksummed address * @throws A {@link ACLUserDecryptionError} If userAddress equals any contractAddress * @throws A {@link ACLUserDecryptionError} If user is not authorized to decrypt any handle * @throws A {@link ACLUserDecryptionError} If any contract is not authorized to decrypt its handle */ checkUserAllowedForDecryption(params: { userAddress: ChecksummedAddress; handleContractPairs: { contractAddress: ChecksummedAddress; handle: FhevmHandleLike; } | Array<{ contractAddress: ChecksummedAddress; handle: FhevmHandleLike; }>; }, options?: { checkArguments?: boolean; }): Promise; } export declare class ACLPublicDecryptionError extends ContractErrorBase { private readonly _handles; constructor({ contractAddress, handles, }: { contractAddress: ChecksummedAddress; handles: Bytes32Hex[]; }); get handles(): Bytes32Hex[]; } export declare class ACLUserDecryptionError extends ContractErrorBase { constructor({ contractAddress, message, }: { contractAddress: ChecksummedAddress; message: string; }); } export declare type Address = `0x${string}`; export declare class AddressError extends RelayerErrorBase { constructor({ address }: { address: string; }); } /** * Custom cookie authentication */ export declare type ApiKeyCookie = { __type: 'ApiKeyCookie'; /** * The cookie name. The default value is `x-api-key`. */ cookie?: string; /** * The API key. */ value: string; }; /** * Custom header authentication */ export declare type ApiKeyHeader = { __type: 'ApiKeyHeader'; /** * The header name. The default value is `x-api-key`. */ header?: string; /** * The API key. */ value: string; }; /** * Asserts that a value is a valid encryption bit width. * @throws A {@link InvalidTypeError} If value is not a valid encryption bit width. * @example assertIsEncryptionBits(8) // passes * @example assertIsEncryptionBits(4) // throws (euint4 is deprecated) */ export declare function assertIsEncryptionBits(value: unknown, varName?: string): asserts value is EncryptionBits; /** * Asserts that a value is a valid encryption bit width. * @throws A {@link InvalidTypeError} If value is not a valid encryption bit width. * @example assertIsEncryptionBits(8) // passes * @example assertIsEncryptionBits(4) // throws (euint4 is deprecated) */ export declare function assertIsEncryptionBitsArray(value: unknown, varName?: string): asserts value is EncryptionBits[]; export declare function assertNever(_value: never, message: string): never; export declare type Auth = BearerToken | ApiKeyHeader | ApiKeyCookie; /** * Bearer Token Authentication */ export declare type BearerToken = { __type: 'BearerToken'; /** * The Bearer token. */ token: string; }; export declare interface Branding { __brand: BrandT; } export declare type Bytes = Uint8Array; /** * A 0x-prefixed hexadecimal string representing exactly 21 bytes (44 characters - inluding the prefix). */ export declare type Bytes21Hex = `0x${string}`; /** * A hexadecimal string representing exactly 21 bytes without the `0x` prefix (42 characters). */ export declare type Bytes21HexNo0x = string; export declare type Bytes32 = Uint8Array; /** * A 0x-prefixed hexadecimal string representing exactly 32 bytes (66 characters - inluding the prefix). */ export declare type Bytes32Hex = `0x${string}`; /** * A hexadecimal string representing exactly 32 bytes without the `0x` prefix (64 characters). */ export declare type Bytes32HexNo0x = string; export declare type Bytes65 = Uint8Array; /** * A 0x-prefixed hexadecimal string representing exactly 65 bytes (132 characters - inluding the prefix). */ export declare type Bytes65Hex = `0x${string}`; /** * A hexadecimal string representing exactly 65 bytes without the `0x` prefix (130 characters). */ export declare type Bytes65HexNo0x = string; export declare type Bytes8 = Uint8Array; /** * A 0x-prefixed hexadecimal string representing byte data. * * The length must be even (excluding the `0x` prefix) since each byte is * represented by two hex characters. Use `Hex` if odd-length strings are acceptable. * * @example * const data: BytesHex = '0x48656c6c6f'; // "Hello" in hex */ export declare type BytesHex = `0x${string}`; /** * A hexadecimal string representing byte data without the `0x` prefix. * @see {@link BytesHex} */ export declare type BytesHexNo0x = string; export declare type BytesHexNo0xTypeName = | 'BytesHexNo0x' | 'Bytes8HexNo0x' | 'Bytes32HexNo0x' | 'Bytes65HexNo0x'; export declare type BytesHexTypeName = | 'BytesHex' | 'Bytes8Hex' | 'Bytes32Hex' | 'Bytes65Hex'; export declare type BytesTypeName = 'Bytes' | 'Bytes8' | 'Bytes32' | 'Bytes65'; export declare type ChecksummedAddress = `0x${string}`; export declare class ChecksummedAddressError extends RelayerErrorBase { constructor({ address, message }: { address?: string; message?: string; }); } export declare type ClearValues = Readonly>; export declare type ClearValueType = bigint | boolean | `0x${string}`; export declare interface CompactCiphertextListBuilderWasmType { constructor: { name: string }; push_boolean(value: boolean): void; push_u8(value: number): void; push_u16(value: number): void; push_u32(value: number): void; push_u64(value: bigint): void; push_u128(value: bigint): void; push_u160(value: bigint): void; push_u256(value: bigint): void; build_with_proof_packed( crs: CompactPkeCrsWasmType, metadata: Uint8Array, compute_load: unknown, ): ProvenCompactCiphertextListWasmType; } export declare interface CompactPkeCrsStaticWasmType { constructor: { name: string }; safe_deserialize( buffer: Uint8Array, serialized_size_limit: bigint, ): CompactPkeCrsWasmType; } export declare interface CompactPkeCrsWasmType { safe_serialize(serialized_size_limit: bigint): Uint8Array; } export declare class ContractError extends ContractErrorBase { constructor({ contractAddress, contractName, message, }: { contractAddress: ChecksummedAddress; contractName: string; message: string; }); } export declare abstract class ContractErrorBase extends RelayerErrorBase { private readonly _contractAddress; private readonly _contractName; constructor(params: ContractErrorBaseParams); get contractAddress(): `0x${string}`; get contractName(): string; } export declare type ContractErrorBaseParams = Prettify; export declare class CoprocessorEIP712 { #private; readonly domain: CoprocessorEIP712DomainType; constructor(params: { readonly gatewayChainId: bigint; readonly verifyingContractAddressInputVerification: string; }); get gatewayChainId(): bigint; get verifyingContractAddressInputVerification(): ChecksummedAddress; get types(): CoprocessorEIP712TypesType; createEIP712({ ctHandles, contractChainId, contractAddress, userAddress, extraData, }: Prettify & { readonly ctHandles: readonly FhevmHandleLike[]; }>): CoprocessorEIP712Type; verify({ signatures, message, }: { readonly signatures: readonly Bytes65Hex[]; readonly message: CoprocessorEIP712MessageType; }): ChecksummedAddress[]; } export declare type CoprocessorEIP712DomainType = { readonly name: 'InputVerification'; readonly version: '1'; readonly chainId: bigint; readonly verifyingContract: ChecksummedAddress; }; export declare type CoprocessorEIP712MessageHexType = Readonly<{ ctHandles: readonly Bytes32Hex[]; userAddress: ChecksummedAddress; contractAddress: ChecksummedAddress; contractChainId: bigint; extraData: BytesHex; }>; export declare type CoprocessorEIP712MessageType = Readonly<{ ctHandles: readonly Bytes32Hex[] | readonly Bytes32[]; userAddress: ChecksummedAddress; contractAddress: ChecksummedAddress; contractChainId: bigint; extraData: BytesHex; }>; export declare type CoprocessorEIP712Type = Prettify<{ readonly domain: CoprocessorEIP712DomainType; readonly types: CoprocessorEIP712TypesType; readonly message: CoprocessorEIP712MessageType; }>; export declare type CoprocessorEIP712TypesType = { readonly CiphertextVerification: readonly [ { readonly name: 'ctHandles'; readonly type: 'bytes32[]' }, { readonly name: 'userAddress'; readonly type: 'address' }, { readonly name: 'contractAddress'; readonly type: 'address' }, { readonly name: 'contractChainId'; readonly type: 'uint256' }, { readonly name: 'extraData'; readonly type: 'bytes' }, ]; }; export declare class CoprocessorSignersVerifier implements ICoprocessorSignersVerifier { #private; private constructor(); static fromAddresses(params: ICoprocessorSignersVerifier): CoprocessorSignersVerifier; static fromProvider(params: Prettify<{ readonly inputVerifierContractAddress: ChecksummedAddress; readonly provider: ethers.Provider; readonly batchRpcCalls?: boolean; } & ICoprocessorEIP712>): Promise; get count(): number; get coprocessorSigners(): readonly ChecksummedAddress[]; get coprocessorSignerThreshold(): number; get gatewayChainId(): bigint; get verifyingContractAddressInputVerification(): ChecksummedAddress; private _isThresholdReached; verifyZKProof(params: { readonly handles: readonly FhevmHandle[]; readonly zkProof: ZKProof; readonly signatures: readonly Bytes65Hex[]; readonly extraData: BytesHex; }): void; private _verify; verifyAndComputeInputProof(params: { readonly handles: readonly FhevmHandle[]; readonly zkProof: ZKProof; readonly signatures: readonly Bytes65Hex[]; readonly extraData: BytesHex; }): InputProof; } export declare const createInstance: (config: FhevmInstanceConfig) => Promise; export declare const createTfheKeypair: () => { clientKey: TfheClientKey; publicKey: TfheCompactPublicKey; crs: CompactPkeCrs; }; export declare const createTfhePublicKey: () => string; export declare type EncryptionBits = FheTypeEncryptionBitwidth; /** * Returns the encryption bit width for an FheTypeId. * @param typeId - The FHE type Id * @returns The encryption bit width (always \>= 2) * @example encryptionBitsFromFheTypeId(2) // 8 (euint8) * @example encryptionBitsFromFheTypeId(7) // 160 (eaddress) */ export declare function encryptionBitsFromFheTypeId(typeId: FheTypeId): EncryptionBits; /** * Returns the encryption bit width for an FheType name. * @param name - The FHE type name (e.g., 'ebool', 'euint32', 'eaddress') * @returns The encryption bit width (always \>= 2) * @example encryptionBitsFromFheTypeName('ebool') // 2 * @example encryptionBitsFromFheTypeName('euint32') // 32 * @example encryptionBitsFromFheTypeName('eaddress') // 160 */ export declare function encryptionBitsFromFheTypeName(name: FheTypeName): EncryptionBits; export declare class EncryptionError extends RelayerErrorBase { constructor({ message, cause }: { message: string; cause?: unknown; }); } export declare function ensureError(e: unknown): Error; export declare type ExpectedPropertyType = 'non-nullable' | 'string' | 'boolean' | 'number' | 'Array' | 'Uint8Array' | 'Timestamp' | 'unknown' | 'ChecksummedAddress' | 'UintNumber' | 'UintBigInt' | BytesHexNo0xTypeName | BytesHexTypeName | BytesTypeName | UintTypeName; export declare type FheTypedValue = { value: T extends 'ebool' ? boolean : T extends 'eaddress' ? string : number | bigint; fheType: T; }; export declare type FheTypeEncryptionBitwidth = Prettify< keyof FheTypeEncryptionBitwidthToIdMap >; /** * Bitwidth to FheTypeId */ export declare interface FheTypeEncryptionBitwidthToIdMap { 2: FheTypeNameToIdMap['ebool']; // ??: FheTypeNameToIdMap['euint4']; 8: FheTypeNameToIdMap['euint8']; 16: FheTypeNameToIdMap['euint16']; 32: FheTypeNameToIdMap['euint32']; 64: FheTypeNameToIdMap['euint64']; 128: FheTypeNameToIdMap['euint128']; 160: FheTypeNameToIdMap['eaddress']; 256: FheTypeNameToIdMap['euint256']; } export declare class FheTypeError extends RelayerErrorBase { constructor({ fheTypeId, message, }: { fheTypeId?: unknown; message?: string; }); } export declare type FheTypeId = Prettify; /** * Converts an encryption bit width to its corresponding FheTypeId. * Accepts loose `number` input; validates internally via `isEncryptionBits`. * @throws A {@link FheTypeError} If bitwidth is not a valid encryption bit width. * @example fheTypeIdFromEncryptionBits(8) // 2 (euint8) */ export declare function fheTypeIdFromEncryptionBits(bitwidth: number | EncryptionBits): FheTypeId; /** * Converts an FheTypeName to its corresponding FheTypeId. * Accepts loose `string` input; validates internally via `isFheTypeName`. * @throws A {@link FheTypeError} If name is not a valid FheTypeName. * @example fheTypeIdFromName('euint8') // 2 */ export declare function fheTypeIdFromName(name: string | FheTypeName): FheTypeId; /** * FheTypeId to Bitwidth */ export declare type FheTypeIdToEncryptionBitwidthMap = { [K in keyof FheTypeEncryptionBitwidthToIdMap as FheTypeEncryptionBitwidthToIdMap[K]]: K; }; export declare interface FheTypeIdToNameMap { 0: 'ebool'; //1: 'euint4' has been deprecated 2: 'euint8'; 3: 'euint16'; 4: 'euint32'; 5: 'euint64'; 6: 'euint128'; 7: 'eaddress'; 8: 'euint256'; } /** * **FHE Type Mapping for Input Builders** * * Maps the **number of encrypted bits** used by a FHEVM primary type * to its corresponding **FheTypeId**. This constant is primarily used by * `EncryptedInput` and `RelayerEncryptedInput` builders to determine the correct * input type and calculate the total required bit-length. * * **Structure: \{ Encrypted Bit Length: FheTypeId \}** * * | Bits | FheTypeId | FHE Type Name | Note | * | :--- | :-------- | :------------ | :--- | * | 2 | 0 | `ebool` | The boolean type. | * | (N/A)| 1 | `euint4` | **Deprecated** and omitted from this map. | * | 8 | 2 | `euint8` | | * | 16 | 3 | `euint16` | | * | 32 | 4 | `euint32` | | * | 64 | 5 | `euint64` | | * | 128 | 6 | `euint128` | | * | 160 | 7 | `eaddress` | Used for encrypted Ethereum addresses. | * | 256 | 8 | `euint256` | The maximum supported integer size. | */ export declare type FheTypeName = Prettify; /** * Converts an FheTypeId to its corresponding FheTypeName. * Accepts loose `number` input; validates internally via `isFheTypeId`. * @throws A {@link FheTypeError} If id is not a valid FheTypeId. * @example fheTypeNameFromId(2) // 'euint8' */ export declare function fheTypeNameFromId(id: number | FheTypeId): FheTypeName; export declare interface FheTypeNameToIdMap { ebool: 0; //euint4: 1; has been deprecated euint8: 2; euint16: 3; euint32: 4; euint64: 5; euint128: 6; eaddress: 7; euint256: 8; } export declare class FhevmConfigError extends RelayerErrorBase { constructor({ message }: { message?: string; }); } export declare interface FhevmConfigType { chainId: bigint; aclContractAddress: ChecksummedAddress; kmsContractAddress: ChecksummedAddress; verifyingContractAddressDecryption: ChecksummedAddress; verifyingContractAddressInputVerification: ChecksummedAddress; inputVerifierContractAddress: ChecksummedAddress; gatewayChainId: bigint; coprocessorSigners: ChecksummedAddress[]; coprocessorSignerThreshold: number; kmsSigners: ChecksummedAddress[]; kmsSignerThreshold: number; } export declare class FhevmHandle { #private; static readonly RAW_CT_HASH_DOMAIN_SEPARATOR = "ZK-w_rct"; static readonly HANDLE_HASH_DOMAIN_SEPARATOR = "ZK-w_hdl"; static readonly CURRENT_CIPHERTEXT_VERSION = 0; private constructor(); get hash21(): Bytes21Hex; get chainId(): Uint64BigInt; get fheTypeId(): FheTypeId; get fheTypeName(): FheTypeName; get version(): number; get computed(): boolean; get index(): number | undefined; get encryptionBits(): EncryptionBits; get solidityPrimitiveTypeName(): SolidityPrimitiveTypeName; toJSON(): { handle: `0x${string}`; fheTypeName: FheTypeName; fheTypeId: FheTypeId; chainId: bigint; index: number | undefined; computed: boolean; encryptionBits: FheTypeEncryptionBitwidth; version: number; solidityPrimitiveTypeName: SolidityPrimitiveTypeName; hash21: `0x${string}`; }; equals(to: FhevmHandle): boolean; toBytes32(): Bytes32; toBytes32Hex(): Bytes32Hex; static fromComponents(params: { hash21: Bytes21Hex; chainId: number | bigint; fheTypeId: FheTypeId; version: number; computed: boolean; index?: number | undefined; }): FhevmHandle; static from(handle: unknown): FhevmHandle; static fromBytes32(handle: unknown): FhevmHandle; static fromBytes32Hex(handle: unknown): FhevmHandle; static fromZKProof(zkProof: ZKProof, version?: number): FhevmHandle[]; static canParse(handle: unknown): boolean; static assertIsHandleLike(handle: unknown): asserts handle is FhevmHandleLike; static currentCiphertextVersion(): number; /** * blobHashBytes32 = keccak256(ciphertextWithZKProof) */ private static _computeInputHash21; toString(): string; } export declare class FhevmHandleError extends RelayerErrorBase { constructor({ handle, message }: { handle?: unknown; message?: string; }); } export declare type FhevmHandleLike = Bytes32 | Bytes32Hex | FhevmHandle; export declare class FhevmHostChain implements FhevmConfigType { #private; private constructor(); static loadFromChain(config: FhevmHostChainConfig): Promise; get chainId(): bigint; get ethersProvider(): Provider; get aclContractAddress(): ChecksummedAddress; get kmsContractAddress(): ChecksummedAddress; get inputVerifierContractAddress(): ChecksummedAddress; get coprocessorSigners(): ChecksummedAddress[]; get coprocessorSignerThreshold(): number; get verifyingContractAddressInputVerification(): ChecksummedAddress; get kmsSigners(): ChecksummedAddress[]; get kmsSignerThreshold(): number; get verifyingContractAddressDecryption(): ChecksummedAddress; get gatewayChainId(): bigint; } export declare class FhevmHostChainConfig { #private; private constructor(); get chainId(): bigint; get aclContractAddress(): ChecksummedAddress; get kmsContractAddress(): ChecksummedAddress; get inputVerifierContractAddress(): ChecksummedAddress; get network(): string | Eip1193Provider; get ethersProvider(): Provider; get verifyingContractAddressDecryption(): ChecksummedAddress; get verifyingContractAddressInputVerification(): ChecksummedAddress; get gatewayChainId(): bigint; get batchRpcCalls(): boolean; static fromUserConfig(instanceConfig: FhevmInstanceConfig): FhevmHostChainConfig; loadFromChain(): Promise; } export declare interface FhevmInstance { config: FhevmConfigType; createEncryptedInput(contractAddress: string, userAddress: string): RelayerEncryptedInput; requestZKProofVerification(zkProof: ZKProofLike, options?: RelayerInputProofOptionsType): Promise; generateKeypair(): KeypairType; createEIP712(publicKey: string, contractAddresses: string[], startTimestamp: number, durationDays: number): KmsUserDecryptEIP712Type; createDelegatedUserDecryptEIP712(publicKey: string, contractAddresses: string[], delegatorAddress: string, startTimestamp: number, durationDays: number): KmsDelegatedUserDecryptEIP712Type; publicDecrypt(handles: (string | Uint8Array)[], options?: RelayerPublicDecryptOptionsType): Promise; userDecrypt(handles: HandleContractPair[], privateKey: string, publicKey: string, signature: string, contractAddresses: string[], userAddress: string, startTimestamp: number, durationDays: number, options?: RelayerUserDecryptOptionsType): Promise; delegatedUserDecrypt(handleContractPairs: HandleContractPair[], privateKey: string, publicKey: string, signature: string, contractAddresses: string[], delegatorAddress: string, delegateAddress: string, startTimestamp: number, durationDays: number, options?: RelayerUserDecryptOptionsType): Promise; getPublicKey(): { publicKeyId: string; publicKey: Uint8Array; } | null; getPublicParams(bits: keyof PublicParams): { publicParams: Uint8Array; publicParamsId: string; } | null; } export declare type FhevmInstanceConfig = Prettify< { verifyingContractAddressDecryption: string; verifyingContractAddressInputVerification: string; kmsContractAddress: string; inputVerifierContractAddress: string; aclContractAddress: string; gatewayChainId: number; relayerUrl: string; network: Eip1193Provider | string; chainId: number; batchRpcCalls?: boolean; relayerRouteVersion?: 1 | 2; } & Partial & FhevmInstanceOptions >; export declare type FhevmInstanceOptions = { auth?: Auth; debug?: boolean; }; /** * Complete FHEVM public key encryption (PKE) configuration. * * Contains the TFHE compact public key and the associated PKE CRS parameters * required for encrypting values on the client side. * @see {@link FhevmPublicKeyType} * @see {@link FhevmPkeCrsByCapacityType} */ export declare type FhevmPkeConfigType = { /** The TFHE compact public key used for encryption. */ publicKey: FhevmPublicKeyType; /** PKE CRS parameters indexed by encryption capacity. */ publicParams: FhevmPkeCrsByCapacityType; }; /** * TFHE Compact PKE CRS parameters indexed by maximum encryption capacity in bits. * * The key (e.g., 2048) represents the maximum number of plaintext bits that can be * encrypted together in a single compact list. When encrypting multiple values, * choose a CRS configuration that supports at least the total bit count of all values. * Note that a boolean needs 2 encryption bits instead of 1. * * Currently only 2048-bit capacity is supported. * @see {@link FhevmPkeCrsType} */ export declare type FhevmPkeCrsByCapacityType = { 2048: FhevmPkeCrsType; }; /** * The FHEVM TFHE Compact PKE (Public Key Encryption) CRS (Common Reference String). * For more info about CRS see: https://docs.zama.org/tfhe-rs/fhe-computation/advanced-features/zk-pok */ export declare type FhevmPkeCrsType = { /** The TFHE compact pke crs as raw bytes. */ publicParams: Uint8Array; /** A server-assigned identifier for the key (not required for cryptographic operations). */ publicParamsId: string; }; /** * The FHEVM TFHE Compact public key. */ export declare type FhevmPublicKeyType = { /** The TFHE compact public key as raw bytes. */ data: Uint8Array; /** A server-assigned identifier for the key (not required for cryptographic operations). */ id: string; }; export declare type Flavor = T & Flavoring; export declare interface Flavoring { __flavor?: FlavorT; } export declare function getErrorCauseCode(e: unknown): string | undefined; export declare function getErrorCauseStatus(e: unknown): number | undefined; export declare function getErrorMessage(e: unknown): string; export declare type HandleContractPair = { handle: Uint8Array | string; contractAddress: string; }; export declare type HandleContractPairRelayer = { // Hex encoded bytes32 with 0x prefix. handle: `0x${string}`; // Hex encoded address with 0x prefix. contractAddress: `0x${string}`; }; /** * A 0x-prefixed hexadecimal string. * * Unlike `BytesHex`, the length can be odd or even (e.g., `0x1` or `0x01` are both valid). */ export declare type Hex = `0x${string}`; export declare interface ICoprocessorEIP712 { readonly gatewayChainId: bigint; readonly verifyingContractAddressInputVerification: ChecksummedAddress; } export declare interface ICoprocessorSignersVerifier extends ICoprocessorEIP712 { readonly coprocessorSigners: readonly ChecksummedAddress[]; readonly coprocessorSignerThreshold: number; } export declare interface IKmsEIP712 { readonly chainId: bigint; readonly verifyingContractAddressDecryption: ChecksummedAddress; } export declare interface IKmsSignersVerifier extends IKmsEIP712 { readonly kmsSigners: readonly ChecksummedAddress[]; readonly threshold: number; } export declare class InputProof { #private; private constructor(); get proof(): BytesHex; get signatures(): Bytes65Hex[]; get handles(): Bytes32Hex[]; get extraData(): BytesHex; toBytes(): InputProofBytesType; static from({ signatures, handles, extraData, }: { readonly signatures: readonly Bytes65Hex[]; readonly handles: readonly Bytes32Hex[] | readonly Bytes32[]; readonly extraData: BytesHex; }): InputProof; /** * Validates that the provided handles and inputProof bytes match this InputProof. * Use this as a sanity check to ensure handles correspond to the proof data. */ equalsBytes({ handles, inputProof, }: { handles: Uint8Array[]; inputProof: Uint8Array; }): boolean; static fromProofBytes(proofBytes: Uint8Array): InputProof; } export declare type InputProofBytesType = Readonly<{ handles: Uint8Array[]; inputProof: Uint8Array; }>; export declare class InputVerifier { #private; private constructor(); get address(): ChecksummedAddress; get eip712Domain(): CoprocessorEIP712DomainType; get gatewayChainId(): bigint; get coprocessorSigners(): ChecksummedAddress[]; get coprocessorSignerThreshold(): number; get verifyingContractAddressInputVerification(): ChecksummedAddress; static loadFromChain(params: { inputVerifierContractAddress: ChecksummedAddress; provider: Provider; batchRpcCalls?: boolean; }): Promise; } export declare class InternalError extends RelayerErrorBase { constructor(params: InternalErrorParams); } export declare type InternalErrorParams = { message?: string; }; export declare class InvalidPropertyError extends RelayerErrorBase { readonly _objName: string; readonly _property: string; readonly _expectedType: string; readonly _index?: number | undefined; readonly _value?: string | undefined; readonly _type?: string | undefined; readonly _expectedValue?: string | string[] | undefined; constructor({ objName, property, index, type, value, expectedValue, expectedType, }: { objName: string; property: string; index?: number | undefined; type?: string | undefined; value?: string | undefined; expectedValue?: string | string[] | undefined; expectedType: ExpectedPropertyType; }); static missingProperty({ objName, property, expectedType, expectedValue, }: { objName: string; property: string; expectedType: ExpectedPropertyType; expectedValue?: string | string[] | undefined; }): InvalidPropertyError; static invalidFormat({ objName, property, }: { objName: string; property: string; }): InvalidPropertyError; static invalidObject({ objName, expectedType, type, }: { objName: string; expectedType: ExpectedPropertyType; type?: string; }): InvalidPropertyError; } export declare class InvalidRelayerUrlError extends RelayerErrorBase { constructor(params: InvalidRelayerUrlErrorParams); } export declare type InvalidRelayerUrlErrorParams = Omit; export declare class InvalidTypeError extends RelayerErrorBase { private readonly _varName?; private readonly _type?; private readonly _expectedType; private readonly _expectedCustomType?; constructor({ varName, type, expectedType, expectedCustomType, }: { varName?: string | undefined; type?: string | undefined; expectedType: 'string' | 'boolean' | 'Uint' | 'UintNumber' | 'Uint8' | 'Uint16' | 'Uint32' | 'Uint64' | 'Uint128' | 'Uint256' | 'Address' | 'AddressArray' | 'ChecksummedAddress' | 'ChecksummedAddressArray' | 'Bytes32Hex' | 'Bytes65Hex' | 'BytesHexNo0x' | 'Bytes32HexNo0x' | 'Bytes65HexNo0x' | 'Bytes32' | 'Bytes65' | 'Uint8Array' | 'BytesHexArray' | 'Bytes32HexArray' | 'Bytes65HexArray' | 'Array' | 'BytesHex' | 'EncryptionBits' | 'EncryptionBitsArray' | 'Custom'; expectedCustomType?: string | undefined; }); get varName(): string | undefined; get type(): string | undefined; get expectedType(): string; get expectedCustomType(): string | undefined; } export declare function isAddress(value: unknown): value is Address; export declare function isChecksummedAddress(value: unknown): value is ChecksummedAddress; /** * Checks if a value is a valid encryption bit width. * @example isEncryptionBits(8) // true * @example isEncryptionBits(4) // false (euint4 is deprecated) */ export declare function isEncryptionBits(value: unknown): value is EncryptionBits; /** * Checks if a value is a valid FheTypeId. * @example isFheTypeId(2) // true (euint8) * @example isFheTypeId(1) // false (euint4 is deprecated) */ export declare function isFheTypeId(value: unknown): value is FheTypeId; /** * Checks if a value is a valid FheTypeName. * @example isFheTypeName('euint8') // true * @example isFheTypeName('euint4') // false (deprecated) */ export declare function isFheTypeName(value: unknown): value is FheTypeName; export declare interface KeypairType { publicKey: T; privateKey: T; } export declare type KmsDelegatedUserDecryptEIP712MessageType = Prettify< KmsUserDecryptEIP712MessageType & { readonly delegatorAddress: ChecksummedAddress; } >; export declare type KmsDelegatedUserDecryptEIP712Type = Readonly<{ types: KmsDelegatedUserDecryptEIP712TypesType; primaryType: 'DelegatedUserDecryptRequestVerification'; domain: KmsEIP712DomainType; message: KmsDelegatedUserDecryptEIP712MessageType; }>; export declare type KmsDelegatedUserDecryptEIP712TypesType = { readonly EIP712Domain: readonly [ { readonly name: 'name'; readonly type: 'string' }, { readonly name: 'version'; readonly type: 'string' }, { readonly name: 'chainId'; readonly type: 'uint256' }, { readonly name: 'verifyingContract'; readonly type: 'address' }, ]; readonly DelegatedUserDecryptRequestVerification: readonly [ { readonly name: 'publicKey'; readonly type: 'bytes' }, { readonly name: 'contractAddresses'; readonly type: 'address[]' }, { readonly name: 'delegatorAddress'; readonly type: 'address' }, { readonly name: 'startTimestamp'; readonly type: 'uint256' }, { readonly name: 'durationDays'; readonly type: 'uint256' }, { readonly name: 'extraData'; readonly type: 'bytes' }, ]; }; export declare type KmsDelegatedUserDecryptEIP712UserArgsType = Prettify< KmsUserDecryptEIP712UserArgsType & { readonly delegatorAddress: string; } >; export declare class KmsEIP712 { #private; readonly domain: KmsEIP712DomainType; constructor(params: { chainId: bigint; verifyingContractAddressDecryption: string; }); get chainId(): bigint; get verifyingContractAddressDecryption(): ChecksummedAddress; createUserDecryptEIP712({ publicKey, contractAddresses, startTimestamp, durationDays, extraData, }: KmsUserDecryptEIP712UserArgsType): KmsUserDecryptEIP712Type; createDelegatedUserDecryptEIP712({ publicKey, contractAddresses, delegatorAddress, startTimestamp, durationDays, extraData, }: KmsDelegatedUserDecryptEIP712UserArgsType): KmsDelegatedUserDecryptEIP712Type; createPublicDecryptEIP712({ ctHandles, decryptedResult, extraData, }: KmsPublicDecryptEIP712UserArgsType): KmsPublicDecryptEIP712Type; verifyPublicDecrypt({ signatures, message, }: { signatures: readonly Bytes65Hex[]; message: KmsPublicDecryptEIP712UserArgsType; }): ChecksummedAddress[]; verifyUserDecrypt(signatures: Bytes65Hex[], message: KmsUserDecryptEIP712UserArgsType): ChecksummedAddress[]; verifyDelegatedUserDecrypt(signatures: Bytes65Hex[], message: KmsDelegatedUserDecryptEIP712UserArgsType): ChecksummedAddress[]; } export declare type KmsEIP712DomainType = Readonly<{ name: 'Decryption'; version: '1'; chainId: bigint; verifyingContract: ChecksummedAddress; }>; export declare type KmsEIP712Params = Readonly<{ chainId: bigint; verifyingContractAddressDecryption: ChecksummedAddress; }>; export declare type KmsPublicDecryptEIP712MessageType = Readonly<{ ctHandles: readonly Bytes32Hex[]; decryptedResult: BytesHex; extraData: BytesHex; }>; export declare type KmsPublicDecryptEIP712Type = Readonly< Prettify<{ types: KmsPublicDecryptEIP712TypesType; primaryType: 'PublicDecryptVerification'; domain: KmsEIP712DomainType; message: KmsPublicDecryptEIP712MessageType; }> >; export declare type KmsPublicDecryptEIP712TypesType = { readonly EIP712Domain: readonly [ { readonly name: 'name'; readonly type: 'string' }, { readonly name: 'version'; readonly type: 'string' }, { readonly name: 'chainId'; readonly type: 'uint256' }, { readonly name: 'verifyingContract'; readonly type: 'address' }, ]; readonly PublicDecryptVerification: readonly [ { readonly name: 'ctHandles'; readonly type: 'bytes32[]' }, { readonly name: 'decryptedResult'; readonly type: 'bytes' }, { readonly name: 'extraData'; readonly type: 'bytes' }, ]; }; export declare type KmsPublicDecryptEIP712UserArgsType = Readonly<{ ctHandles: readonly Bytes32Hex[]; decryptedResult: BytesHex; extraData: BytesHex; }>; export declare class KmsSignersVerifier implements IKmsSignersVerifier { #private; private constructor(); static fromAddresses(params: IKmsSignersVerifier): KmsSignersVerifier; static fromProvider(params: Prettify<{ readonly kmsVerifierContractAddress: ChecksummedAddress; readonly provider: ethers.Provider; readonly batchRpcCalls?: boolean; } & IKmsEIP712>): Promise; get count(): number; get kmsSigners(): readonly ChecksummedAddress[]; get threshold(): number; get chainId(): bigint; get verifyingContractAddressDecryption(): ChecksummedAddress; private _isThresholdReached; verifyPublicDecrypt(params: { readonly orderedHandles: readonly FhevmHandle[]; readonly orderedDecryptedResult: BytesHex; readonly signatures: readonly Bytes65Hex[]; readonly extraData: BytesHex; }): void; verifyAndComputePublicDecryptionProof(params: { readonly orderedHandles: readonly FhevmHandle[]; readonly orderedDecryptedResult: BytesHex; readonly signatures: readonly Bytes65Hex[]; readonly extraData: BytesHex; }): PublicDecryptionProof; private _verifyPublicDecrypt; } export declare type KmsUserDecryptEIP712MessageType = Readonly<{ publicKey: BytesHex; contractAddresses: readonly ChecksummedAddress[]; startTimestamp: string; durationDays: string; extraData: BytesHex; }>; export declare type KmsUserDecryptEIP712Type = Readonly< Prettify<{ types: KmsUserDecryptEIP712TypesType; primaryType: 'UserDecryptRequestVerification'; domain: KmsEIP712DomainType; message: KmsUserDecryptEIP712MessageType; }> >; export declare type KmsUserDecryptEIP712TypesType = { readonly EIP712Domain: readonly [ { readonly name: 'name'; readonly type: 'string' }, { readonly name: 'version'; readonly type: 'string' }, { readonly name: 'chainId'; readonly type: 'uint256' }, { readonly name: 'verifyingContract'; readonly type: 'address' }, ]; readonly UserDecryptRequestVerification: readonly [ { readonly name: 'publicKey'; readonly type: 'bytes' }, { readonly name: 'contractAddresses'; readonly type: 'address[]' }, { readonly name: 'startTimestamp'; readonly type: 'uint256' }, { readonly name: 'durationDays'; readonly type: 'uint256' }, { readonly name: 'extraData'; readonly type: 'bytes' }, ]; }; export declare type KmsUserDecryptEIP712UserArgsType = Readonly<{ publicKey: | string | Uint8Array | KeypairType | KeypairType; contractAddresses: readonly string[]; startTimestamp: number; durationDays: number; extraData: BytesHex; }>; export declare class KMSVerifier { #private; private constructor(); get address(): ChecksummedAddress; get eip712Domain(): KmsEIP712DomainType; get gatewayChainId(): bigint; get kmsSigners(): ChecksummedAddress[]; get kmsSignerThreshold(): number; get verifyingContractAddressDecryption(): ChecksummedAddress; static loadFromChain(params: { kmsContractAddress: ChecksummedAddress; provider: Provider; batchRpcCalls?: boolean; }): Promise; } export declare const MainnetConfig: Omit; export declare const MainnetConfigV1: Omit; export declare const MainnetConfigV2: Omit; export declare type NonEmptyExtract = Extract extends never ? { error: 'Extract produced never - no matching types found' } : Extract; export declare type PartialWithUndefined = { [P in keyof T]?: T[P] | undefined; }; /** * Utility type that flattens intersection types for better IDE display. */ export declare type Prettify = { [K in keyof T]: T[K]; } & {}; export declare interface ProvenCompactCiphertextListStaticWasmType { constructor: { name: string }; safe_deserialize( buffer: Uint8Array, serialized_size_limit: bigint, ): ProvenCompactCiphertextListWasmType; } export declare interface ProvenCompactCiphertextListWasmType { constructor: { name: string }; safe_serialize(serialized_size_limit: bigint): Uint8Array; get_kind_of(index: number): unknown; is_empty(): boolean; len(): number; } export declare class PublicDecryptionProof { #private; private constructor(); get proof(): BytesHex; get orderedHandles(): readonly FhevmHandle[]; get orderedClearValues(): readonly ClearValueType[]; get orderedAbiEncodedClearValues(): BytesHex; get extraData(): BytesHex; static from({ orderedHandles, orderedDecryptedResult, signatures, extraData, }: { readonly orderedHandles: readonly FhevmHandle[]; readonly orderedDecryptedResult: BytesHex; readonly signatures: readonly Bytes65Hex[]; readonly extraData: BytesHex; }): PublicDecryptionProof; private _abiEncodeOrderedClearValues; toPublicDecryptResults(): PublicDecryptResults; } export declare type PublicDecryptResults = Readonly<{ clearValues: ClearValues; abiEncodedClearValues: `0x${string}`; decryptionProof: `0x${string}`; }>; export declare type PublicParams = { 2048: { publicParams: T; publicParamsId: string }; }; export declare type RelayerApiError400NoDetailsType = { label: | 'malformed_json' | 'request_error' | 'not_ready_for_decryption' | 'not_allowed_on_host_acl'; message: string; }; export declare type RelayerApiError400Type = | RelayerApiError400NoDetailsType | RelayerApiError400WithDetailsType; export declare type RelayerApiError400WithDetailsType = { label: 'missing_fields' | 'validation_failed'; message: string; details: RelayerErrorDetailType[]; }; export declare type RelayerApiError401Type = { label: 'unauthorized'; message: string; }; export declare type RelayerApiError404Type = { label: 'not_found'; message: string; details: RelayerErrorDetailType[]; }; export declare type RelayerApiError429Type = { label: 'rate_limited' | 'protocol_overload'; message: string; }; export declare type RelayerApiError500Type = { label: 'internal_server_error'; message: string; }; export declare type RelayerApiError503Type = { label: | 'protocol_paused' | 'insufficient_balance' | 'insufficient_allowance' | 'gateway_not_reachable' | 'readiness_check_timed_out' | 'response_timed_out'; message: string; }; export declare type RelayerApiErrorType = | RelayerApiError400Type | RelayerApiError401Type | RelayerApiError404Type | RelayerApiError429Type | RelayerApiError500Type | RelayerApiError503Type; export declare type RelayerDelegatedUserDecryptPayload = { handleContractPairs: HandleContractPairRelayer[]; // Hex encoded uint256 string without prefix contractsChainId: string; // List of hex encoded addresses with 0x prefix contractAddresses: Array<`0x${string}`>; // Hex encoded address with 0x prefix. delegatorAddress: `0x${string}`; // Hex encoded address with 0x prefix. delegateAddress: `0x${string}`; // Number as a string startTimestamp: string; // Number as a string durationDays: string; // Hex encoded signature without 0x prefix. signature: string; // Hex encoded key without 0x prefix. publicKey: string; // Hex encoded bytes with 0x prefix. Default: 0x00 extraData: `0x${string}`; }; export declare class RelayerDuplicateCoprocessorSignerError extends RelayerErrorBase { constructor(params: RelayerDuplicateCoprocessorSignerErrorParams); } export declare type RelayerDuplicateCoprocessorSignerErrorParams = { duplicateAddress: string; }; export declare class RelayerDuplicateKmsSignerError extends RelayerErrorBase { constructor(params: RelayerDuplicateKmsSignerErrorParams); } export declare type RelayerDuplicateKmsSignerErrorParams = { duplicateAddress: string; }; export declare type RelayerEncryptedInput = { addBool: (value: boolean | number | bigint) => RelayerEncryptedInput; add8: (value: number | bigint) => RelayerEncryptedInput; add16: (value: number | bigint) => RelayerEncryptedInput; add32: (value: number | bigint) => RelayerEncryptedInput; add64: (value: number | bigint) => RelayerEncryptedInput; add128: (value: number | bigint) => RelayerEncryptedInput; add256: (value: number | bigint) => RelayerEncryptedInput; addAddress: (value: string) => RelayerEncryptedInput; getBits: () => EncryptionBits[]; generateZKProof(): { readonly chainId: bigint; readonly aclContractAddress: `0x${string}`; readonly contractAddress: `0x${string}`; readonly userAddress: `0x${string}`; readonly ciphertextWithZKProof: Uint8Array | string; readonly encryptionBits: readonly EncryptionBits[]; }; encrypt: (options?: RelayerInputProofOptionsType) => Promise<{ handles: Uint8Array[]; inputProof: Uint8Array; }>; }; export declare abstract class RelayerErrorBase extends Error { name: string; private _details; private _docsPath; private _docsUrl; private _version; private static readonly VERSION; private static readonly DEFAULT_DOCS_BASE_URL; private static readonly FULL_VERSION; constructor(params: RelayerErrorBaseParams); get docsPath(): string | undefined; get docsUrl(): string | undefined; get details(): string | undefined; get version(): string; } export declare type RelayerErrorBaseParams = { cause?: RelayerErrorBase | Error | undefined; message: string; docsBaseUrl?: string | undefined; docsPath?: string | undefined; docsSlug?: string | undefined; metaMessages?: string[] | undefined; details?: string | undefined; name?: string | undefined; }; export declare type RelayerErrorDetailType = { field: string; issue: string; }; export declare type RelayerFailureStatus = 400 | 401 | 404 | 429 | 500 | 503; export declare class RelayerFetchError extends RelayerProviderError { constructor({ operation, cause, }: { operation: RelayerOperation; cause: RelayerErrorBase | Error; }); } export declare type RelayerFetchMethod = 'GET' | 'POST'; export declare class RelayerGetKeyUrlError extends RelayerProviderError { constructor({ cause }: { cause: RelayerErrorBase | Error; }); } export declare class RelayerGetKeyUrlInvalidResponseError extends RelayerGetKeyUrlError { constructor({ cause }: { cause: RelayerErrorBase | Error; }); } export declare type RelayerGetOperation = 'KEY_URL'; declare type RelayerGetResponseKeyUrlSnakeCase = { response: { fhe_key_info: RelayerKeyInfoSnakeCase[]; crs: Record; }; }; export declare type RelayerInputProofOptionsType = Prettify< FhevmInstanceOptions & { signal?: AbortSignal; timeout?: number; onProgress?: (args: RelayerInputProofProgressArgs) => void; } >; export declare type RelayerInputProofPayload = { // Hex encoded uint256 string without prefix contractChainId: `0x${string}`; // Hex encoded address with 0x prefix. contractAddress: `0x${string}`; // Hex encoded address with 0x prefix. userAddress: `0x${string}`; // List of hex encoded binary proof without 0x prefix ciphertextWithInputVerification: string; // Hex encoded bytes with 0x prefix. Default: 0x00 extraData: `0x${string}`; }; export declare type RelayerInputProofProgressArgs = RelayerProgressArgsType<'INPUT_PROOF'>; export declare type RelayerInputProofResult = { // Ordered List of hex encoded handles with 0x prefix. handles: Bytes32Hex[]; // Attestation signatures for Input verification for the ordered list of handles with 0x prefix. signatures: BytesHex[]; }; export declare class RelayerInvalidProofError extends RelayerErrorBase { constructor(params: RelayerInvalidProofErrorParams); } export declare type RelayerInvalidProofErrorParams = { message: string; }; declare type RelayerKeyDataSnakeCase = { data_id: string; urls: string[] }; declare type RelayerKeyInfoSnakeCase = { fhe_public_key: RelayerKeyDataSnakeCase; }; export declare type RelayerOperation = RelayerPostOperation | RelayerGetOperation; export declare type RelayerPostOperation = keyof RelayerPostOperationResultMap; export declare type RelayerPostOperationResult = | RelayerPostOperationResultMap['INPUT_PROOF'] | RelayerPostOperationResultMap['PUBLIC_DECRYPT'] | RelayerPostOperationResultMap['USER_DECRYPT']; export declare interface RelayerPostOperationResultMap { INPUT_PROOF: RelayerInputProofResult; PUBLIC_DECRYPT: RelayerPublicDecryptResult; USER_DECRYPT: RelayerUserDecryptResult; DELEGATED_USER_DECRYPT: RelayerUserDecryptResult; } export declare type RelayerProgressAbortType = Prettify< RelayerProgressBaseType<'abort', O> >; export declare type RelayerProgressArgsType = | RelayerProgressQueuedType | RelayerProgressThrottledType | RelayerProgressSucceededType | RelayerProgressTimeoutType | RelayerProgressAbortType | RelayerProgressFailedType; export declare type RelayerProgressBaseType< T extends RelayerProgressTypeValue, O extends RelayerPostOperation, > = { type: T; url: string; method?: 'POST' | 'GET'; operation: O; jobId?: string | undefined; retryCount: number; totalSteps: number; step: number; }; export declare type RelayerProgressFailedType< O extends RelayerPostOperation, S extends RelayerFailureStatus = RelayerFailureStatus, > = Prettify< RelayerProgressStatusBaseType<'failed', O, S> & { elapsed: number; relayerApiError: RelayerApiErrorType; } >; export declare type RelayerProgressJobIdBaseType< T extends RelayerProgressTypeValue, O extends RelayerPostOperation, S extends RelayerSuccessStatus | RelayerFailureStatus, > = Prettify< RelayerProgressStatusBaseType & { jobId: string; } >; export declare type RelayerProgressQueuedType = Prettify< RelayerProgressJobIdBaseType<'queued', O, 202> & { requestId: string; retryAfterMs: number; elapsed: number; } >; export declare type RelayerProgressStatusBaseType< T extends RelayerProgressTypeValue, O extends RelayerPostOperation, S extends RelayerSuccessStatus | RelayerFailureStatus, > = Prettify< RelayerProgressBaseType & { method: 'POST' | 'GET'; status: S; } >; export declare type RelayerProgressSucceededType = Prettify< RelayerProgressJobIdBaseType<'succeeded', O, 200> & { requestId: string; elapsed: number; result: RelayerPostOperationResultMap[O]; } >; export declare type RelayerProgressThrottledType = Prettify< RelayerProgressStatusBaseType<'throttled', O, 429> & { method: 'POST'; retryAfterMs: number; elapsed: number; relayerApiError: RelayerApiError429Type; } >; export declare type RelayerProgressTimeoutType = Prettify>; export declare type RelayerProgressTypeValue = | 'abort' | 'queued' | 'failed' | 'timeout' | 'succeeded' | 'throttled'; export declare class RelayerProviderError extends RelayerErrorBase { private _operation?; constructor(params: RelayerProviderErrorParams); get operation(): RelayerOperation | undefined; } export declare type RelayerProviderErrorParams = RelayerErrorBaseParams & { operation?: RelayerOperation | undefined; }; export declare type RelayerPublicDecryptOptionsType = Prettify< FhevmInstanceOptions & { signal?: AbortSignal; timeout?: number; onProgress?: (args: RelayerPublicDecryptProgressArgs) => void; } >; export declare type RelayerPublicDecryptPayload = { ciphertextHandles: Array<`0x${string}`>; // Hex encoded bytes with 0x prefix. Default: 0x00 extraData: `0x${string}`; }; export declare type RelayerPublicDecryptProgressArgs = RelayerProgressArgsType<'PUBLIC_DECRYPT'>; export declare type RelayerPublicDecryptResult = { signatures: BytesHexNo0x[]; decryptedValue: BytesHexNo0x; extraData: BytesHex; }; export declare type RelayerSuccessStatus = 200 | 202; export declare class RelayerThresholdCoprocessorSignerError extends RelayerErrorBase { constructor(); } export declare class RelayerThresholdKmsSignerError extends RelayerErrorBase { constructor(); } export declare class RelayerTooManyHandlesError extends RelayerErrorBase { constructor(params: RelayerTooManyHandlesErrorParams); } export declare type RelayerTooManyHandlesErrorParams = { numberOfHandles: number; }; export declare class RelayerUnknownCoprocessorSignerError extends RelayerErrorBase { constructor(params: RelayerUnknownCoprocessorSignerErrorParams); } export declare type RelayerUnknownCoprocessorSignerErrorParams = { unknownAddress: string; }; export declare class RelayerUnknownKmsSignerError extends RelayerErrorBase { constructor(params: RelayerUnknownKmsSignerErrorParams); } export declare type RelayerUnknownKmsSignerErrorParams = { unknownAddress: string; }; export declare type RelayerUserDecryptOptionsType = Prettify< FhevmInstanceOptions & { signal?: AbortSignal; timeout?: number; onProgress?: (args: RelayerUserDecryptProgressArgs) => void; } >; export declare type RelayerUserDecryptPayload = { handleContractPairs: HandleContractPairRelayer[]; requestValidity: { // Number as a string startTimestamp: string; // Number as a string durationDays: string; }; // Number as a string contractsChainId: string; // List of hex encoded addresses with 0x prefix contractAddresses: Array<`0x${string}`>; // Hex encoded address with 0x prefix. userAddress: `0x${string}`; // Hex encoded signature without 0x prefix. signature: string; // Hex encoded key without 0x prefix. publicKey: string; // Hex encoded bytes with 0x prefix. Default: 0x00 extraData: `0x${string}`; }; export declare type RelayerUserDecryptProgressArgs = RelayerProgressArgsType< 'USER_DECRYPT' | 'DELEGATED_USER_DECRYPT' >; export declare type RelayerUserDecryptResult = Array<{ payload: BytesHexNo0x; signature: BytesHexNo0x; //extraData: BytesHex; }>; /** * Request was aborted. */ export declare class RelayerV2AbortError extends RelayerV2RequestErrorBase { constructor(params: RelayerV2AbortErrorParams); } export declare type RelayerV2AbortErrorParams = Prettify>; export declare type RelayerV2AsyncRequestState = { aborted: boolean; canceled: boolean; failed: boolean; fetching: boolean; running: boolean; succeeded: boolean; terminated: boolean; timeout: boolean; }; /** * If a network error occurs or JSON parsing fails. */ export declare class RelayerV2FetchError extends RelayerV2FetchErrorBase { constructor(params: RelayerV2FetchErrorParams); } export declare abstract class RelayerV2FetchErrorBase extends RelayerErrorBase { private readonly _fetchMethod; private readonly _url; private readonly _jobId; private readonly _operation; private readonly _retryCount; private readonly _elapsed; private readonly _state; constructor(params: RelayerV2FetchErrorBaseParams); get url(): string; get operation(): RelayerOperation; get fetchMethod(): 'POST' | 'GET'; get jobId(): string | undefined; get retryCount(): number; get elapsed(): number; get state(): RelayerV2AsyncRequestState; get isAbort(): boolean; } export declare type RelayerV2FetchErrorBaseParams = Prettify; export declare type RelayerV2FetchErrorParams = Prettify & { cause?: unknown; message: string; }>; export declare type RelayerV2InternalRequestErrorParams = Prettify & { message?: string; status?: number; state?: string; }>; /** * The maximum number of retries is exceeded. */ export declare class RelayerV2MaxRetryError extends RelayerV2FetchErrorBase { constructor(params: RelayerV2MaxRetryErrorParams); } export declare type RelayerV2MaxRetryErrorParams = Prettify>; export declare abstract class RelayerV2RequestErrorBase extends RelayerErrorBase { private readonly _url; private readonly _operation; private readonly _jobId?; constructor(params: RelayerV2RequestErrorBaseParams); get url(): string; get jobId(): string | undefined; get operation(): RelayerOperation; } export declare type RelayerV2RequestErrorBaseParams = Prettify; /** * Internal error */ export declare class RelayerV2RequestInternalError extends RelayerV2RequestErrorBase { private readonly _status?; private readonly _state?; constructor(params: RelayerV2InternalRequestErrorParams); get status(): number | undefined; get state(): string | undefined; } /** * If the relayer API returns an error response. */ export declare class RelayerV2ResponseApiError extends RelayerV2ResponseErrorBase { private readonly _relayerApiError; constructor(params: RelayerV2ResponseApiErrorParams); get relayerApiError(): RelayerApiErrorType; } export declare type RelayerV2ResponseApiErrorParams = Prettify & { relayerApiError: RelayerApiErrorType; }>; export declare abstract class RelayerV2ResponseErrorBase extends RelayerV2FetchErrorBase { private readonly _status; constructor(params: RelayerV2ResponseErrorBaseParams); get status(): number; } export declare type RelayerV2ResponseErrorBaseParams = Prettify; /** * The input proof is rejected. */ export declare class RelayerV2ResponseInputProofRejectedError extends RelayerV2ResponseErrorBase { constructor(params: RelayerV2ResponseInputProofRejectedErrorParams); } export declare type RelayerV2ResponseInputProofRejectedErrorParams = Prettify>; /** * When the response body does not match the expected schema. */ export declare class RelayerV2ResponseInvalidBodyError extends RelayerV2ResponseErrorBase { private readonly _bodyJson; constructor(params: RelayerV2ResponseInvalidBodyErrorParams); get bodyJson(): string; } export declare type RelayerV2ResponseInvalidBodyErrorParams = Prettify & { cause: InvalidPropertyError; bodyJson: string; }>; /** * The response status is unexpected. */ export declare class RelayerV2ResponseStatusError extends RelayerV2ResponseErrorBase { constructor(params: RelayerV2ResponseStatusErrorParams); } export declare type RelayerV2ResponseStatusErrorParams = Prettify & { state: RelayerV2AsyncRequestState; /** * Optional message provided by the relayer or an intermediary * (e.g. Cloudflare/Kong) for the unexpected status, surfaced as `Details:`. */ details?: string | undefined; }>; /** * The request cannot run (already terminated, canceled, succeeded, failed, aborted, or running). */ export declare class RelayerV2StateError extends RelayerErrorBase { private readonly _state; constructor(params: RelayerV2StateErrorParams); get state(): RelayerV2AsyncRequestState; } export declare type RelayerV2StateErrorParams = { state: RelayerV2AsyncRequestState; message: string; }; /** * The request timed out. */ export declare class RelayerV2TimeoutError extends RelayerV2RequestErrorBase { private readonly _timeoutMs; constructor(params: RelayerV2TimeoutErrorParams); get timeoutMs(): number; } export declare type RelayerV2TimeoutErrorParams = Prettify & { timeoutMs: number; }>; export declare class RelayerZKProofBuilder { #private; constructor(params: { builder: TFHEZKProofBuilder; coprocessorSigners: ChecksummedAddress[]; coprocessorSignerThreshold: number; gatewayChainId: bigint; verifyingContractAddressInputVerification: ChecksummedAddress; }); addBool(value: boolean | number | bigint): this; add8(value: number | bigint): this; add16(value: number | bigint): this; add32(value: number | bigint): this; add64(value: number | bigint): this; add128(value: number | bigint): this; add256(value: number | bigint): this; addAddress(value: string): this; getBits(): EncryptionBits[]; generateZKProof(params: { chainId: bigint; contractAddress: ChecksummedAddress; userAddress: ChecksummedAddress; aclContractAddress: ChecksummedAddress; }): ZKProofType; requestCiphertextWithZKProofVerification({ zkProof, relayerProvider, options, }: { zkProof: ZKProof; relayerProvider: AbstractRelayerProvider; options?: RelayerInputProofOptionsType | undefined; }): Promise; encrypt({ chainId, contractAddress, userAddress, aclContractAddress, relayerProvider, options, }: { chainId: bigint; contractAddress: ChecksummedAddress; userAddress: ChecksummedAddress; aclContractAddress: ChecksummedAddress; relayerProvider: AbstractRelayerProvider; options?: RelayerInputProofOptionsType | undefined; }): Promise; } export declare const SepoliaConfig: Omit; export declare const SepoliaConfigV1: Omit; export declare const SepoliaConfigV2: Omit; export declare const SERIALIZED_SIZE_LIMIT_CIPHERTEXT: bigint; export declare const SERIALIZED_SIZE_LIMIT_CRS: bigint; export declare const SERIALIZED_SIZE_LIMIT_PK: bigint; export declare type SolidityPrimitiveTypeName = 'bool' | 'uint256' | 'address'; /** * Returns the Solidity primitive type name for an FheTypeId. * Accepts loose `number` input; validates internally via `isFheTypeId`. * @example solidityPrimitiveTypeNameFromFheTypeId(0) // 'bool' * @example solidityPrimitiveTypeNameFromFheTypeId(7) // 'address' * @example solidityPrimitiveTypeNameFromFheTypeId(2) // 'uint256' */ export declare function solidityPrimitiveTypeNameFromFheTypeId(typeId: number | FheTypeId): SolidityPrimitiveTypeName; export declare type StrictEquals = [A] extends [B] ? [B] extends [A] ? true : false : false; export declare const TFHE_CRS_BITS_CAPACITY = 2048; export declare const TFHE_ZKPROOF_CIPHERTEXT_CAPACITY = 256; export declare interface TfheCompactPublicKeyStaticWasmType { constructor: { name: string }; safe_deserialize( buffer: Uint8Array, serialized_size_limit: bigint, ): TfheCompactPublicKeyWasmType; } export declare interface TfheCompactPublicKeyWasmType { safe_serialize(serialized_size_limit: bigint): Uint8Array; } export declare class TFHEError extends RelayerErrorBase { constructor({ message, cause }: { message: string; cause?: unknown; }); } /** * Parameters for fetching TFHE resources with retry support. */ export declare type TFHEFetchParams = { /** Optional fetch init options (headers, signal, etc.) */ init?: RequestInit | undefined; /** Number of retry attempts on network failure (default: 3) */ retries?: number; /** Delay in milliseconds between retries (default: 1000) */ retryDelayMs?: number; }; export declare class TFHEPkeCrs { #private; private constructor(); get srcUrl(): string | undefined; get wasmClassName(): string; supportsCapacity(capacity: number): boolean; getWasmForCapacity(capacity: C): { capacity: C; id: string; wasm: CompactPkeCrsWasmType; }; getBytesForCapacity(capacity: C): { capacity: C; id: string; bytes: Uint8Array; }; static fromWasm(params: TFHEPksCrsWasmType): TFHEPkeCrs; private static _fromWasm; static fromBytes(params: TFHEPksCrsBytesType): TFHEPkeCrs; private static _fromBytesHex; private static _fromBytes; static fetch(params: TFHEPkeCrsUrlType & TFHEFetchParams): Promise; toBytes(): TFHEPksCrsBytesType; private _toBytesHex; toJSON(): TFHEPkeCrsBytesHexType & { __type: 'TFHEPkeCrs'; }; static fromJSON(json: unknown): TFHEPkeCrs; } /** * TFHE Public Key Encryption (PKE) Common Reference String (CRS) compact data * with 0x-prefixed hex-encoded bytes representation. */ export declare type TFHEPkeCrsBytesHexType = { /** Unique identifier for the public key provided by the relayer */ id: string; /** The CRS capacity (always 2048 in the current configuration). */ capacity: number; /** 0x-prefixed hex-encoded serialized TFHE compact PKE CRS bytes */ bytesHex: BytesHex; /** Optional URL from which the CRS bytes were fetched */ srcUrl?: string | undefined; }; /** * Configuration for fetching a TFHE Public Key Encryption (PKE) Common Reference * String (CRS) from a remote URL. * * Typically obtained from the /keyurl response, which provides * the URLs for fetching the data. */ export declare type TFHEPkeCrsUrlType = { /** Unique identifier for the CRS provided by the relayer */ id: string; /** The CRS capacity (always 2048 in the current configuration). */ capacity: number; /** URL from which to fetch the CRS bytes */ srcUrl: string; }; export declare class TFHEPkeParams { #private; private constructor(); getTFHEPublicKey(): TFHEPublicKey; getTFHEPkeCrs(): TFHEPkeCrs; /** * Attempts to create a {@link TFHEPkeParams} instance from a FHEVM public key * encryption (PKE) configuration. * * - Returns undefined if fhevmPkeConfig is incomplete (missing publicKey or publicParams) * - Throws if fhevmPkeConfig is provided but contains invalid data * * @param fhevmPkeConfig - a {@link FhevmPkeConfigType} configuration object to validate and parse * @returns A new {@link TFHEPkeParams} instance, or undefined if the config is incomplete * @throws A {@link TFHEError} if the config contains invalid data */ static tryFromFhevmPkeConfig(fhevmPkeConfig: PartialWithUndefined): TFHEPkeParams | undefined; /** * Creates a {@link TFHEPkeParams} instance from a FHEVM public key encryption (PKE) configuration. * * Unlike {@link TFHEPkeParams.tryFromFhevmPkeConfig}, this method requires a complete configuration * and throws if the data is invalid. * * @param fhevmPkeConfig - a {@link FhevmPkeConfigType} configuration object * @returns A new {@link TFHEPkeParams} instance * @throws A {@link TFHEError} if the config contains invalid data * @see {@link TFHEPkeParams.tryFromFhevmPkeConfig} for a non-throwing alternative */ static fromFhevmPkeConfig(fhevmPkeConfig: FhevmPkeConfigType): TFHEPkeParams; static fromWasm(params: { publicKey: TFHEPublicKeyWasmType; pkeCrs2048: TFHEPksCrsWasmType; }): TFHEPkeParams; /** * Fetches the TFHE public key and PKE CRS from remote URLs and creates a {@link TFHEPkeParams} instance. * * @param urls - a {@link TFHEPkeUrlsType} Object containing the URLs to fetch * @returns A new {@link TFHEPkeParams} instance * @throws A {@link TFHEError} if pkeCrs capacity is not 2048 or if fetching fails */ static fetch(urls: TFHEPkeUrlsType): Promise; } /** * URL configuration for fetching TFHE PKE (Public Key Encryption) parameters. */ export declare type TFHEPkeUrlsType = { /** URL configuration for the TFHE compact public key */ publicKeyUrl: TFHEPublicKeyUrlType; /** URL configuration for the PKE CRS (Common Reference String) */ pkeCrsUrl: TFHEPkeCrsUrlType; }; /** * TFHE Public Key Encryption (PKE) Common Reference String (CRS) compact data with * raw bytes representation. */ export declare type TFHEPksCrsBytesType = { /** Unique identifier for the public key provided by the relayer */ id: string; /** The CRS capacity (always 2048 in the current configuration). */ capacity: number; /** Serialized TFHE compact PKE CRS bytes */ bytes: Uint8Array; /** Optional URL from which the CRS bytes were fetched */ srcUrl?: string | undefined; }; export declare type TFHEPksCrsWasmType = { id: string; capacity: number; wasm: CompactPkeCrsWasmType; srcUrl?: string | undefined; }; export declare class TFHEPublicKey { #private; private constructor(); get id(): string; get srcUrl(): string | undefined; get tfheCompactPublicKeyWasm(): TfheCompactPublicKeyWasmType; get wasmClassName(): string; static fromWasm(params: TFHEPublicKeyWasmType): TFHEPublicKey; private static _fromWasm; static fromBytes(params: TFHEPublicKeyBytesType): TFHEPublicKey; private static _fromBytesHex; private static _fromBytes; static fetch(params: TFHEPublicKeyUrlType & TFHEFetchParams): Promise; toBytes(): TFHEPublicKeyBytesType; private _toBytesHex; toJSON(): TFHEPublicKeyBytesHexType & { __type: 'TFHEPublicKey'; }; static fromJSON(json: unknown): TFHEPublicKey; } /** * TFHE public key data with 0x-prefixed hex-encoded bytes representation. */ export declare type TFHEPublicKeyBytesHexType = { /** Unique identifier for the public key provided by the relayer */ id: string; /** 0x-prefixed hex-encoded serialized TFHE compact public key bytes */ bytesHex: BytesHex; /** Optional URL from which the public key bytes were fetched */ srcUrl?: string | undefined; }; /** * TFHE public key data with raw bytes representation. */ export declare type TFHEPublicKeyBytesType = { /** Unique identifier for the public key provided by the relayer */ id: string; /** Serialized TFHE compact public key bytes */ bytes: Uint8Array; /** Optional URL from which the public key bytes were fetched */ srcUrl?: string | undefined; }; /** * Configuration for fetching a TFHE public key from a remote URL. * * Typically obtained from the /keyurl response, which provides * the URLs for fetching the data. */ export declare type TFHEPublicKeyUrlType = { /** Unique identifier for the public key provided by the relayer */ id: string; /** URL from which to fetch the public key bytes */ srcUrl: string; }; export declare type TFHEPublicKeyWasmType = { id: string; wasm: TfheCompactPublicKeyWasmType; srcUrl?: string | undefined; }; export declare interface TFHEType { default?: (module_or_path?: any) => Promise; TfheCompactPublicKey: TfheCompactPublicKeyStaticWasmType; CompactPkeCrs: CompactPkeCrsStaticWasmType; initThreadPool?: (num_threads: number) => Promise; init_panic_hook: () => void; CompactCiphertextList: { builder( publicKey: TfheCompactPublicKeyWasmType, ): CompactCiphertextListBuilderWasmType; }; ProvenCompactCiphertextList: ProvenCompactCiphertextListStaticWasmType; ZkComputeLoad: { Verify: unknown; Proof: unknown; }; } export declare class TFHEZKProofBuilder { #private; constructor(params: { pkeParams: TFHEPkeParams; }); get count(): number; get totalBits(): number; getBits(): EncryptionBits[]; addBool(value: unknown): this; addUint8(value: unknown): this; addUint16(value: unknown): this; addUint32(value: unknown): this; addUint64(value: unknown): this; addUint128(value: unknown): this; addUint256(value: unknown): this; addAddress(value: unknown): this; generateZKProof({ contractAddress, userAddress, aclContractAddress, chainId, }: { contractAddress: ChecksummedAddress; userAddress: ChecksummedAddress; aclContractAddress: ChecksummedAddress; chainId: Uint64; }): ZKProof; } export declare class TKMSPkeKeypair implements KeypairType { #private; private constructor(); toBytesHex(): KeypairType; toBytesHexNo0x(): KeypairType; toBytes(): KeypairType; get publicKey(): BytesHexNo0x; get privateKey(): BytesHexNo0x; static generate(): TKMSPkeKeypair; verify(): void; static from(value: unknown): TKMSPkeKeypair; toJSON(): KeypairType; } export declare interface TKMSType { default?: (module_or_path?: any) => Promise; u8vec_to_ml_kem_pke_pk(v: Uint8Array): WasmObject; u8vec_to_ml_kem_pke_sk(v: Uint8Array): WasmObject; new_client( server_addrs: WasmObject[], client_address_hex: string, fhe_parameter: string, ): WasmObject; new_server_id_addr(id: number, addr: string): WasmObject; process_user_decryption_resp_from_js( client: WasmObject, request: any, eip712_domain: any, agg_resp: any, enc_pk: WasmObject, enc_sk: WasmObject, verify: boolean, ): TypedPlaintextWasmType[]; ml_kem_pke_keygen(): WasmObject; ml_kem_pke_pk_to_u8vec(pk: WasmObject): Uint8Array; ml_kem_pke_sk_to_u8vec(sk: WasmObject): Uint8Array; ml_kem_pke_get_pk(sk: WasmObject): WasmObject; } export declare interface TypedPlaintextWasmType { bytes: Uint8Array; fhe_type: number; } /** * Unsigned integer represented as a JavaScript number or bigint. */ export declare type Uint = UintNumber | UintBigInt; /** * 128-bits Unsigned integer. */ export declare type Uint128 = UintNumber | UintBigInt; /** * 16-bits Unsigned integer. */ export declare type Uint16 = UintNumber | UintBigInt; /** * 256-bits Unsigned integer. */ export declare type Uint256 = UintNumber | UintBigInt; /** * 32-bits Unsigned integer. */ export declare type Uint32 = UintNumber | UintBigInt; /** * 64-bits Unsigned integer. */ export declare type Uint64 = UintNumber | UintBigInt; /** * 64-bits Unsigned integer represented as a JavaScript bigint. */ export declare type Uint64BigInt = UintBigInt; /** * 8-bits Unsigned integer. */ export declare type Uint8 = UintNumber | UintBigInt; /** * Unsigned integer represented as a JavaScript bigint. */ export declare type UintBigInt = bigint; /** * Unsigned integer represented as a JavaScript number. * * Note: JavaScript numbers are 64-bit floats, so this is only safe for * integers up to Number.MAX_SAFE_INTEGER (2^53 - 1). */ export declare type UintNumber = number; /** * String literal union of unsigned integer type names. */ export declare type UintTypeName = | 'Uint' | 'Uint8' | 'Uint16' | 'Uint32' | 'Uint64' | 'Uint128' | 'Uint256'; export declare type UserDecryptResults = ClearValues; export declare type ValidationResult = | { readonly ok: true; readonly value: T } | { readonly ok: false; readonly error: E }; export declare type WasmObject = object; export declare class ZKProof implements ZKProofType, ZKProofLike { #private; private constructor(); get chainId(): Uint64BigInt; get aclContractAddress(): ChecksummedAddress; get contractAddress(): ChecksummedAddress; get userAddress(): ChecksummedAddress; /** The ciphertext with ZK proof (guaranteed non-empty). */ get ciphertextWithZKProof(): Bytes; get encryptionBits(): readonly EncryptionBits[]; get fheTypeIds(): readonly FheTypeId[]; /** * Creates a ZKProof from loose input types. * Validates and normalizes all fields. * * If `ciphertextWithZKProof` is a hex string, it will be converted to a new Uint8Array. * If it is already a Uint8Array: * - By default (`copy: false`), the instance takes ownership — callers must not mutate it afterward. * - With `copy: true`, a defensive copy is made, allowing the caller to retain the original. * * @param zkProofLike - The loose input to validate and normalize (see {@link ZKProofLike}). * @param options - Optional settings. Set `options.copy` to `true` to copy the * `ciphertextWithZKProof` Uint8Array instead of taking ownership. Defaults to `false`. * @throws A {@link ZKProofError} if ciphertextWithZKProof is invalid or empty. * @throws A {@link InvalidTypeError} if any field fails validation. */ static fromComponents(zkProofLike: ZKProofLike, options?: { copy?: boolean; }): ZKProof; toJSON(): Omit & { fheTypeIds: readonly FheTypeId[]; encryptionBits: readonly EncryptionBits[]; }; } export declare class ZKProofError extends RelayerErrorBase { constructor({ message }: { message?: string; }); } export declare interface ZKProofLike { readonly chainId: bigint | number; readonly aclContractAddress: string; readonly contractAddress: string; readonly userAddress: string; readonly ciphertextWithZKProof: Uint8Array | string; readonly encryptionBits?: readonly number[]; } export declare interface ZKProofType extends ZKProofLike { readonly chainId: Uint64BigInt; readonly aclContractAddress: ChecksummedAddress; readonly contractAddress: ChecksummedAddress; readonly userAddress: ChecksummedAddress; readonly ciphertextWithZKProof: Bytes; readonly encryptionBits: readonly EncryptionBits[]; } export { }