feat: use latest nostr sdk

This commit is contained in:
2024-10-23 10:16:56 +07:00
parent cc7de41bfd
commit 172566028b
21 changed files with 596 additions and 240 deletions

View File

@@ -313,8 +313,14 @@ pub async fn publish(
let builder =
EventBuilder::text_note(content, tags).pow(difficulty.unwrap_or(DEFAULT_DIFFICULTY));
// Sign event
let event = client
.sign_event_builder(builder)
.await
.map_err(|err| err.to_string())?;
// Publish
match client.send_event_builder(builder).await {
match client.send_event(event).await {
Ok(event_id) => Ok(event_id.to_hex()),
Err(err) => Err(err.to_string()),
}