unisat-wallet / dev-support

14 stars 11 forks source link

How to disconnect to wallet, and how to remove connected sites? #47

Open cloud6605 opened 1 week ago

cloud6605 commented 1 week ago

I'm building a dAPP and integrating unisat into it. I'm able to prompt the user to connect unisat by calling window.unisat.requestAccounts(), but there's no method to disconnect. I can remove my app's internal state and show "Disconnected", but once I try to reconnect, it does so automatically, instead of prompting the user as Metamask, for example, does everytime someone connects. So actually, the dApp is still connected, at least from the wallet POV. The closes to disconnect is removing the connected site from the Wallet extension itself by clicking on "Dapp Connected"

and removing the site, but there's no option to do so in the window.unisat object. It seems the option that needs to be exposed (whether directly through window.unisat or indirectly somehow) is the removeConnectedSite method.

cloud6605 commented 4 days ago

Unisat wallet does not provide a direct disconnection method. When the user chooses to disconnect in the dapp, the dapp should record this status and not actively connect.

As for removing connected sites, we doesn't provide this method yet. I'll write down this request and forward to our team.