Why Nostr? What is Njump?
2024-08-18 19:42:07

ciori on Nostr: Yuki Kishimoto Hi, I was trying the nostr rust crate to test the nostr connect ...

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"?
Author Public Key
npub1hupmmajeu337x9t54lmknr8c8dxdsx430q5uytmatn8hd74vmw7s6unnm6