Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 implementedEIP-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 asCLV
(Clover Wallet
),Math Wallet
,Taho
, andHalo
, do not implementEIP-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 supportEIP-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: