pub struct NoteService<'a, N>where
N: AztecNode,{ /* private fields */ }Expand description
Service for note-related operations.
Implementations§
Source§impl<'a, N> NoteService<'a, N>where
N: AztecNode,
impl<'a, N> NoteService<'a, N>where
N: AztecNode,
pub fn new(node: &'a N, note_store: &'a NoteStore) -> NoteService<'a, N>
Sourcepub async fn get_notes(
&self,
filter: &NoteFilter,
) -> Result<Vec<StoredNote>, Error>
pub async fn get_notes( &self, filter: &NoteFilter, ) -> Result<Vec<StoredNote>, Error>
Get notes from the store matching a filter.
Sourcepub async fn sync_note_nullifiers(
&self,
contract_address: &AztecAddress,
scopes: &[AztecAddress],
anchor_block_number: u64,
) -> Result<u64, Error>
pub async fn sync_note_nullifiers( &self, contract_address: &AztecAddress, scopes: &[AztecAddress], anchor_block_number: u64, ) -> Result<u64, Error>
Sync note nullifiers for a contract.
Fetches all active notes for a contract and checks if their nullifiers have been included in the nullifier tree (i.e., the note was spent). If so, marks the note as nullified.
Batches queries for efficiency using MAX_RPC_LEN.
Sourcepub async fn validate_and_store_note(
&self,
note: &StoredNote,
scope: &AztecAddress,
) -> Result<(), Error>
pub async fn validate_and_store_note( &self, note: &StoredNote, scope: &AztecAddress, ) -> Result<(), Error>
Validate and store a note.
Validates:
- Note hash exists in the note hash tree
- Note is not already nullified
- Computes siloed hash and nullifier
Then stores the note in the NoteStore.
Auto Trait Implementations§
impl<'a, N> Freeze for NoteService<'a, N>
impl<'a, N> !RefUnwindSafe for NoteService<'a, N>
impl<'a, N> Send for NoteService<'a, N>
impl<'a, N> Sync for NoteService<'a, N>
impl<'a, N> Unpin for NoteService<'a, N>
impl<'a, N> !UnwindSafe for NoteService<'a, N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more