import { type Account, type Address, type Chain, type Hex, PublicClient, type Transport, type WalletClient } from 'viem'; import { DecryptionAttestation, EncryptedDecryptionAttestation } from '../attesteddecrypt/index.js'; import { SupportedChainId } from '../chain.js'; import { type EciesScheme, SupportedFheType } from '../encryption/encryption.js'; import { HexString } from '../index.js'; import type { Secp256k1Keypair } from '../lite/index.js'; import { BackoffConfig } from '../retry.js'; import type { AllowanceVoucher, AllowanceVoucherWithSig } from './types.js'; import { AttestedComputeOP } from '../attestedcompute/types.js'; import { KmsQuorumClient } from '../kms/quorumClient.js'; export interface Session { decrypter: Address; expiresAt: bigint; } export declare function createAllowanceVoucher(incoLiteAddress: Address, sharerWalletClient: WalletClient, verifyingContract: Address, callFunction: Hex, sharerArgData: Hex): Promise; export interface GrantSessionKeyArgs { chainId: bigint; incoLiteAddress: Address; sessionVerifierContractAddress: Address; granteeAddress: Address; sharerWalletClient: WalletClient; expiresAt: Date; } export declare function grantSessionKey({ chainId, incoLiteAddress, sessionVerifierContractAddress, granteeAddress, sharerWalletClient, expiresAt, }: GrantSessionKeyArgs): Promise; export declare function updateActiveVouchersSessionNonce(incoLiteAddress: Address, sharerWalletClient: WalletClient): Promise<`0x${string}`>; export interface SessionKeyAttestedComputeArgs { chainId: SupportedChainId; ephemeralKeypair: Secp256k1Keypair; kmsQuorumClient: KmsQuorumClient; allowanceVoucherWithSig: AllowanceVoucherWithSig; lhsHandle: HexString; op: AttestedComputeOP; rhsPlaintext: bigint | boolean; backoffConfig?: Partial | undefined; ethClient?: PublicClient | WalletClient | undefined; executorAddress?: HexString | undefined; reencryptPubKey?: Uint8Array | undefined; reencryptKeypair?: Secp256k1Keypair | undefined; } export declare function sessionKeyAttestedCompute({ lhsHandle, op, rhsPlaintext, backoffConfig, chainId, kmsQuorumClient, ephemeralKeypair, allowanceVoucherWithSig, ethClient, executorAddress, reencryptPubKey, reencryptKeypair, }: SessionKeyAttestedComputeArgs): Promise | EncryptedDecryptionAttestation>; export interface SessionKeyAttestedDecryptArgs { chainId: SupportedChainId; ephemeralKeypair: Secp256k1Keypair; kmsQuorumClient: KmsQuorumClient; allowanceVoucherWithSig: AllowanceVoucherWithSig; handles: HexString[]; backoffConfig?: Partial | undefined; reencryptPubKey?: Uint8Array | undefined; reencryptKeypair?: Secp256k1Keypair | undefined; ethClient?: PublicClient | WalletClient | undefined; executorAddress?: HexString | undefined; } /** * Performs attested decrypts using a voucher-backed session key. * * @example Plaintext results * ```ts * const attestations = await sessionKeyAttestedDecrypt({ * chainId, * kmsConnectRpcEndpointOrClient: covalidatorUrl, * allowanceVoucherWithSig: voucher, * ephemeralKeypair, * handles, * }); * console.log(attestations[0].plaintext.value); * ``` * * @example Encrypted results * ```ts * const encryptedResults = await sessionKeyAttestedDecrypt({ * chainId, * kmsConnectRpcEndpointOrClient: covalidatorUrl, * allowanceVoucherWithSig: voucher, * ephemeralKeypair, * handles, * reencryptPubKey: recipientPubKey, * }); * console.log( * encryptedResults[0].encryptedPlaintext.ciphertext.value, * ); * ``` */ export declare function sessionKeyAttestedDecrypt({ chainId, kmsQuorumClient, handles, ephemeralKeypair, allowanceVoucherWithSig, backoffConfig, reencryptPubKey, reencryptKeypair, ethClient, executorAddress, }: SessionKeyAttestedDecryptArgs): Promise | EncryptedDecryptionAttestation>>;