You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use EIP-6963 for the `test-snaps` page, preventing collisions with
wallets that don't support Snaps.
Mostly re-uses the logic from `snaps-directory`, adapting it to this
repo.
Fixes#3753
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adopts EIP-6963 to discover a MetaMask provider that supports Snaps
and routes all RPC requests through it.
>
> - **Provider discovery and Snaps support**:
> - Add `hasSnapsSupport`, `getMetaMaskEIP6963Provider`, and
`getSnapsProvider` to find a MetaMask provider via EIP-6963 and verify
`wallet_getSnaps` support.
> - Update `request` base query to use the discovered provider and
assert presence before RPC calls.
> - **Type augmentations**:
> - Extend `window.ethereum` to include `setProvider`, `detected`, and
`providers`.
> - Add `WindowEventMap` entries for `eip6963:requestProvider` and
`eip6963:announceProvider`.
> - **Imports**:
> - Import EIP-6963 event types and `assert` from `@metamask/utils`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
994719c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
0 commit comments