Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: WalletConnect switchChain method uses the wrong block explorer URL #3340

Closed
1 task done
chybisov opened this issue Dec 22, 2023 · 2 comments
Closed
1 task done

Comments

@chybisov
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

2.0.0-rc.0

Current Behavior

While testing the WalletConnect connector, I found an issue where if you need to switch chain it fails with this error

Uncaught (in promise) SwitchChainError: An error occurred when attempting to switch chain.

Details: {"code":-32602,"message":"Expected null or array with at least one valid string HTTPS URL 'blockExplorerUrl'. Received: [object Object]"}

image

Expected Behavior

The switch chain works as expected.

Steps To Reproduce

  1. Connect wallet via WalletConnect
  2. Select from and to chain and token (should be different from connected chain in the wallet)
  3. Start swapping/bridging
  4. Error will be thrown to the console and connected wallet with WalletConnect do nothing

Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)

https://playground.li.fi/

Anything else?

I found that here https://github.com/wevm/wagmi/blob/rc/packages/connectors/src/walletConnect.ts#L266 we are trying to provide default block explorer URL, but actually providing object {name: 'BlockExplorer', url: 'Some URL'}

@chybisov
Copy link
Contributor Author

I've provided a PR for this #3341

@tmm tmm closed this as completed Dec 22, 2023
Copy link
Contributor

github-actions bot commented Jan 6, 2024

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants