Skip to content

Commit

Permalink
exposing further get apis on input note + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-demox committed Oct 31, 2024
1 parent 491e8ef commit 9d61058
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions crates/web-client/src/models/input_note_record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use wasm_bindgen::prelude::*;

use super::{
input_note_state::InputNoteState, note_details::NoteDetails, note_id::NoteId,
note_metadata::NoteMetadata,
note_inclusion_proof::NoteInclusionProof, note_metadata::NoteMetadata,
};

#[derive(Clone)]
Expand All @@ -25,10 +25,31 @@ impl InputNoteRecord {
}

pub fn metadata(&self) -> Option<NoteMetadata> {
match self.0.metadata() {
Some(metadata) => Some(metadata.into()),
None => None,
}
self.0.metadata().map(|metadata| metadata.into())
}

pub fn inclusion_proof(&self) -> Option<NoteInclusionProof> {
self.0.inclusion_proof().map(|proof| proof.into())
}

pub fn consumer_transaction_id(&self) -> Option<String> {
self.0.consumer_transaction_id().map(|id| id.to_string())
}

pub fn nullifier(&self) -> String {
self.0.nullifier().to_hex()
}

pub fn is_authenticated(&self) -> bool {
self.0.is_authenticated()
}

pub fn is_consumed(&self) -> bool {
self.0.is_consumed()
}

pub fn is_processing(&self) -> bool {
self.0.is_processing()
}
}

Expand Down

0 comments on commit 9d61058

Please sign in to comment.