Closed meppsilon closed 1 year ago
hey @meppsilon 👋 we can do that! I'll reply back when it's done 💪
In the meantime, another way of getting the user address is using a web3Provider
instance.
Here you can check how it's initialized: https://github.com/WalletConnect/web3modal-react-native/blob/87b576179ea9876ec11f4c51f269f0fe0ca9b5d3/example/src/components/BlockchainActions.tsx#L27
And then you can do this to get the address:
const signer = web3Provider.getSigner();
const currentAddress = await signer.getAddress();
Hey @ignaciosantise,
Thanks for the tip! I will try it out.
Also, thanks for looking into implementing the address in the web3modal hook!
@meppsilon @web3modal/react-native
alpha.5 is now available, and it has the new address
prop in useWeb3Modal
💪
Hello!
I have a bit of a feature request. In my application, I'd like to have the ability to display the user's address to them after they've connected to a wallet. Currently, there isn't a clear way to retrieve the user's wallet address with the tools provided in this sdk.
So I'd like to suggest that we add
address
as one of the properties in the return object for theuseWeb3Modal()
hook.The code could look something like this:
This request is similar to one I found in Github discussions so I think it is an issue that other developers have run into.
Thanks a lot ahead of time for your help! Let me know if you need me to clarify anything.