web3-react
web3-react copied to clipboard
Update activate() to return account
There are cases when you need to get an account immediately after calling activate(). For example to send the account to some storage or something else and do it without re-rendering.
activate(desiredChainIdOrChainParameters?: number | AddEthereumChainParameter): Promise<account>
I agree... I had this exact same problem when I wanted to do all of the following in the same lifecycle of the component:
- Ask the user to sign a message associated with that account
- Add the account on the backend
I am currently working around this by making another ?RPC call?
So const accounts = metaMaskConnector.provider?.request({ method: "eth_accounts" })
No updates on this?
I added this feature in my PR.