import { type Account, type Address, type Chain, type Hex, PublicClient, type Transport, type WalletClient } from 'viem'; import type { PrivateKeyAccount } from 'viem/accounts'; import { DecryptionAttestation, EncryptedDecryptionAttestation } from '../attesteddecrypt/index.js'; import { SupportedChainId } from '../chain.js'; import { EncryptionScheme, SupportedTeeType } from '../encryption/encryption.js'; import { HexString } from '../index.js'; import { type XwingKeypair } from '../lite/xwing.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 declare const SESSION_KEY_WARNING = "Inco Warning: signing this message may leak your private data, including from unrelated apps. Sign only if you fully trust this app."; 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 interface GrantSessionKeyCustomVerifierArgs { chainId: bigint; incoLiteAddress: Address; sessionVerifierContractAddress: Address; sharerWalletClient: WalletClient; sharerArgData: Hex; } export declare function grantSessionKey({ chainId, incoLiteAddress, sessionVerifierContractAddress, granteeAddress, sharerWalletClient, expiresAt, }: GrantSessionKeyArgs): Promise; export declare function grantSessionKeyCustomVerifier({ chainId, incoLiteAddress, sessionVerifierContractAddress, sharerWalletClient, sharerArgData, }: GrantSessionKeyCustomVerifierArgs): Promise; export declare function updateActiveVouchersSessionNonce(incoLiteAddress: Address, sharerWalletClient: WalletClient): Promise<`0x${string}`>; export interface SessionKeyAttestedComputeArgs { chainId: SupportedChainId; ephemeralAccount: PrivateKeyAccount; kmsQuorumClient: KmsQuorumClient; allowanceVoucherWithSig: AllowanceVoucherWithSig; lhsHandle: HexString; op: AttestedComputeOP; rhsPlaintext: bigint | boolean; requesterArgData?: Hex | undefined; backoffConfig?: Partial | undefined; ethClient: PublicClient; executorAddress: HexString; reencryptPubKey?: Uint8Array | undefined; reencryptKeypair?: XwingKeypair | undefined; } export declare function sessionKeyAttestedCompute({ lhsHandle, op, rhsPlaintext, backoffConfig, chainId, kmsQuorumClient, ephemeralAccount, allowanceVoucherWithSig, requesterArgData, ethClient, executorAddress, reencryptPubKey, reencryptKeypair, }: SessionKeyAttestedComputeArgs): Promise | EncryptedDecryptionAttestation>; export interface SessionKeyAttestedDecryptArgs { chainId: SupportedChainId; ephemeralAccount: PrivateKeyAccount; kmsQuorumClient: KmsQuorumClient; allowanceVoucherWithSig: AllowanceVoucherWithSig; handles: HexString[]; requesterArgData?: Hex | undefined; backoffConfig?: Partial | undefined; reencryptPubKey?: Uint8Array | undefined; reencryptKeypair?: XwingKeypair | undefined; ethClient: PublicClient; executorAddress: HexString; } /** * Performs attested decrypts using a voucher-backed session key. * * @example Plaintext results * ```ts * const attestations = await sessionKeyAttestedDecrypt({ * chainId, * kmsConnectRpcEndpointOrClient: covalidatorUrl, * allowanceVoucherWithSig: voucher, * ephemeralAccount, * handles, * }); * console.log(attestations[0].plaintext.value); * ``` * * @example Encrypted results * ```ts * const encryptedResults = await sessionKeyAttestedDecrypt({ * chainId, * kmsConnectRpcEndpointOrClient: covalidatorUrl, * allowanceVoucherWithSig: voucher, * ephemeralAccount, * handles, * reencryptPubKey: recipientPubKey, * }); * console.log( * encryptedResults[0].encryptedPlaintext.ciphertext.value, * ); * ``` */ export declare function sessionKeyAttestedDecrypt({ chainId, kmsQuorumClient, handles, ephemeralAccount, allowanceVoucherWithSig, requesterArgData, backoffConfig, reencryptPubKey, reencryptKeypair, ethClient, executorAddress, }: SessionKeyAttestedDecryptArgs): Promise | EncryptedDecryptionAttestation>>;