import { MerkleTreeOptions, InputData } from "../interfaces"; import { BaseAccumulator } from "./base"; /** * Secure Merkle Tree (MT) class */ export declare class SecMerkleTree extends BaseAccumulator { private leaveHashFunc; private nodeHashFunc; private tree; private maxTreeSize; constructor(options: MerkleTreeOptions); /** * Sets the option for the MT * * @param options options for the MT * @returns returns true if successful */ setOptions(options: MerkleTreeOptions): boolean; /** * Add a new data to MT * * @param data a new data record * @returns a promise of boolean */ add(data: InputData): Promise; /** * Gets the digest of the MT which is the state * * @returns MT digest */ getDigest(): string; /** * Gets the proof for a specific data record * * @param data the data record to get proofs for * @returns a promise of proof for if the data exists otherwise it will returns null */ getProof(data: InputData): Promise; /** * Checks the validity of a proof with respect a digest and a data record * * @param digest digest of MT * @param data data to check * @param proof proof for provided data * @returns a promise which completes as true if the proof is valid otherwise false */ verify(digest: string, data: InputData, proof: any[]): Promise; /** * Checks if the data has been recorded on the MT * * @param data the data record to check * @returns true if exists */ contains(data: InputData): Promise; /** * Checks if the recorded data on MT is below capacity * * @returns true if MT is full otherwise false */ isFull(): boolean; }