web3-react
web3-react copied to clipboard
Fails first call, when calling a contract, walletconnect
Hi! I'm testing the beta version of web3-react for walletconnect.
I found an issue, when I connect my wallet for the first time and I call a smart contract (like the name of a token or any other function) the call fails and gives an error, but if I refresh the website and reconnect (just by clicking 'connect' it's connected again and doesn't require the QR code scan) and I do the call again it works fine. This only happens the first time I connect a metamask wallet using the QR code. After refreshing the website the issue goes away.
I created a small version repo for web3-react specifically for wallet connect to do some tests. https://github.com/Bright-Glitch/web3-react-walletconnect-protocol
This is related to wrong RPC inside the provider. Although the ChainId is correct but RPC is wrong. So RPC is not updated when we connect for the first time.
any update here? I faced the same problem
please check this url if it matches rpc by chainId , if not then update it again const { library } = useWeb3React(); library?.provider?.http?.connection.url this is example
