use miden_client::note::NoteLocation as NativeNoteLocation;
use wasm_bindgen::prelude::*;
#[derive(Clone)]
#[wasm_bindgen]
pub struct NoteLocation(NativeNoteLocation);
#[wasm_bindgen]
impl NoteLocation {
#[wasm_bindgen(js_name = "blockNum")]
pub fn block_num(&self) -> u32 {
self.0.block_num().as_u32()
}
#[wasm_bindgen(js_name = "blockNoteTreeIndex")]
pub fn block_note_tree_index(&self) -> u16 {
self.0.block_note_tree_index()
}
}
impl From<NativeNoteLocation> for NoteLocation {
fn from(native_location: NativeNoteLocation) -> Self {
NoteLocation(native_location)
}
}
impl From<&NativeNoteLocation> for NoteLocation {
fn from(native_location: &NativeNoteLocation) -> Self {
NoteLocation(native_location.clone())
}
}