import { Schema } from 'effect'; import { HexString } from './binary.js'; export declare const HANDLE_VERSION = 0; export declare const handleTypes: Readonly<{ ebool: 0; euint4: 1; euint8: 2; euint16: 3; euint32: 4; euint64: 5; euint128: 6; euint160: 7; euint256: 8; ebytes64: 9; ebytes128: 10; ebytes256: 11; }>; export declare const HandleTypeName: Schema.SchemaClass<"ebool" | "euint4" | "euint8" | "euint16" | "euint32" | "euint64" | "euint128" | "euint160" | "euint256" | "ebytes64" | "ebytes128" | "ebytes256", "ebool" | "euint4" | "euint8" | "euint16" | "euint32" | "euint64" | "euint128" | "euint160" | "euint256" | "ebytes64" | "ebytes128" | "ebytes256", never>; export type HandleTypeName = typeof HandleTypeName.Type; export type HandleTypes = typeof handleTypes; export type FheType = HandleTypes[keyof HandleTypes]; export declare function isFheType(value: number): value is FheType; export declare const InputContext: Schema.Struct<{ hostChainId: typeof Schema.BigInt; aclAddress: Schema.TemplateLiteral<`0x${string}`>; userAddress: Schema.TemplateLiteral<`0x${string}`>; contractAddress: Schema.TemplateLiteral<`0x${string}`>; }>; export type InputContext = typeof InputContext.Type; export type Handle = HexString; export declare function getHandleType(handle: HexString): FheType; /** * Computes the prehandle hash for an input based on the ciphertext * * @param ciphertextPayload Note this is the different from the input which has the external handle prepended * @param indexHandle * @param handleType * @param handleVersion */ export declare function computePrehandle({ ciphertext, indexHandle, handleType, handleVersion, }: { ciphertext: Uint8Array; indexHandle: number; handleType: FheType; handleVersion: number; }): Buffer; /** * Computes the final handle for an input based on the prehandle and the input context, matches the handle generation * in Go and Solidity * * @param prehandle * @param context */ export declare function computeHandle({ prehandle, context, }: { prehandle: Uint8Array; context: InputContext; }): Buffer; export declare function hashInputContext(context: InputContext): Buffer;