@@ -23,7 +23,7 @@ use lightning::{log_error, log_warn};
2323use nostr:: key:: SecretKey ;
2424use nostr:: nips:: nip47:: * ;
2525use nostr:: prelude:: { decrypt, encrypt} ;
26- use nostr:: { Event , EventBuilder , EventId , Filter , Keys , Kind , Tag } ;
26+ use nostr:: { Event , EventBuilder , EventId , Filter , JsonUtil , Keys , Kind , Tag } ;
2727use nostr_sdk:: { Client , RelayPoolNotification } ;
2828use std:: sync:: { atomic:: Ordering , Arc , RwLock } ;
2929use std:: time:: Duration ;
@@ -596,9 +596,17 @@ impl<S: MutinyStorage> NostrManager<S> {
596596 )
597597 . unwrap ( ) ;
598598
599- let p_tag = Tag :: PubKey ( inv. pubkey , None ) ;
600- let e_tag = Tag :: Event ( inv. event_id , None , None ) ;
601- let response = EventBuilder :: new ( Kind :: WalletConnectResponse , encrypted, & [ p_tag, e_tag] )
599+ let p_tag = Tag :: PublicKey {
600+ public_key : inv. pubkey ,
601+ relay_url : None ,
602+ alias : None ,
603+ } ;
604+ let e_tag = Tag :: Event {
605+ event_id : inv. event_id ,
606+ relay_url : None ,
607+ marker : None ,
608+ } ;
609+ let response = EventBuilder :: new ( Kind :: WalletConnectResponse , encrypted, [ p_tag, e_tag] )
602610 . to_event ( & nwc. server_key )
603611 . map_err ( |e| MutinyError :: Other ( anyhow:: anyhow!( "Failed to create event: {e:?}" ) ) ) ?;
604612
@@ -725,10 +733,18 @@ impl<S: MutinyStorage> NostrManager<S> {
725733 )
726734 . unwrap ( ) ;
727735
728- let p_tag = Tag :: PubKey ( inv. pubkey , None ) ;
729- let e_tag = Tag :: Event ( inv. event_id , None , None ) ;
736+ let p_tag = Tag :: PublicKey {
737+ public_key : inv. pubkey ,
738+ relay_url : None ,
739+ alias : None ,
740+ } ;
741+ let e_tag = Tag :: Event {
742+ event_id : inv. event_id ,
743+ relay_url : None ,
744+ marker : None ,
745+ } ;
730746 let response =
731- EventBuilder :: new ( Kind :: WalletConnectResponse , encrypted, & [ p_tag, e_tag] )
747+ EventBuilder :: new ( Kind :: WalletConnectResponse , encrypted, [ p_tag, e_tag] )
732748 . to_event ( & nwc. server_key )
733749 . map_err ( |e| {
734750 MutinyError :: Other ( anyhow:: anyhow!( "Failed to create event: {e:?}" ) )
@@ -857,13 +873,17 @@ impl<S: MutinyStorage> NostrManager<S> {
857873 } ) ,
858874 } ;
859875 let encrypted = encrypt ( & nwc. secret , & nwc. public_key , req. as_json ( ) ) ?;
860- let p_tag = Tag :: PubKey ( nwc. public_key , None ) ;
876+ let p_tag = Tag :: PublicKey {
877+ public_key : nwc. public_key ,
878+ relay_url : None ,
879+ alias : None ,
880+ } ;
861881 let request_event =
862- EventBuilder :: new ( Kind :: WalletConnectRequest , encrypted, & [ p_tag] ) . to_event ( & secret) ?;
882+ EventBuilder :: new ( Kind :: WalletConnectRequest , encrypted, [ p_tag] ) . to_event ( & secret) ?;
863883
864884 let filter = Filter :: new ( )
865885 . kind ( Kind :: WalletConnectResponse )
866- . author ( nwc. public_key . to_hex ( ) )
886+ . author ( nwc. public_key )
867887 . pubkey ( secret. public_key ( ) )
868888 . event ( request_event. id ) ;
869889
@@ -906,9 +926,9 @@ impl<S: MutinyStorage> NostrManager<S> {
906926 select ! {
907927 notification = read_fut => {
908928 match notification {
909- Ok ( RelayPoolNotification :: Event ( _url , event) ) => {
929+ Ok ( RelayPoolNotification :: Event { event, .. } ) => {
910930 let has_e_tag = event. tags. iter( ) . any( |x| {
911- if let Tag :: Event ( id, _ , _ ) = x {
931+ if let Tag :: Event { event_id : id, .. } = x {
912932 * id == request_event. id
913933 } else {
914934 false
@@ -935,7 +955,7 @@ impl<S: MutinyStorage> NostrManager<S> {
935955 }
936956 }
937957 } ,
938- Ok ( RelayPoolNotification :: Message ( _ , _ ) ) => { } , // ignore messages
958+ Ok ( RelayPoolNotification :: Message { .. } ) => { } , // ignore messages
939959 Ok ( RelayPoolNotification :: Stop ) => { } , // ignore stops
940960 Ok ( RelayPoolNotification :: RelayStatus { .. } ) => { } , // ignore status updates
941961 Ok ( RelayPoolNotification :: Shutdown ) =>
0 commit comments