import type { Address } from 'viem'; import type { DecryptionAttestation, EncryptedDecryptionAttestation } from '../attesteddecrypt/types.js'; import type { EciesScheme, SupportedFheType } from '../encryption/encryption.js'; import type { AttestedComputeRequest, AttestedDecryptRequest, AttestedRevealRequest } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js'; import type { BackoffConfig } from '../retry.js'; import { type KmsClient } from './client.js'; export declare class KmsQuorumClient { private readonly kmss; private readonly threshold; private constructor(); private constructor(); /** * Creates a KmsQuorumClient from an array of URLs. * Requires signer addresses and threshold to be explicitly provided. * * @param urls - Array of KMS endpoint URLs * @param signers - Array of signer addresses, must match the length of URLs * @param threshold - Number of successful responses required (must be between 1 and urls.length) * @throws {Error} If URLs array is empty, signers length doesn't match URLs length, or threshold is invalid */ static fromUrls(urls: string[], signers: Address[], threshold: number): KmsQuorumClient; /** * Creates a KmsQuorumClient from an array of KmsClient instances. * Each KmsClient must have a signerAddress property. * * @param kmsClients - Array of KMS client instances * @param threshold - Number of successful responses required (must be between 1 and kmsClients.length) * @throws {Error} If KMS clients array is empty or threshold is invalid */ static fromKmsClients(kmsClients: KmsClient[], threshold: number): KmsQuorumClient; attestedDecrypt(request: AttestedDecryptRequest, backoffConfig?: Partial): Promise<(DecryptionAttestation | EncryptedDecryptionAttestation)[]>; attestedCompute(request: AttestedComputeRequest, backoffConfig?: Partial): Promise | EncryptedDecryptionAttestation>; attestedReveal(request: AttestedRevealRequest, backoffConfig?: Partial): Promise<(DecryptionAttestation | EncryptedDecryptionAttestation)[]>; /** * Generic method to execute a KMS operation across all clients with retry and threshold logic. * Returns results with both the response and signer address. */ private executeKmsOperationWithThreshold; /** * Collects signatures from responses and sorts them by signer address (ascending). * This is required by SignatureVerifier. */ private collectAndSortSignatures; /** * Builds a plaintext attestation from a DecryptionAttestation proto message. */ private buildPlaintextAttestation; private buildAggregatedAttestations; private buildAggregatedComputeAttestation; private verifyResponseConsistency; private verifyComputeResponseConsistency; /** * Verifies that two plaintext byte arrays are identical. */ private verifyPlaintextBytesConsistency; private verifyPlaintextConsistency; private verifyCiphertextConsistency; }