feat: detect metamask version to force upgrade #353
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.
PR Summary: Handle MetaMask Snap Upgrade Prompt
This PR introduces changes related to the
get-starknet
package, focusing on handling scenarios where the MetaMask Snap requires a minimum MetaMask version and enhancing the overall user experience with a popup notification system.This is required because the jsx support ( #350 ) is only available starting from version 12.
1. ESLint Configuration Updates
wallet.ts
:document
andwindow
to allow browser-related features.2. Package Script Update
lint:fix
script is updated:src
folder (src/*.{js,ts,tsx}
) instead of the entire project.3. MetaMaskSnap Class Enhancement
isUpgradeRequired
Method:'13.0.0'
).#getVersionNumber
Method:web3_clientVersion
and extracts the version number (e.g.,xx.yy.zz
).4. MetaMaskSnapWallet Class Updates
New
isPopupVisible
Property:Enhanced
enable
Method:document
.5. Popup Notification System
#showPopup
Method:isPopupVisible
.Summary
This PR addresses situations where MetaMask Snap users need to update their extension, providing a user-friendly experience with a pop-up notification when an upgrade is required. It also adjusts the linting rules to allow browser-specific objects like
document
andwindow
.