feat: native context menu

This commit is contained in:
reya
2024-06-17 15:31:59 +07:00
parent 843895d876
commit d01cf8319d
10 changed files with 192 additions and 280 deletions

View File

@@ -383,24 +383,6 @@ pub fn get_private_key(npub: &str) -> Result<String, String> {
}
}
#[tauri::command]
#[specta::specta]
pub fn event_to_bech32(id: &str, relays: Vec<String>) -> Result<String, ()> {
let event_id = EventId::from_hex(id).unwrap();
let event = Nip19Event::new(event_id, relays);
Ok(event.to_bech32().unwrap())
}
#[tauri::command]
#[specta::specta]
pub fn user_to_bech32(key: &str, relays: Vec<String>) -> Result<String, ()> {
let pubkey = PublicKey::from_str(key).unwrap();
let profile = Nip19Profile::new(pubkey, relays).unwrap();
Ok(profile.to_bech32().unwrap())
}
#[tauri::command]
#[specta::specta]
pub async fn verify_nip05(key: &str, nip05: &str) -> Result<bool, String> {