import { BlockNumber } from '@aztec/foundation/branded-types'; import { Fr } from '@aztec/foundation/curves/bn254'; import { BufferReader } from '@aztec/foundation/serialize'; import { AztecAddress } from '@aztec/stdlib/aztec-address'; import { Note } from '@aztec/stdlib/note'; import { TxHash } from '@aztec/stdlib/tx'; /** * A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the * information required to use it during execution and manage its state. */ export declare class NoteDao { /** The packed content of the note, as will be returned in the getNotes oracle. */ note: Note; /** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */ contractAddress: AztecAddress; /** The owner of the note - generally the account that can spend the note. */ owner: AztecAddress; /** * The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot * since contracts typically make queries based on it. */ storageSlot: Fr; /** * The randomness injected to the note hash preimage. */ randomness: Fr; /** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */ noteNonce: Fr; /** * The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can * be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash. */ noteHash: Fr; /** * The nullifier of the note, siloed by contract address. * Note: Might be set as 0 if the note was added to PXE as nullified. */ siloedNullifier: Fr; /** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g. * when searching for txEffects. */ txHash: TxHash; /** The L2 block number in which the tx with this note was included. Used for note management while processing * reorgs.*/ l2BlockNumber: BlockNumber; /** The L2 block hash in which the tx with this note was included. Used for note management while processing * reorgs.*/ l2BlockHash: string; /** The index of the tx within the block, used for ordering notes. */ txIndexInBlock: number; /** The index of the note within the tx (based on note hash position), used for ordering notes. */ noteIndexInTx: number; constructor( /** The packed content of the note, as will be returned in the getNotes oracle. */ note: Note, /** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */ contractAddress: AztecAddress, /** The owner of the note - generally the account that can spend the note. */ owner: AztecAddress, /** * The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot * since contracts typically make queries based on it. */ storageSlot: Fr, /** * The randomness injected to the note hash preimage. */ randomness: Fr, /** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */ noteNonce: Fr, /** * The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can * be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash. */ noteHash: Fr, /** * The nullifier of the note, siloed by contract address. * Note: Might be set as 0 if the note was added to PXE as nullified. */ siloedNullifier: Fr, /** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g. * when searching for txEffects. */ txHash: TxHash, /** The L2 block number in which the tx with this note was included. Used for note management while processing * reorgs.*/ l2BlockNumber: BlockNumber, /** The L2 block hash in which the tx with this note was included. Used for note management while processing * reorgs.*/ l2BlockHash: string, /** The index of the tx within the block, used for ordering notes. */ txIndexInBlock: number, /** The index of the note within the tx (based on note hash position), used for ordering notes. */ noteIndexInTx: number); toBuffer(): Buffer; static fromBuffer(buffer: Buffer | BufferReader): NoteDao; toString(): string; static fromString(str: string): NoteDao; /** * Returns true if this note is equal to the `other` one. */ equals(other: NoteDao): boolean; /** * Returns the size in bytes of the Note Dao. * @returns - Its size in bytes. */ getSize(): number; static random({ note, contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, txIndexInBlock, noteIndexInTx }?: Partial): Promise; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9kYW8uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ub3RlL25vdGVfZGFvLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUM5RCxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxFQUFFLFlBQVksRUFBcUIsTUFBTSw2QkFBNkIsQ0FBQztBQUM5RSxPQUFPLEVBQU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