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

feat: implement EIP-6963 support #731

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

Ikari-Shinji-re
Copy link
Member

@Ikari-Shinji-re Ikari-Shinji-re commented May 16, 2024

Summary

To avoid conflicts and overrides with EVM providers, this pull request implements support for EIP-6963. Using this method, we dispatch an event to request data and instances of EVM providers. Wallets that have implemented EIP-6963 respond by dispatching another event, which includes metadata about the providers and references to their provider objects. We listen for these events to obtain the intended provider. Currently, it seems some wallets, such as CLV (Clover Wallet), Math Wallet, Taho, and Halo, do not implement EIP-6963. We can check these providers again later.

To preserve the current architecture of our wallets package, we currently perform this process for every wallet that implements EIP-6963. Later, we can modify our design to dispatch the request event once and display all wallets that respond to our request, regardless of whether we have implemented them or not. For wallets that do not support EIP-6963, we will continue to obtain their instances using the old method (EIP-1193).

https://eips.ethereum.org/EIPS/eip-6963
https://metamask.io/news/developers/how-to-implement-eip-6963-support-in-your-web-3-dapp/

How did you test this change?

Enable all providers modified in this pull request and simultaneously attempt to connect and execute a swap with them. They should function together without conflicts.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas

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.

2 participants