Skip to content

Latest commit

 

History

History
594 lines (393 loc) · 31.8 KB

File metadata and controls

594 lines (393 loc) · 31.8 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Changed

  • Bump @metamask/messenger from ^1.0.0 to ^1.2.0 (#8364, #8373, #8632)
  • Bump @metamask/base-controller from ^9.0.1 to ^9.1.0 (#8457)

Added

  • Expose missing public PreferencesController methods through its messenger (#8193)
    • The following actions are now available:
      • PreferencesController:setFeatureFlag
      • PreferencesController:setIpfsGateway
      • PreferencesController:setUseTokenDetection
      • PreferencesController:setUseNftDetection
      • PreferencesController:setDisplayNftMedia
      • PreferencesController:setSecurityAlertsEnabled
      • PreferencesController:setIsMultiAccountBalancesEnabled
      • PreferencesController:setShowTestNetworks
      • PreferencesController:setIsIpfsGatewayEnabled
      • PreferencesController:setEnableNetworkIncomingTransactions
      • PreferencesController:setShowMultiRpcModal
      • PreferencesController:setSmartTransactionsOptInStatus
      • PreferencesController:setUseTransactionSimulations
      • PreferencesController:setTokenSortConfig
      • PreferencesController:setUseSafeChainsListValidation
      • PreferencesController:setPrivacyMode
      • PreferencesController:setDismissSmartAccountSuggestionEnabled
      • PreferencesController:setSmartAccountOptIn
      • PreferencesController:setTokenNetworkFilter
    • Corresponding action types (e.g. PreferencesControllerSetFeatureFlagAction) are available as well.

Changed

  • Bump @metamask/base-controller from ^9.0.0 to ^9.0.1 (#8317)
  • Bump @metamask/messenger from ^0.3.0 to ^1.0.0 (#8317)

Removed

  • BREAKING: Remove legacy methods and state (#8115)
    • identities, lostIdentities and selectedAddress along with any associated methods and types were removed.
    • setSmartAccountOptInForAccounts was also removed as it is deprecated and not used in the clients.
  • Removed @metamask/keyring-controller and @metamask/controller-utils dependencies (#7995), (#8115)

Added

  • Add support for HYPEREVM (chain ID 0x3e7) (#7770)
    • Add HYPEREVM into constant ETHERSCAN_SUPPORTED_CHAIN_IDS
    • Update default controller state so HYPEREVM (Chain ID 0x3e7) is automatically enabled in showIncomingTransactions

Changed

  • Upgrade @metamask/utils from ^11.8.1 to ^11.9.0 (#7511)
  • Move peer dependencies for controller and service packages to direct dependencies (#7209, #7713)
    • The dependencies moved are:
      • @metamask/keyring-controller (^25.1.0)
    • In clients, it is now possible for multiple versions of these packages to exist in the dependency tree.
      • For example, this scenario would be valid: a client relies on @metamask/controller-a 1.0.0 and @metamask/controller-b 1.0.0, and @metamask/controller-b depends on @metamask/controller-a 1.1.0.
    • Note, however, that the versions specified in the client's package.json always "win", and you are expected to keep them up to date so as not to break controller and service intercommunication.
  • Bump @metamask/controller-utils from ^11.16.0 to ^11.18.0 (#7534, #7583)

Changed

  • Bump @metamask/controller-utils from ^11.15.0 to ^11.16.0 (#7202)
  • BREAKING: Bump @metamask/keyring-controller from ^24.0.0 to ^25.0.0 (#7202)

Changed

  • BREAKING: Use new Messenger from @metamask/messenger (#6534)
    • Previously, PreferencesController accepted a RestrictedMessenger instance from @metamask/base-controller.
  • BREAKING: Metadata property anonymous renamed to includeInDebugSnapshot (#6534)
  • BREAKING: Bump @metamask/keyring-controller from ^23.0.0 to ^24.0.0 (#6962)
  • Bump @metamask/base-controller from ^8.4.2 to ^9.0.0 (#6962)

Changed

  • Bump @metamask/base-controller from ^8.4.1 to ^8.4.2 (#6917)

Added

  • Add support for MONAD (chain ID 0x8f) (#6827)
    • Add MONAD into constant ETHERSCAN_SUPPORTED_CHAIN_IDS
    • Update default controller state so MONAD (Chain ID 0x8f) is automatically enabled in showIncomingTransactions

Changed

  • Bump @metamask/base-controller from ^8.4.0 to ^8.4.1 (#6807)
  • Bump @metamask/controller-utils from ^11.14.0 to ^11.14.1 (#6807)

Changed

  • Change default for showMultiRpcModal to false (#6723)

Added

  • Add a new controller state property: tokenNetworkFilter (#6707)
  • Add a new controller method: setTokenNetworkFilter (#6707)
  • Add two new controller state metadata properties: includeInStateLogs and usedInUi (#6525)

Changed

  • BREAKING: Rename controller state property from useMultiRpcMigration to showMultiRpcModal (#6707)
  • BREAKING: Rename controller method from setUseMultiRpcMigration to setShowMultiRpcModal (#6707)
  • BREAKING: Rename controller state property from openSeaEnabled to displayNftMedia (#4774)
  • BREAKING: Rename controller method from setOpenSeaEnabled to setDisplayNftMedia (#4774)
  • Bump @metamask/controller-utils from ^11.12.0 to ^11.14.0 (#6620, #6629)
  • Bump @metamask/base-controller from ^8.1.0 to ^8.4.0 (#6355, #6465, #6632)

Changed

  • BREAKING: Bump peer dependency @metamask/keyring-controller from ^22.0.0 to ^23.0.0 (#6345)
  • Bump @metamask/base-controller from ^8.0.1 to ^8.1.0 (#6284)
  • Bump @metamask/controller-utils from ^11.11.0 to ^11.12.0 (#6303)

Deprecated

  • Deprecate preference smartAccountOptInForAccounts and function setSmartAccountOptInForAccounts (#6087)

Changed

  • Bump @metamask/controller-utils from ^11.10.0 to ^11.11.0 (#6069)
    • This upgrade includes performance improvements to checksum hex address normalization

Changed

  • Initialise preference smartAccountOptIn with true value (#6040)

Added

  • Add smartAccountOptIn, smartAccountOptInForAccounts preferences (#6036)

Added

  • Add support for SEI (chain ID 0x531) (#6021)
    • Add SEI into constant ETHERSCAN_SUPPORTED_CHAIN_IDS
    • Update default controller state so SEI (Chain ID 0xe705) is automatically enabled in showIncomingTransactions

Changed

  • Bump @metamask/controller-utils to ^11.10.0 (#5935)

Added

  • Add dismissSmartAccountSuggestionEnabled preference (#5866)

Changed

  • Bump @metamask/controller-utils to ^11.9.0 (#5812)

Changed

  • BREAKING: bump @metamask/keyring-controller peer dependency to ^22.0.0 (#5802)
  • Bump @metamask/base-controller from ^8.0.0 to ^8.0.1 (#5722)
  • Bump @metamask/controller-utils to ^11.8.0 (#5765)

Changed

  • BREAKING: Bump @metamask/keyring-controller peer dependency to ^21.0.0 (#5439)

Changed

  • BREAKING: Bump @metamask/keyring-controller peer dependency to ^20.0.0 (#5426)

Changed

  • Bump @metamask/base-controller from ^7.0.2 to ^8.0.0 (#5079), (#5135), (#5305)
  • Bump @metamask/controller-utils from ^11.4.4 to ^11.5.0 (#5135), (#5272)

Changed

  • Bump @metamask/controller-utils from ^11.4.3 to ^11.4.4 (#5012)

Changed

  • BREAKING: Bump @metamask/keyring-controller peer dependency from ^18.0.0 to ^19.0.0 (#4195)

Changed

  • BREAKING: Bump @metamask/keyring-controller peer dependency from ^17.0.0 to ^18.0.0 (#4915)
  • Bump @metamask/controller-utils from ^11.4.2 to ^11.4.3 (#4915)

Changed

  • Enable smart transactions by default for new users (#4885)

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
  • Add useMultiRpcMigration preference (#4732)

Changed

  • Bump @metamask/base-controller from ^7.0.1 to ^7.0.2 (#4862)
  • Bump @metamask/controller-utils from ^11.3.0 to ^11.4.2 (#4834, #4862, #4870)

Changed

  • Bump @metamask/keyring-controller from ^17.2.1 to ^17.2.2 (#4734)

Fixed

  • Produce and export ESM-compatible TypeScript type declaration files in addition to CommonJS-compatible declaration files (#4648)
    • Previously, this package shipped with only one variant of type declaration files, and these files were only CommonJS-compatible, and the exports field in package.json linked to these files. This is an anti-pattern and was rightfully flagged by the "Are the Types Wrong?" tool as "masquerading as CJS". All of the ATTW checks now pass.
  • Remove chunk files (#4648).
    • Previously, the build tool we used to generate JavaScript files extracted common code to "chunk" files. While this was intended to make this package more tree-shakeable, it also made debugging more difficult for our development teams. These chunk files are no longer present.

Changed

  • Bump @metamask/base-controller from ^6.0.2 to ^7.0.0 (#4625, #4643)
  • Bump @metamask/controller-utils from ^11.0.2 to ^11.2.0 (#4639, #4651)
  • Bump typescript from ~5.0.4 to ~5.2.2 (#4576, #4584)

Changed

  • Upgrade TypeScript version to ~5.0.4 and set moduleResolution option to Node16 (#3645)
  • Bump @metamask/base-controller from ^6.0.0 to ^6.0.2 (#4517, #4544)
  • Bump @metamask/controller-utils from ^11.0.0 to ^11.0.2 (#4517, #4544)

Changed

  • BREAKING: Bump minimum Node version to 18.18 (#3611)
  • BREAKING: Bump peer dependency @metamask/keyring-controller to ^17.0.0 (#4352)
  • Bump @metamask/base-controller to ^6.0.0 (#4352)
  • Bump @metamask/controller-utils to ^11.0.0 (#4352)

Added

  • Add smartTransactionsOptInStatus preference (#3815)
    • Add smartTransactionsOptInStatus property to the PreferencesController state (default: false)
    • Add setSmartTransactionOptInStatus method to set this property
  • Add useTransactionSimulations preference (#4283)
    • Add useTransactionSimulations property to the PreferencesController state (default value: false)
    • Add setUseTransactionSimulations method to set this property

Changed

  • Bump @metamask/controller-utils to ^10.0.0 (#4342)

Removed

  • BREAKING: Remove state property disabledRpcMethodPreferences along with setDisabledRpcMethodPreferences method (#4319)
    • These were for disabling the eth_sign RPC method, but support for this method is being removed, so this preference is no longer needed.

Added

  • Export ETHERSCAN_SUPPORTED_CHAIN_IDS constant (#4233)

Changed

  • BREAKING Bump @metamask/keyring-controller peer dependency to ^16.0.0 (#4234)
  • Bump @metamask/base-controller to ^5.0.2 (#4232)

Changed

  • BREAKING Bump peer dependency on @metamask/keyring-controller to ^15.0.0 (#4090)
  • Restore previous behavior of toChecksumHexAddress (#4046)

Fixed

  • Fix types field in package.json (#4047)

Added

  • BREAKING: Add ESM build (#3998)
    • It's no longer possible to import files from ./dist directly.
  • Add support for Linea Sepolia (chain ID 0xe705) (#3995)
    • Update default controller state so 0xe705 is automatically enabled in showIncomingTransactions.

Changed

  • BREAKING: Bump @metamask/base-controller to ^5.0.0 (#4039)
    • This version has a number of breaking changes. See the changelog for more.
  • BREAKING: Bump peer dependency on @metamask/keyring-controller to ^14.0.0 (#4039)
  • Bump @metamask/controller-utils to ^9.0.0 (#4039)

Changed

  • BREAKING: Bump @metamask/keyring-controller dependency and peer dependency to ^13.0.0 (#4007)
  • BREAKING: Remove support for Optimism Goerli, add support for Optimism Sepolia (#3999)
    • Replace OPTIMISM_TESTNET with OPTIMISM_SEPOLIA in ETHERSCAN_SUPPORTED_CHAIN_IDS and EtherscanSupportedChains.
    • Replace 0x1a4 with 0xaa37dc in EtherscanSupportedHexChainId.
    • Replace 0x1a4 with 0xaa37dc in default showIncomingTransactions state.
    • Update setEnabledNetworkIncomingTransactions to ignore a chain ID of 0x1a4; add support for 0xaa37dc instead.
    • You will likely want to write a migration to transfer the value of 0x1a4 for 0xaa37dc for the showIncomingTransactions state property.
  • Bump @metamask/controller-utils to ^8.0.4 (#4007)

Removed

  • BREAKING: Move syncIdentities to private, as it's only used internally to update state on KeyringController:stateChange event (#3976)
  • BREAKING: Remove updateIdentities, as it's not in use anymore (#3976)

Fixed

  • Fix KeyringController state listener to not sync identities when the wallet is locked (which clears the list of accounts) to avoid setting the selected address to undefined (#3946)

Changed

  • BREAKING: Keep PreferencesController state synchronized with KeyringController state (#3799)
    • The KeyringController:stateChange event is now required by the PreferencesController messenger, which is a breaking change.
    • The package @metamask/keyring-controller has been added as a peerDependency and as a devDependency, which is a breaking change.
    • Previously the state was synchronized manually by calling syncIdentities or updateIdentities. Calling these methods is no longer required.
  • Bump @metamask/base-controller to ^4.1.1 (#3760, #3821)
  • Bump @metamask/controller-utils to ^8.0.2 (#3821)

Added

  • Added getDefaultPreferencesState function (#3736)

Changed

  • BREAKING Clean up types (#3712)
    • Replace ContactEntry interface with Identity type
    • Convert PreferencesState from an interface to a type
  • BREAKING: Convert to BaseControllerV2 (#3713)
    • The constructor parameters have changed; rather than accepting an empty "config" parameter and a "state" parameter, there is now just a single object for all constructor arguments. This object has a mandatory messenger and an optional state property.
    • Additional type exports have been added for the controller messenger and associated types

Changed

Added

  • BREAKING Add required property showIncomingTransactions to PreferencesState (#1659)
  • Add types EtherscanSupportedChains, EtherscanSupportedHexChainId (#1659)
  • Add constant ETHERSCAN_SUPPORTED_CHAIN_IDS (#1659)
  • Add setEnabledNetworkIncomingTransactions method (#1659)
    • This can be used to set the showIncomingTransactions preference for the given chain ID.

Changed

  • Bump @metamask/base-controller to ^4.0.0 (#2063)
    • This is not breaking because this controller still inherits from BaseController v1.
  • Bump @metamask/controller-utils to ^6.0.0 (#2063)

Changed

  • Bump dependency on @metamask/base-controller to ^3.2.3 (#1747)
  • Bump dependency on @metamask/controller-utils to ^5.0.2 (#1747)

Changed

  • Update TypeScript to v4.8.x (#1718)

Changed

  • Bump dependency on @metamask/controller-utils to ^5.0.0

Added

  • Add isIpfsGatewayEnabled property to PreferencesController state (#1577)
  • Add setIsIpfsGatewayEnabled to set isIpfsGatewayEnabled (#1577)

Changed

  • Bump dependency on @metamask/base-controller to ^3.2.1
  • Bump dependency on @metamask/controller-utils to ^4.3.2

Added

  • Add preference for security alerts (#1589)

Added

  • Add controller state property showTestNetworks along with a setter method, setShowTestNetworks (#1418)

Added

  • Add isMultiAccountBalancesEnabled to state (default: true) along with a setIsMultiAccountBalancesEnabled method to set it

Changed

  • BREAKING: Bump to Node 16 (#1262)

Changed

  • BREAKING: Migrate network configurations from PreferencesController to NetworkController (#1064)
    • Consumers will need to adapt by reading network data from NetworkConfigurations state on NetworkController rather than frequentRpcList on PreferencesController. See NetworkController v6.0.0 changelog entry for more details.

Added

Removed

  • BREAKING: Remove isomorphic-fetch (#1106)
    • Consumers must now import isomorphic-fetch or another polyfill themselves if they are running in an environment without fetch

Changed

  • Rename this repository to core (#1031)
  • Update @metamask/controller-utils package (#1041)

Changed

  • Relax dependencies on @metamask/base-controller and @metamask/controller-utils (use ^ instead of ~) (#998)

Added

  • Initial release
    • As a result of converting our shared controllers repo into a monorepo (#831), we've created this package from select parts of @metamask/controllers v33.0.0, namely:

      • src/user/PreferencesController.ts (plus ContactEntry copied from src/user/AddressBookController.ts)
      • src/user/PreferencesController.test.ts

      All changes listed after this point were applied to this package following the monorepo conversion.