import { AuthWitness, AztecNode, CompleteAddress, MerkleTreeId, NullifierMembershipWitness, PublicDataWitness } from '@aztec/circuit-types'; import { Header } from '@aztec/circuits.js'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { NoteData, TypedOracle } from '../acvm/index.js'; import { DBOracle } from './db_oracle.js'; /** * The execution context for a client view tx simulation. * It only reads data from data sources. Nothing will be updated or created during this simulation. */ export declare class ViewDataOracle extends TypedOracle { protected readonly contractAddress: AztecAddress; /** Data required to reconstruct the block hash, it contains historical roots. */ protected readonly historicalHeader: Header; /** List of transient auth witnesses to be used during this simulation */ protected readonly authWitnesses: AuthWitness[]; protected readonly db: DBOracle; protected readonly aztecNode: AztecNode | undefined; protected log: import("@aztec/foundation/log").DebugLogger; constructor(contractAddress: AztecAddress, /** Data required to reconstruct the block hash, it contains historical roots. */ historicalHeader: Header, /** List of transient auth witnesses to be used during this simulation */ authWitnesses: AuthWitness[], db: DBOracle, aztecNode: AztecNode | undefined, log?: import("@aztec/foundation/log").DebugLogger); /** * Return the nullifier key pair of an account to use in a specific contract. * @param account - The account address of the nullifier key. */ getNullifierKeyPair(account: AztecAddress): Promise; /** * Fetches the index and sibling path of a leaf at a given block from a given tree. * @param blockNumber - The block number at which to get the membership witness. * @param treeId - Id of the tree to get the sibling path from. * @param leafValue - The leaf value * @returns The index and sibling path concatenated [index, sibling_path] */ getMembershipWitness(blockNumber: number, treeId: MerkleTreeId, leafValue: Fr): Promise; /** * Fetches a sibling path at a given block and index from a tree specified by `treeId`. * @param blockNumber - The block number at which to get the membership witness. * @param treeId - Id of the tree to get the sibling path from. * @param leafIndex - Index of the leaf to get sibling path for * @returns The sibling path. */ getSiblingPath(blockNumber: number, treeId: MerkleTreeId, leafIndex: Fr): Promise; /** * Returns a nullifier membership witness for a given nullifier at a given block. * @param blockNumber - The block number at which to get the index. * @param nullifier - Nullifier we try to find witness for. * @returns The nullifier membership witness (if found). */ getNullifierMembershipWitness(blockNumber: number, nullifier: Fr): Promise; /** * Returns a low nullifier membership witness for a given nullifier at a given block. * @param blockNumber - The block number at which to get the index. * @param nullifier - Nullifier we try to find the low nullifier witness for. * @returns The low nullifier membership witness (if found). * @remarks Low nullifier witness can be used to perform a nullifier non-inclusion proof by leveraging the "linked * list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier * we are trying to prove non-inclusion for. */ getLowNullifierMembershipWitness(blockNumber: number, nullifier: Fr): Promise; /** * Returns a public data tree witness for a given leaf slot at a given block. * @param blockNumber - The block number at which to get the index. * @param leafSlot - The slot of the public data tree to get the witness for. * @returns - The witness */ getPublicDataTreeWitness(blockNumber: number, leafSlot: Fr): Promise; /** * Fetches a block header of a given block. * @param blockNumber - The number of a block of which to get the block header. * @returns Block extracted from a block with block number `blockNumber`. */ getHeader(blockNumber: number): Promise
; /** * Retrieve the complete address associated to a given address. * @param address - Address to fetch the complete address for. * @returns A complete address associated with the input address. */ getCompleteAddress(address: AztecAddress): Promise; /** * Returns an auth witness for the given message hash. Checks on the list of transient witnesses * for this transaction first, and falls back to the local database if not found. * @param messageHash - Hash of the message to authenticate. * @returns Authentication witness for the requested message hash. */ getAuthWitness(messageHash: Fr): Promise; /** * Pops a capsule from the capsule dispenser * @returns The capsule values * @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. */ popCapsule(): Promise; /** * Gets some notes for a contract address and storage slot. * Returns a flattened array containing filtered notes. * * @remarks * Check for pending notes with matching slot. * Real notes coming from DB will have a leafIndex which * represents their index in the note hash tree. * * @param storageSlot - The storage slot. * @param numSelects - The number of valid selects in selectBy and selectValues. * @param selectBy - An array of indices of the fields to selects. * @param selectValues - The values to match. * @param selectComparators - The comparators to use to match values. * @param sortBy - An array of indices of the fields to sort. * @param sortOrder - The order of the corresponding index in sortBy. (1: DESC, 2: ASC, 0: Do nothing) * @param limit - The number of notes to retrieve per query. * @param offset - The starting index for pagination. * @returns Array of note data. */ getNotes(storageSlot: Fr, numSelects: number, selectBy: number[], selectValues: Fr[], selectComparators: number[], sortBy: number[], sortOrder: number[], limit: number, offset: number): Promise; /** * Check if a nullifier exists in the nullifier tree. * @param innerNullifier - The inner nullifier. * @returns A boolean indicating whether the nullifier exists in the tree or not. */ checkNullifierExists(innerNullifier: Fr): Promise; /** * Fetches the a message from the db, given its key. * @param msgKey - A buffer representing the message key. * @returns The l1 to l2 message data */ getL1ToL2Message(msgKey: Fr): Promise; /** * Retrieves the portal contract address associated with the given contract address. * Throws an error if the input contract address is not found or invalid. * @param contractAddress - The address of the contract whose portal address is to be fetched. * @returns The portal contract address. */ getPortalContractAddress(contractAddress: AztecAddress): Promise; /** * Read the public storage data. * @param startStorageSlot - The starting storage slot. * @param numberOfElements - Number of elements to read from the starting storage slot. */ storageRead(startStorageSlot: Fr, numberOfElements: number): Promise; } //# sourceMappingURL=view_data_oracle.d.ts.map