Skip to content

feat: add useSafeChainsListValidation, tokenSortConfig and privacyMode#4860

Merged
cryptodev-2s merged 10 commits into
mainfrom
cryptodev2s/add-new-properties-and-setters-preferences-controller
Oct 30, 2024
Merged

feat: add useSafeChainsListValidation, tokenSortConfig and privacyMode#4860
cryptodev-2s merged 10 commits into
mainfrom
cryptodev2s/add-new-properties-and-setters-preferences-controller

Conversation

@cryptodev-2s
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

cryptodev-2s commented Oct 29, 2024

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

Comment thread packages/preferences-controller/src/PreferencesController.ts Outdated
export type EtherscanSupportedHexChainId =
(typeof ETHERSCAN_SUPPORTED_CHAIN_IDS)[EtherscanSupportedChains];

type TokenSortConfig = {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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