diff --git a/src/signer/nip46_client.rs b/src/signer/nip46_client.rs index 628374b..0ea98b3 100644 --- a/src/signer/nip46_client.rs +++ b/src/signer/nip46_client.rs @@ -1139,8 +1139,27 @@ impl Nip46ClientSigner { .insert(id.clone(), PendingRemoteRequest { sender }); let payload = json!({ "id": id, "method": method, "params": params }).to_string(); - self.publish_payload(&client, &keys, &conversation, &peer, &payload) + match self + .publish_payload(&client, &keys, &conversation, &peer, &payload) .await + { + Ok(accepted) => { + if live_relays(&connection.relays) { + pairing_trace(&format!( + "rpc published: method={} id={} accepted_by={}", + method, + &id[..8], + if accepted.is_empty() { + "NONE".to_string() + } else { + accepted.join(",") + } + )); + } + Ok(()) + } + Err(detail) => Err(detail), + } }; if let Err(detail) = send_result { self.inner.lock().await.remote_pending.remove(&id); @@ -1846,7 +1865,7 @@ impl Nip46ClientSigner { conversation: &ConversationKey, peer: &PublicKey, payload: &str, - ) -> Result<(), String> { + ) -> Result, String> { let content = nip44_encrypt(conversation, payload).map_err(|e| e.message().to_string())?; let tag = Tag::parse(["p", peer.to_hex().as_str()]).map_err(|e| format!("{e}"))?; let event = EventBuilder::new(Kind::NostrConnect, content) @@ -1854,11 +1873,11 @@ impl Nip46ClientSigner { .finalize_async(keys) .await .map_err(|e| format!("Could not sign: {e}"))?; - client + let output = client .send_event(&event) .await .map_err(|e| format!("{e}"))?; - Ok(()) + Ok(output.success.keys().map(|u| u.to_string()).collect()) } }