web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

Create a function `revokeAccess` that disconnects any previously connected wallets

Open AnumQ opened this issue 1 year ago • 9 comments

Create function named revokeAccess to disconnect previously connected wallet

Create a function revokeAccess that implements the following RPC call in order to disconnect any previously connected accounts:

await window.ethereum.request({
    method: "wallet_revokePermissions",
    params: [
      {
        eth_accounts: {},
      },
    ],
  });

See more details here

AnumQ avatar May 09 '24 20:05 AnumQ

good point @AnumQ ! @mconnelly8 she is one of the web3.js ambassadors :)

SantiagoDevRel avatar May 10 '24 10:05 SantiagoDevRel

We discussed this in team meeting, and agreed on : instead of supporting wallet_revokePermissions only, we should add support of list of common wallet rpc functions like: wallet_addEthereumChain , wallet_switchEthereumChain, wallet_getPermissions, wallet_requestPermissions, wallet_revokePermissions, ..etc so scope of above task is :

  • create list of RPC functions supported by major 3 wallets
  • add these either in web3 core lib or create a plugin for generic wallet supported RPCs ( functionality, documentation, unit and e2e testing )

jdevcs avatar May 28 '24 17:05 jdevcs

Thanks for the feedback @jdevcs! Do you already have somebody on the task? If not, I can look into implementation of the additional RPC functions once I am done with the Ambassador tasks 😊

AnumQ avatar May 28 '24 18:05 AnumQ

@AnumQ , sure you can start working on this. Thanks for your contributions.

jdevcs avatar May 29 '24 16:05 jdevcs

Hey @AnumQ, are you working on this?

mconnelly8 avatar Sep 09 '24 18:09 mconnelly8

Hello @mconnelly8 I would like to add this. I will need some guidance on where to start as I nearly know the codebase and how it works.

Allen-Muhani avatar Sep 17 '24 16:09 Allen-Muhani

No I am not working on it. Feel free to solve it😊

Mvh Anum

On Mon, 9 Sep 2024 at 20:19, Mike Connelly @.***> wrote:

Hey @AnumQ https://github.com/AnumQ, are you working on this?

— Reply to this email directly, view it on GitHub https://github.com/web3/web3.js/issues/7037#issuecomment-2338791765, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIHU544TA2VCSELV3PPDLDZVXRBHAVCNFSM6AAAAABHPORW5SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZYG44TCNZWGU . You are receiving this because you were mentioned.Message ID: <web3/web3. @.***>

AnumQ avatar Sep 17 '24 17:09 AnumQ

@mconnelly8 @SantiagoDevRel @AnumQ Can I have access to the repo? I can't push my code/attempt for review.

remote: Permission to web3/web3.js.git denied to Allen-Muhani. fatal: unable to access 'https://github.com/web3/web3.js.git/': The requested URL returned error: 403

Allen-Muhani avatar Sep 17 '24 19:09 Allen-Muhani

@Allen-Muhani directly pushing changes to main branch is not allowed, for contributions in web3.js lib create a feature branch and create PR.

For above issue, requirement is to create a web3.js plugin in new repo under your user in github, instead of adding in web3.js repo. https://docs.web3js.org/guides/web3_plugin_guide/#create-a-plugin

jdevcs avatar Sep 18 '24 07:09 jdevcs

Hey, we recently released a Web3.js plugin that supports all popular wallet RPC methods, so we’re closing this issue as resolved. You can find more details about the plugin here: web3-plugin-wallet-rpc.

krzysu avatar Nov 15 '24 08:11 krzysu