walletconnect-docs icon indicating copy to clipboard operation
walletconnect-docs copied to clipboard

Missing Polkadot Dapp Docs

Open rossbulat opened this issue 1 year ago • 3 comments

Context

Referring to the Polkadot Dapp Integration Guide, we can see how to set up a connection with a Wallet Connect supported wallet, but it is not obvious how to re-connect to an already established session.

For example if I refresh or revisit my web app, there does not appear to be an API documented that allows for a reconnect to an existing session. I assume that this is possible, but is currently unknown for the Dapp developer based on this doc. If I go through the modal -> scan QR process again, I establish another connection, rather than use the previously initiated one.

We can see that wallets like Nova Wallet maintain the session in their Wallet Connect UI - I assume then that it is possible to re-establish a connection to this session.

rossbulat avatar Sep 03 '24 07:09 rossbulat

I have now implemented Wallet Connect support in the Polkadot Developer Console. This implementation may be a good resource to refer to for improving the Polkadot Dapp Integration Guide as it:

  • Caters for dynamic chain connections and the ability to re-approve an updated session.
  • Reconnecting to an existing session without approving again.
  • Implements in a React environment, uses contexts, demonstrates component hierarchy.
  • Checking expiry timestamp & disconnecting (I am unsure if sessions automatically expire).

On the flip side I have implemented this support based on the available docs, so if there are better APIs that enable UX improvements I'd definitely be interested to amend Developer Console.

Developer Console's "Connect Accounts" module hosting Wallet Connect support:

Screenshot 2024-10-04 at 09 53 07

rossbulat avatar Oct 04 '24 02:10 rossbulat

@rossbulat would you like to make a PR to our docs ?

rtomas avatar Oct 04 '24 21:10 rtomas