Skip to content

[Feature]: Make account center request wallet permission if it's not the currently active one #1225

@ihorbond

Description

@ihorbond

Is your request related to a problem?

This request is inspired by #1219

Feature Description

Account Center widget shows the history of connected metamask wallets even though some of them could have been disconnected already by the user in the metamask directly and since there is no 'wallet disconnected' event we just don't know when this happens. Here's an example
image
As you can see I only have ...a42d wallet connected in metamask and have since disconnected ihor.eth yet I can select it in the Account Center.
I propose that whenever the metamask wallet is selected in the account center we send the wallet_getPermissions request first and look inside the caveats array.
image
If the wallet is not there anymore we send the wallet_requestPermissions request so that the user can select that wallet again and make it active. We can also "clean up" other wallet addresses that are still lingering in the Account Center at this time.

Alternative Solutions

Not that I'm aware of, I've looked all over Metamask docs.

Anything else?

We could also send the wallet_requestPermissions request whenever someone

  1. clicks on Add Account
    image
  2. clicks "Connect another wallet" and selects Metamask from the modal window
    image
    image

Metadata

Metadata

Labels

featureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions