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: add MetaMask Flask provider support for EIP-6963 #1192

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

abretonc7s
Copy link
Collaborator

@abretonc7s abretonc7s commented Jan 10, 2025

Description

This PR extends our EIP-6963 provider detection to support MetaMask Flask alongside the main MetaMask provider.

Changes Overview

  • Added support for MetaMask Flask RDNS identifier (io.metamask.flask)
  • Updated provider validation logic to check against multiple RDNS values
  • Added test coverage for Flask provider detection

Technical Implementation

  • Modified METAMASK_EIP_6369_PROVIDER_INFO.RDNS to be an array that includes both io.metamask and io.metamask.flask
  • Updated the provider validation logic in eip6963RequestProvider.ts to use includes() for RDNS checking
  • Added a new test case specifically for MetaMask Flask provider detection

Impact

This change is backwards compatible and doesn't require any migration steps. It simply adds support for detecting MetaMask Flask providers while maintaining existing functionality for regular MetaMask installations.

Note:

This is currently working when using Flask alone, there is no possibility to chose which MetaMask variant to connect to. Please disable the MetaMask extension when using Flask with the SDK.

@abretonc7s abretonc7s requested a review from a team as a code owner January 10, 2025 10:53
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.52%. Comparing base (4151089) to head (0423c4b).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1192      +/-   ##
==========================================
+ Coverage   74.40%   74.52%   +0.11%     
==========================================
  Files         181      181              
  Lines        4306     4306              
  Branches     1057     1057              
==========================================
+ Hits         3204     3209       +5     
+ Misses       1102     1097       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@abretonc7s abretonc7s merged commit f4dacaa into main Jan 10, 2025
36 checks passed
@abretonc7s abretonc7s deleted the feat/flasksupport branch January 10, 2025 12:32
@christopherferreira9 christopherferreira9 mentioned this pull request Jan 14, 2025
3 tasks
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