Consensys / starknet-snap

The MetaMask Snap for Starknet
https://snaps.consensys.net/starknet
Apache License 2.0
72 stars 25 forks source link

fix: eip 6963 detection on wallet-ui #280

Closed khanti42 closed 1 week ago

khanti42 commented 2 weeks ago

Closes #286

This PR includes updates to the MetaMask detection logic and the removal of legacy MetaMask Flask support:

  1. Updates to useHasMetamask.ts:

    • Added import for EIP6963ProviderDetail and eip6963RequestProvider from @metamask/providers.
    • Updated the useEffect hook to use the new detection method (eip6963RequestProvider) for checking if MetaMask is installed.
    • Modified detectMetamask to return a Promise<EIP6963ProviderDetail | null> using the new detection method.
    • Added a fallback to the legacy detection method (detectMetamaskLegacy) to ensure compatibility.
    • Replaced the previous detectMetamask function with detectMetamaskLegacy to handle the legacy detection process.
    • Cleaned up the getProvider function by removing commented lines and refining provider detection logic.
  2. Removal of useHasMetamaskFlask.ts:

    • Deleted the file useHasMetamaskFlask.ts, which contained logic for detecting MetaMask Flask. This removal indicates that Flask-specific logic is no longer necessary due to updates in MetaMask's support for Snaps.
sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-starknet-snap'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-wallet-ui'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud