mirror of
https://github.com/lumehq/lume.git
synced 2025-10-08 21:52:30 +02:00
feat: add verify signer
This commit is contained in:
@@ -51,13 +51,12 @@ fn main() {
|
|||||||
// Create nostr connection
|
// Create nostr connection
|
||||||
let client = ClientBuilder::default().database(nostr_db).build();
|
let client = ClientBuilder::default().database(nostr_db).build();
|
||||||
|
|
||||||
// Add bootstrap relay
|
// Add some bootstrap relays
|
||||||
|
// #TODO: Add option to user config bootstrap relay
|
||||||
client
|
client
|
||||||
.add_relay("wss://nostr.mutinywallet.com")
|
.add_relay("wss://nostr.mutinywallet.com")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to add bootstrap relay.");
|
.expect("Failed to add bootstrap relay.");
|
||||||
|
|
||||||
// Add bootstrap relay
|
|
||||||
client
|
client
|
||||||
.add_relay("wss://bostr.nokotaro.com")
|
.add_relay("wss://bostr.nokotaro.com")
|
||||||
.await
|
.await
|
||||||
@@ -95,6 +94,7 @@ fn main() {
|
|||||||
nostr::keys::create_keys,
|
nostr::keys::create_keys,
|
||||||
nostr::keys::get_public_key,
|
nostr::keys::get_public_key,
|
||||||
nostr::keys::update_signer,
|
nostr::keys::update_signer,
|
||||||
|
nostr::keys::verify_signer,
|
||||||
nostr::metadata::get_metadata,
|
nostr::metadata::get_metadata,
|
||||||
nostr::event::get_event,
|
nostr::event::get_event,
|
||||||
commands::secret::secure_save,
|
commands::secret::secure_save,
|
||||||
|
@@ -42,3 +42,11 @@ pub async fn update_signer(key: String, app_state: State<'_, AppState>) -> Resul
|
|||||||
|
|
||||||
Ok(())
|
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)
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user