WalletConnect / web3modal-react-native

Web3Modal React-Native SDK
https://web3modal.com
Apache License 2.0
44 stars 14 forks source link

[feature] Getting connected wallet metadata #92

Closed itsnyx closed 8 months ago

itsnyx commented 8 months ago

What problem does this new feature solve?

I want to get connected wallet info such as icon and name.

this was possible with previously versions via provider.

Describe the solution you'd like

adding a hook can solve this issue, or maybe there is a solution i don’t t know .

thanks.

ignaciosantise commented 8 months ago

Hey @itsnyx 👋 you can access the provider and then the session using the useAccount hook:

const {connector} = useAccount();

and then

const provider = await connector?.getProvider();
console.log(provider.session);
itsnyx commented 8 months ago

hello @ignaciosantise i've checked the provider and it was ok but somehow there were no icons for Metamask wallet i don't know where is the problem, but other metadata such as name link etc were present and ok.

thanks for the help.