Closed kwebster2 closed 1 year ago
@kwebster2 Does it work if you provide other rpc providers instead or alongside walletConnectProvider
.
Some changes were made between beta.9 and beta.10 in that area where we now fall back to rpc's defined in chain configs if our one doesn't support it. Although walletConnectProvider
should support both of the chains that you use, so perhaps there is an error on our end here (do you see any info in console perhaps)?
One way or another, you can probably unblock yourself by defining custom rpc in wagmi config for now (https://wagmi.sh/react/providers/jsonRpc)
I will deep dive into this issue next week (team is currently on holiday break).
@0xAsimetriq I encountered the same problem in version 2.0.0-rc.1.
I don't think it's a problem on the walletConnectProvider
, my custom one uses the wagmi publicProvider
.
const { open } = useWeb3Modal();
Custom button to call open event, resulting in Connection Declined.
https://github.com/WalletConnect/web3modal/blob/V2/examples/react/src/pages/index.tsx There is no custom button involved that is called again after the connection is established.
@Saszr Does this happen for all the chains or only specific ones i.e. if you just configure it with Ethereum mainnet, can you replicate the issue? Public provider in wagmi is also limited on amount of chains they support. Also if you have any further info i.e. repo or errors logged in the console would appreciate if you post them here, will make it easier to pinpoint once I start investigating this.
If it is all rpc related, I will try to at least throw a useful error to make this more clear.
@0xAsimetriq I tried the following combinations: [mainnet, bsc] + publicProvider() ; [mainnet] + publicProvider() ; [mainnet, bsc] + walletConnectProvider({ projectId }) ; [mainnet] + walletConnectProvider({ projectId }); Unfortunately, there is no related error display in the console.
@kwebster2 @Saszr Found the issue, I think you can work around this via open({ route: 'Account' })
for now. Possible routes to open modal are 'Account' | 'ConnectWallet' | 'Help' | 'SelectNetwork'
and you need to manage them atm to open correct one based on users connection. (I will add handling for default when no route is provided in rc.2)
Ty for the info 👍
TODO's for myself
open
method optionsroute
option was not provided / default custom button behaviourHi @0xAsimetriq ! Thank you for the response! I'll try this workaround. And no worries - hope the team enjoys the holiday! Loving the progress on this project - v2 is looking great
When calling the
open
function, the modal displays an error showing 'Connection Declined.', despite the wagmiuseAccount
hook correctly returning the connected wallet'saddress
andisConnected
as true. If you reload the page, the hook continues to return data suggesting the wallet is connected, but upon calling theopen
function, it shows the web3modal as if no wallet is connected. At this point theuseAccount
hook returnsisConnected
as false and no longer returns the connected wallet's address.SDK Version 2.0.0-rc.1
I have a repo that reproduces the bug issue here: https://github.com/kwebster2/web3modal-bug-demo
useAccount
correctly returningisConnected
andaddress
)open
function of theuseWeb3Modal
hookuseAccount
hook is still continuing to return the correct dataExpected behavior When the wallet is connected and you call the
open
function, the modal should display the screen with the wallet details and show that the wallet is connectedScreenshots
Desktop (please complete the following information):
Additional context This error was not happening with 2.0.0-beta.9. I searched the changelog for beta.10 and rc.1 and did not immediately see anything that might cause this. I did see the fallback provider change and tried adding a fallback InfuraProvider when configuring the chains since I am currently using Görli and mumbai testnets, but that did not work.