MetaMask / metamask-sdk

The simplest yet most secure way to connect your blockchain-based applications to millions of MetaMask Wallet users.
https://metamask.io/sdk/
Other
188 stars 115 forks source link

chore: listen for updates whenever chain id or account changes #1040

Open elefantel opened 1 month ago

elefantel commented 1 month ago

Explanation

This PR updates the MetaMaskProviderClient to listen for updates when the chainId or the selected account on the wallet is updated via the native SDK during a deeplink callback. Previously the communication was one way RN SDK -> Native SDK (fetch), this PR enables Native SDK -> RN SDK (push) via notifications.

References

Checklist

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.81%. Comparing base (e8d3319) to head (de2bba8).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1040 +/- ## ======================================= Coverage 78.81% 78.81% ======================================= Files 179 179 Lines 4120 4120 Branches 1016 1016 ======================================= Hits 3247 3247 Misses 873 873 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

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