feat: add verify signer

This commit is contained in:
reya 2024-02-04 10:46:50 +07:00
parent bd2b6a3759
commit 3ba870be4b
2 changed files with 11 additions and 3 deletions

View File

@ -51,13 +51,12 @@ fn main() {
// Create nostr connection
let client = ClientBuilder::default().database(nostr_db).build();
// Add bootstrap relay
// Add some bootstrap relays
// #TODO: Add option to user config bootstrap relay
client
.add_relay("wss://nostr.mutinywallet.com")
.await
.expect("Failed to add bootstrap relay.");
// Add bootstrap relay
client
.add_relay("wss://bostr.nokotaro.com")
.await
@ -95,6 +94,7 @@ fn main() {
nostr::keys::create_keys,
nostr::keys::get_public_key,
nostr::keys::update_signer,
nostr::keys::verify_signer,
nostr::metadata::get_metadata,
nostr::event::get_event,
commands::secret::secure_save,

View File

@ -42,3 +42,11 @@ pub async fn update_signer(key: String, app_state: State<'_, AppState>) -> Resul
Ok(())
}
#[tauri::command]
pub async fn verify_signer(app_state: State<'_, AppState>) -> Result<bool, ()> {
let client = &app_state.nostr;
let status = client.signer().await.is_ok();
Ok(status)
}