File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
crates/nostr-sdk/examples Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ async fn main() -> Result<()> {
47
47
. handle_notifications ( |notification| async {
48
48
if let RelayPoolNotification :: Event { event, .. } = notification {
49
49
if event. kind ( ) == Kind :: GiftWrap {
50
- match UnwrappedGift :: from_gift_wrap ( & keys , & event) {
50
+ match client . unwrap_gift_wrap ( & event) . await {
51
51
Ok ( UnwrappedGift { rumor, sender } ) => {
52
52
if rumor. kind == Kind :: PrivateDirectMessage {
53
53
let content: String = match rumor. content . as_str ( ) {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ async fn main() -> Result<()> {
49
49
. handle_notifications ( |notification| async {
50
50
if let RelayPoolNotification :: Event { event, .. } = notification {
51
51
if event. kind ( ) == Kind :: GiftWrap {
52
- let UnwrappedGift { rumor, .. } = nip59 :: extract_rumor ( & my_keys , & event) ?;
52
+ let UnwrappedGift { rumor, .. } = client . unwrap_gift_wrap ( & event) . await ?;
53
53
println ! ( "Rumor: {}" , rumor. as_json( ) ) ;
54
54
} else {
55
55
println ! ( "{:?}" , event) ;
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ async fn main() -> Result<()> {
39
39
. handle_notifications ( |notification| async {
40
40
if let RelayPoolNotification :: Event { event, .. } = notification {
41
41
if event. kind ( ) == Kind :: GiftWrap {
42
- let UnwrappedGift { rumor, .. } = nip59 :: extract_rumor ( & my_keys , & event) ?;
42
+ let UnwrappedGift { rumor, .. } = client . unwrap_gift_wrap ( & event) . await ?;
43
43
println ! ( "Rumor: {}" , rumor. as_json( ) ) ;
44
44
} else {
45
45
println ! ( "{:?}" , event) ;
You can’t perform that action at this time.
0 commit comments