diff --git a/crates/nostr-sdk/examples/bot.rs b/crates/nostr-sdk/examples/bot.rs index 045ee23fa..1670f5e65 100644 --- a/crates/nostr-sdk/examples/bot.rs +++ b/crates/nostr-sdk/examples/bot.rs @@ -47,7 +47,7 @@ async fn main() -> Result<()> { .handle_notifications(|notification| async { if let RelayPoolNotification::Event { event, .. } = notification { if event.kind() == Kind::GiftWrap { - match UnwrappedGift::from_gift_wrap(&keys, &event) { + match client.unwrap_gift_wrap(&event).await { Ok(UnwrappedGift { rumor, sender }) => { if rumor.kind == Kind::PrivateDirectMessage { let content: String = match rumor.content.as_str() { diff --git a/crates/nostr-sdk/examples/client-with-opts.rs b/crates/nostr-sdk/examples/client-with-opts.rs index 9e42159c0..c42f472d0 100644 --- a/crates/nostr-sdk/examples/client-with-opts.rs +++ b/crates/nostr-sdk/examples/client-with-opts.rs @@ -49,7 +49,7 @@ async fn main() -> Result<()> { .handle_notifications(|notification| async { if let RelayPoolNotification::Event { event, .. } = notification { if event.kind() == Kind::GiftWrap { - let UnwrappedGift { rumor, .. } = nip59::extract_rumor(&my_keys, &event)?; + let UnwrappedGift { rumor, .. } = client.unwrap_gift_wrap(&event).await?; println!("Rumor: {}", rumor.as_json()); } else { println!("{:?}", event); diff --git a/crates/nostr-sdk/examples/tor.rs b/crates/nostr-sdk/examples/tor.rs index 1f898f980..fc17db4e6 100644 --- a/crates/nostr-sdk/examples/tor.rs +++ b/crates/nostr-sdk/examples/tor.rs @@ -39,7 +39,7 @@ async fn main() -> Result<()> { .handle_notifications(|notification| async { if let RelayPoolNotification::Event { event, .. } = notification { if event.kind() == Kind::GiftWrap { - let UnwrappedGift { rumor, .. } = nip59::extract_rumor(&my_keys, &event)?; + let UnwrappedGift { rumor, .. } = client.unwrap_gift_wrap(&event).await?; println!("Rumor: {}", rumor.as_json()); } else { println!("{:?}", event);