import { PUBLIC_DATA_TREE_HEIGHT } from '@aztec/constants'; import { Fr } from '@aztec/foundation/curves/bn254'; import { BufferReader } from '@aztec/foundation/serialize'; import { MembershipWitness, SiblingPath } from '@aztec/foundation/trees'; import { z } from 'zod'; import { PublicDataTreeLeafPreimage } from './public_data_leaf.js'; /** * Public data witness. * @remarks This allows to prove either: * - That a slot in the public data tree is empty (0 value) if it falls within the range of the leaf. * - The current value of a slot in the public data tree if it matches exactly the slot of the leaf. */ export declare class PublicDataWitness { /** * The index of the leaf in the public data tree. */ readonly index: bigint; /** * Preimage of a low leaf. All the slots in the range of the leaf are empty, and the current value of the * leaf slot is stored in the leaf. */ readonly leafPreimage: PublicDataTreeLeafPreimage; /** * Sibling path to prove membership of the leaf. */ readonly siblingPath: SiblingPath; constructor( /** * The index of the leaf in the public data tree. */ index: bigint, /** * Preimage of a low leaf. All the slots in the range of the leaf are empty, and the current value of the * leaf slot is stored in the leaf. */ leafPreimage: PublicDataTreeLeafPreimage, /** * Sibling path to prove membership of the leaf. */ siblingPath: SiblingPath); static get schema(): z.ZodEffects, z.ZodBigInt>; leafPreimage: z.ZodEffects; value: z.ZodType; }, "strip", z.ZodTypeAny, { slot: Fr; value: Fr; }, { slot: string; value: string; }>, import("./public_data_leaf.js").PublicDataTreeLeaf, { slot: string; value: string; }>; nextKey: z.ZodType; nextIndex: z.ZodPipeline, z.ZodBigInt>; }, "strip", z.ZodTypeAny, { leaf: import("./public_data_leaf.js").PublicDataTreeLeaf; nextKey: Fr; nextIndex: bigint; }, { leaf: { slot: string; value: string; }; nextKey: string; nextIndex: string | number | bigint; }>, PublicDataTreeLeafPreimage, { leaf: { slot: string; value: string; }; nextKey: string; nextIndex: string | number | bigint; }>; siblingPath: z.ZodEffects>, SiblingPath<40>, any>, SiblingPath<40>, any>; }, "strip", z.ZodTypeAny, { index: bigint; leafPreimage: PublicDataTreeLeafPreimage; siblingPath: SiblingPath<40>; }, { index: string | number | bigint; leafPreimage: { leaf: { slot: string; value: string; }; nextKey: string; nextIndex: string | number | bigint; }; siblingPath?: any; }>, PublicDataWitness, { index: string | number | bigint; leafPreimage: { leaf: { slot: string; value: string; }; nextKey: string; nextIndex: string | number | bigint; }; siblingPath?: any; }>; /** * Returns a field array representation of a public data witness. * @returns A field array representation of a public data witness. */ toFields(): Fr[]; /** * Returns a representation of the public data witness as expected by intrinsic Noir deserialization. */ toNoirRepresentation(): (string | string[])[]; toBuffer(): Buffer; /** * Returns a string representation of the TxEffect object. */ toString(): string; static random(): PublicDataWitness; withoutPreimage(): MembershipWitness; /** * Deserializes an PublicDataWitness object from a buffer. * @param buf - Buffer or BufferReader to deserialize. * @returns An instance of PublicDataWitness. */ static fromBuffer(buffer: Buffer | BufferReader): PublicDataWitness; /** * Deserializes an PublicDataWitness object from a string. * @param str - String to deserialize. * @returns An instance of PublicDataWitness. */ static fromString(str: string): PublicDataWitness; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2RhdGFfd2l0bmVzcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3RyZWVzL3B1YmxpY19kYXRhX3dpdG5lc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHVCQUF1QixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFM0QsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxZQUFZLEVBQXFCLE1BQU0sNkJBQTZCLENBQUM7QUFFOUUsT0FBTyxFQUFFLGlCQUFpQixFQUFFLFdBQVcsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRXpFLE9BQU8sRUFBRSxDQUFDLEVBQUUsTUFBTSxLQUFLLENBQUM7QUFHeEIsT0FBTyxFQUFFLDBCQUEwQixFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFbkU7Ozs7O0dBS0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