Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Polkadot Dapp Docs #1699

Open
rossbulat opened this issue Sep 3, 2024 · 3 comments
Open

Missing Polkadot Dapp Docs #1699

rossbulat opened this issue Sep 3, 2024 · 3 comments

Comments

@rossbulat
Copy link

rossbulat commented Sep 3, 2024

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.

Copy link

linear bot commented Sep 3, 2024

@rossbulat rossbulat changed the title Missing Polkadot Docs: Reconnecting to already-initiated session? Missing Polkadot Dapp Docs: Reconnecting to already-initiated session? Sep 3, 2024
@rossbulat
Copy link
Author

rossbulat commented Oct 4, 2024

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 rossbulat reopened this Oct 4, 2024
@rossbulat rossbulat changed the title Missing Polkadot Dapp Docs: Reconnecting to already-initiated session? Missing Polkadot Dapp Docs Oct 4, 2024
@rtomas
Copy link
Member

rtomas commented Oct 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@rtomas @rossbulat and others