AnumQ / web3-connect-metamask

Integrate web3.js in React app and connect MetaMask wallet to interact with the blockchain.
1 stars 0 forks source link

use web3 instance instead of metamask rpc #1

Open SantiagoDevRel opened 4 months ago

SantiagoDevRel commented 4 months ago

https://github.com/AnumQ/web3-connect-metamask/blob/59a0aa75dc0064f8be86f8b2d29839470f9d112d/src/App.js#L26C9-L29C12

  1. 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

  2. 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.

AnumQ commented 4 months ago
  1. Done. Link to commit
  2. Created the issue