-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
EIP-1193 injected connectors mixes with wrong connector id's #3606
Comments
I don't have bitski wallet and enkrypt wallet. Only rainbow and metamask. |
I cannot run your demo, it throw "ProviderNotFoundError: Provider not found." on console. |
@1997roylee Pushed a change now. Can you try now ? |
@1997roylee Yep that's correct MetaMask won't get disconnected since Right now if i have I know the logic right now is based on |
thats why we hv to implement a logic to validate window.ethereum is rainbow, is enkrypt, is bitski, otherwise we wont know what's wallet u are connecting. |
@1997roylee Got it. This means i would have to create my own connector and check for is rainbow, is enkrypt, is bitski and etc ? Isn't that hard for maintenance to keep it up to date ? Can't there be a check in wagmi by seeing if rainbow |
@tmm Can you reopen this issue ? Seems like github actions closed it as "not planned" |
silly @github-actions |
Linking up reproduction source code https://github.com/magiziz/wagmi-v2-injected-reproduction/tree/main |
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 questions or comments you can create a new discussion thread. |
Describe the bug
Let's say i have my own connector metadata which includes
id
,name
andprovider
.Note: With metamask we'll use
window.ethereum.providers
, but with other connectors we would just use the normalwindow.ethereum
providerOnce we set a metadata we create our own connectors and append them in
createConfig
:With
window.ethereum
when you disconnect your wallet and refresh it might pick up some randomwindow.ethereum
providers like bitski or enkrypt when it was never connected, but with metamask it works fine since we usewindow.ethereum.providers
instead and try to find the right provider.You can test that by using
useAccount
hook and getconnector?.id
which will display the current connected connector.Link to Minimal Reproducible Example
https://wagmi-v2-injected-reproduction.vercel.app/
Steps To Reproduce
Video:
reproduce-v2.mov
Wagmi Version
2.5.7
Viem Version
2.7.9
TypeScript Version
5.2.2
Check existing issues
The text was updated successfully, but these errors were encountered: