@@ -197,8 +197,8 @@ impl<'de> Deserialize<'de> for NostrConnectMethod {
197197pub enum NostrConnectRequest {
198198 /// Connect
199199 Connect {
200- /// Remote public key
201- public_key : PublicKey ,
200+ /// Remote signer public key
201+ remote_signer_public_key : PublicKey ,
202202 /// Optional secret
203203 secret : Option < String > ,
204204 } ,
@@ -243,10 +243,15 @@ impl NostrConnectRequest {
243243 pub fn from_message ( method : NostrConnectMethod , params : Vec < String > ) -> Result < Self , Error > {
244244 match method {
245245 NostrConnectMethod :: Connect => {
246- let public_key = params. first ( ) . ok_or ( Error :: InvalidRequest ) ?;
247- let public_key: PublicKey = PublicKey :: from_hex ( public_key) ?;
246+ let remote_signer_public_key: & String =
247+ params. first ( ) . ok_or ( Error :: InvalidRequest ) ?;
248+ let remote_signer_public_key: PublicKey =
249+ PublicKey :: from_hex ( remote_signer_public_key) ?;
248250 let secret: Option < String > = params. get ( 1 ) . cloned ( ) ;
249- Ok ( Self :: Connect { public_key, secret } )
251+ Ok ( Self :: Connect {
252+ remote_signer_public_key,
253+ secret,
254+ } )
250255 }
251256 NostrConnectMethod :: GetPublicKey => Ok ( Self :: GetPublicKey ) ,
252257 NostrConnectMethod :: SignEvent => {
@@ -315,8 +320,11 @@ impl NostrConnectRequest {
315320 /// Get req params
316321 pub fn params ( & self ) -> Vec < String > {
317322 match self {
318- Self :: Connect { public_key, secret } => {
319- let mut params = vec ! [ public_key. to_hex( ) ] ;
323+ Self :: Connect {
324+ remote_signer_public_key,
325+ secret,
326+ } => {
327+ let mut params = vec ! [ remote_signer_public_key. to_hex( ) ] ;
320328 if let Some ( secret) = secret {
321329 params. push ( secret. to_owned ( ) ) ;
322330 }
@@ -1190,7 +1198,7 @@ mod test {
11901198 assert_eq ! (
11911199 req,
11921200 NostrConnectRequest :: Connect {
1193- public_key : PublicKey :: from_hex(
1201+ remote_signer_public_key : PublicKey :: from_hex(
11941202 "79dff8f82963424e0bb02708a22e44b4980893e3a4be0fa3cb60a43b946764e3"
11951203 )
11961204 . unwrap( ) ,
0 commit comments