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 useSafeChainsListValidation, tokenSortConfig and privacyMode #4860

Conversation

cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented Oct 28, 2024

Explanation

This PR add three new properties to PreferencesController state:

References

Changelog

@metamask/preferences-controller

Added

  • Add useSafeChainsListValidation preference (#4860)
    • Add useSafeChainsListValidation property to the PreferencesController state (default: true)
    • Add setUseSafeChainsListValidation method to set this property
  • Add tokenSortConfig preference (#4860)
    • Add tokenSortConfig property to the PreferencesController state (default value: { key: 'tokenFiatAmount', order: 'dsc', sortCallback: 'stringNumeric' })
    • Add setTokenSortConfig method to set this property
  • Add privacyMode preference (#4860)
    • Add privacyMode property to the PreferencesController state (default value: false)
    • Add setPrivacyMode method to set this property

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@cryptodev-2s cryptodev-2s requested a review from a team as a code owner October 28, 2024 20:27
@cryptodev-2s
Copy link
Contributor Author

cryptodev-2s commented Oct 29, 2024

This change will also simplify the patch in this bump MetaMask/metamask-mobile#12055

@@ -44,6 +44,12 @@ export type EtherscanSupportedChains =
export type EtherscanSupportedHexChainId =
(typeof ETHERSCAN_SUPPORTED_CHAIN_IDS)[EtherscanSupportedChains];

type TokenSortConfig = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit.
do we need to export this type? will it be useful in the downstream.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think its required to be exported

Copy link
Contributor

@kanthesha kanthesha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@cryptodev-2s cryptodev-2s merged commit 955196c into main Oct 30, 2024
119 checks passed
@cryptodev-2s cryptodev-2s deleted the cryptodev2s/add-new-properties-and-setters-preferences-controller branch October 30, 2024 13:26
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.

3 participants