ciori's avatar
ciori
ciori@nostrplebs.com
npub1hupm...nnm6
ciori's avatar
ciori 2 years ago
@Yuki Kishimoto Hi, I was trying the nostr rust crate to test the nostr connect feature where a web app is generating a qrcode with the "nostrconnect://..." url for Amber to scan and sign. So in this case I am creating the NostrConnectURI object by providing the local public key of the app (not the remote signer) and the usual relays. This goes all well as I am able to then use the Client object, the problem is that when I refresh the web page all the internal state, meaning the Client object, get lost (I am using dioxus as web framework if it can help). The thing is that during the initial "login" phase I save every important value as a String by leveraging the integration with the browser localstorage, so I am fairly certain that the Client object can be recreated, but I don't understand how. I have looked at the examples on the github repo and tried different options but I am unable to properly recreate/parse the NostrConnectURI and then the Nip46Signer. What should be the correct way to do it if I initially "logged in" with a "Direct connection initiated by the client"?
ciori's avatar
ciori 2 years ago
Ehi @Yuki Kishimoto I see you are working on the Rust Nostr library, I was playing around with it mostly for NIP46 and NIP65 stuff following the example codes on the repo and I was wondering: if I want to publish an event using the outbox model what do I need to do? Is there a method or option on the Client object to automatically publish the event on the outbox relays of the user or do I need to make sure to "client.add_relay(...)" for every outbox relay (taken from "Kind::RelayList" events) prior to sending the event?