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

Support EIP-6963: Multi Injected Provider Discovery #312

Merged
merged 51 commits into from
Jan 10, 2024
Merged

Support EIP-6963: Multi Injected Provider Discovery #312

merged 51 commits into from
Jan 10, 2024

Conversation

lochie
Copy link
Member

@lochie lochie commented Oct 25, 2023

EIP-6963: Multi Injected Provider Discovery

The biggest issue that this PR resolves is where multiple wallets try to override the window.ethereum object resulting in conflicts with one another.

This update to ConnectKit abstracts away all the new EIP-6963 wallet discovery logic into a useful useWallets Hook for easier future feature development.

Preview: https://connectkit-nextjs-git-eip-6963-avaraxyz.vercel.app/


UX Logic:

EIP-6963 enabled wallets are hoisted to the top of the discovery list, whilst legacy implementations using the window.ethereum object are left at the bottom to encourage wallets to update to the latest protocol.


TODO:

  • Remove unnecessary duplicated code and merge WalletConfigProps & WalletProps types.
    • Instead of removing these config files, we've instead just renamed the old EIP-1193 configs to be called LegacyWalletProps to continue supporting this protocol until EIP-6963 has been fully adopted.

@vercel
Copy link

vercel bot commented Oct 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
connectkit-cra ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2024 2:18am
connectkit-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2024 2:18am
connectkit-testbench ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2024 2:18am
connectkit-vite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2024 2:18am

getting this deployed on vercel is the best way to test on an in-app wallet browser (cant use localhost). using alert because there are no dev tools in these in-app browsers
@lochie
Copy link
Member Author

lochie commented Jan 10, 2024

lgtm

@lochie lochie merged commit 5f9243b into main Jan 10, 2024
6 checks passed
@lochie lochie deleted the eip-6963 branch January 10, 2024 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants