Open SantiagoDevRel opened 4 months ago
https://github.com/AnumQ/web3-connect-metamask/blob/59a0aa75dc0064f8be86f8b2d29839470f9d112d/src/App.js#L26C9-L29C12
You can also use web3Instance.eth.requestAccounts() and this will do the same as the code u wrote above, this will popup metamask, the user will connect the address/es and it will return an array with the connected addresses/accounts
web3Instance.eth.requestAccounts()
If im not mistaken the https://github.com/AnumQ/web3-connect-metamask/blob/59a0aa75dc0064f8be86f8b2d29839470f9d112d/src/App.js#L46C7-L46C42 isn't in the API list of the web3js library but it will actually be nice to include so devs can have a web3Instance.revokePermission() instead of writing this raw RPC call, if you want you can create an issue, if not, that's completely fine.
web3Instance.revokePermission()
https://github.com/AnumQ/web3-connect-metamask/blob/59a0aa75dc0064f8be86f8b2d29839470f9d112d/src/App.js#L26C9-L29C12
You can also use
web3Instance.eth.requestAccounts()
and this will do the same as the code u wrote above, this will popup metamask, the user will connect the address/es and it will return an array with the connected addresses/accountsIf im not mistaken the https://github.com/AnumQ/web3-connect-metamask/blob/59a0aa75dc0064f8be86f8b2d29839470f9d112d/src/App.js#L46C7-L46C42 isn't in the API list of the web3js library but it will actually be nice to include so devs can have a
web3Instance.revokePermission()
instead of writing this raw RPC call, if you want you can create an issue, if not, that's completely fine.