import { Bool, Field, Proof, ProvablePure, SelfProof, type Cache } from 'o1js'; import { BitSet } from './bit-set.js'; import { Tuple } from './tuple.js'; import { MerkleMap, MerkleMapFactory, MerkleMapWitness } from '../merkle/merkle-map.js'; import type { Query } from '../query/query.js'; export declare const MINA_MERKLE_MAP_FACTORY: MerkleMapFactory; declare const BitSetValue_base: (new (value: { field: import("o1js/dist/node/lib/field.js").Field; }) => { field: import("o1js/dist/node/lib/field.js").Field; }) & { _isStruct: true; } & ProvablePure<{ field: import("o1js/dist/node/lib/field.js").Field; }> & { toInput: (x: { field: import("o1js/dist/node/lib/field.js").Field; }) => { fields?: import("o1js/dist/node/lib/field.js").Field[] | undefined; packed?: [import("o1js/dist/node/lib/field.js").Field, number][] | undefined; }; toJSON: (x: { field: import("o1js/dist/node/lib/field.js").Field; }) => { field: string; }; fromJSON: (x: { field: string; }) => { field: import("o1js/dist/node/lib/field.js").Field; }; empty: () => { field: import("o1js/dist/node/lib/field.js").Field; }; }; declare class BitSetValue extends BitSetValue_base { static fromBitSet(bitset: BitSet): BitSetValue; } export type WitnessValue = { isLefts: BitSetValue; siblings: Tuple; root: (value: Field) => Field; }; type WitnessProps = { isLefts: BitSetValue; siblings: Tuple; }; export type WitnessValueClass = ProvablePure> & { new (props: WitnessProps): WitnessValue; readonly witnessLength: number; }; /** * @param n - length of Merkle witness, equal to a tree height minus 1. */ export declare function WitnessValueClass(n: N): WitnessValueClass; declare const PublicInput_base: (new (value: { root: import("o1js/dist/node/lib/field.js").Field; given: import("o1js/dist/node/lib/field.js").Field; }) => { root: import("o1js/dist/node/lib/field.js").Field; given: import("o1js/dist/node/lib/field.js").Field; }) & { _isStruct: true; } & ProvablePure<{ root: import("o1js/dist/node/lib/field.js").Field; given: import("o1js/dist/node/lib/field.js").Field; }> & { toInput: (x: { root: import("o1js/dist/node/lib/field.js").Field; given: import("o1js/dist/node/lib/field.js").Field; }) => { fields?: import("o1js/dist/node/lib/field.js").Field[] | undefined; packed?: [import("o1js/dist/node/lib/field.js").Field, number][] | undefined; }; toJSON: (x: { root: import("o1js/dist/node/lib/field.js").Field; given: import("o1js/dist/node/lib/field.js").Field; }) => { root: string; given: string; }; fromJSON: (x: { root: string; given: string; }) => { root: import("o1js/dist/node/lib/field.js").Field; given: import("o1js/dist/node/lib/field.js").Field; }; empty: () => { root: import("o1js/dist/node/lib/field.js").Field; given: import("o1js/dist/node/lib/field.js").Field; }; }; export declare class PublicInput extends PublicInput_base { static empty(): PublicInput; } export type ZkProgramVerificationKey = { data: string; hash: Field; }; export type GenericZkProgram = { name: string; compile: (options?: { cache?: Cache; forceRecompile?: boolean; }) => Promise<{ verificationKey: ZkProgramVerificationKey; }>; }; export type QueryProgram = { eq: (input: PublicInput, witness: WitnessValue) => Promise>; ne: (input: PublicInput, witness: WitnessValue) => Promise>; gt: (input: PublicInput, witness: WitnessValue, actual: Field) => Promise>; lt: (input: PublicInput, witness: WitnessValue, actual: Field) => Promise>; ge: (input: PublicInput, witness: WitnessValue, actual: Field) => Promise>; le: (input: PublicInput, witness: WitnessValue, actual: Field) => Promise>; and: (_: PublicInput, a: SelfProof, b: SelfProof) => Promise>; or: (_: PublicInput, a: SelfProof, b: SelfProof) => Promise>; }; declare class BackendCache { readonly cache: Map>; get(n: N): Backend | undefined; set(n: N, system: Backend): void; } export declare class BackendFactory { readonly backendCache: BackendCache; build(n: N, opts?: Partial<{ cache: Cache; forceRecompile: boolean; }>): Promise>; } export declare class Backend { readonly program: QueryProgram; readonly WitnessClass: WitnessValueClass; readonly verificationKey: ZkProgramVerificationKey; constructor(program: QueryProgram, WitnessClass: WitnessValueClass, verificationKey: ZkProgramVerificationKey); execute(map: MerkleMap, query: Query): Promise>; /** * Proves the condition based on the given tag and inputs. * * @param tag - The tag of the condition. * @param {MerkleMap} map - The merkle map. * @param {Condition} query - The condition query. * @returns {Promise>} The proof of the condition. * @throws {UnreachableCaseError} Throws an error if the tag is unknown. */ private proveCondition; fromMerkleMapWitness(input: MerkleMapWitness): WitnessValue; } export {};