use js_export_macro::js_export;
use miden_client::note::NoteType as NativeNoteType;
#[js_export]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum NoteType {
Private = 0,
Public = 1,
}
const _: () = {
assert!(NativeNoteType::Private as u8 == NoteType::Private as u8);
assert!(NativeNoteType::Public as u8 == NoteType::Public as u8);
};
impl From<NativeNoteType> for NoteType {
fn from(value: NativeNoteType) -> Self {
match value {
NativeNoteType::Private => NoteType::Private,
NativeNoteType::Public => NoteType::Public,
}
}
}
impl From<NoteType> for NativeNoteType {
fn from(value: NoteType) -> Self {
match value {
NoteType::Private => NativeNoteType::Private,
NoteType::Public => NativeNoteType::Public,
}
}
}