snaps icon indicating copy to clipboard operation
snaps copied to clipboard

Refactor `AccountSelector`

Open GuillaumeRx opened this issue 1 year ago • 4 comments

This refactors the AccountSelector:

  • the state format for this component has changed to an object with an id and address key.
  • Adds a new optional prop switchGlobalAccount that defaults to false. It allows the component to switch the global selected account of the Extension to be switched on selection of an account.
  • Adds a new optional prop hideExternalAccounts that defaults to false. It allows the component to hide the accounts that are not owned by the snap.
  • Makes selectedAccount prop optional. If it's not provided we will get the selected account in the AccountsController, if it is we will try to get the address related to this account and if it doesn't exist we will throw an error.
  • Makes the chainIds prop optional.

GuillaumeRx avatar Oct 01 '24 14:10 GuillaumeRx

Codecov Report

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

Project coverage is 94.44%. Comparing base (ecbac90) to head (17a7ea6). Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2779   +/-   ##
=======================================
  Coverage   94.43%   94.44%           
=======================================
  Files         483      483           
  Lines       10297    10310   +13     
  Branches     1568     1571    +3     
=======================================
+ Hits         9724     9737   +13     
  Misses        573      573           

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

codecov[bot] avatar Oct 01 '24 14:10 codecov[bot]

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/[email protected], npm/@types/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/@keystonehq/[email protected], npm/@keystonehq/[email protected], npm/[email protected], npm/[email protected], npm/@keystonehq/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/@metamask/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@types/[email protected], npm/@keystonehq/[email protected], npm/[email protected], npm/@ngraveio/[email protected], npm/@keystonehq/[email protected], npm/@metamask/[email protected], npm/[email protected], npm/@metamask/[email protected], npm/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected]

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

socket-security[bot] avatar Oct 02 '24 12:10 socket-security[bot]

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/[email protected] Transitive: environment, filesystem, network +53 24.4 MB metamaskbot
npm/@metamask/[email protected] Transitive: environment, filesystem, network +66 17.5 MB metamaskbot

View full report↗︎

socket-security[bot] avatar Oct 03 '24 09:10 socket-security[bot]

@SocketSecurity ignore-all these depedencies are pulled by packages we own or are packages we own

GuillaumeRx avatar Oct 03 '24 09:10 GuillaumeRx