Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/network-enablement-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Expose missing public `NetworkEnablementController` method through its messenger ([#9660](https://github.com/MetaMask/core/pull/9660))
- The following action is now available:
- `NetworkEnablementController:restoreEnabledNetworkMap`
- Corresponding action type (`NetworkEnablementControllerRestoreEnabledNetworkMapAction`) is available as well.

### Changed

- **BREAKING:** Popular-network classification is now augmented by `ConfigRegistryController` ([#9611](https://github.com/MetaMask/core/pull/9611))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@ export type NetworkEnablementControllerDisableNetworkAction = {
handler: NetworkEnablementController['disableNetwork'];
};

/**
* Restores the enabled network map to a previously snapshotted state.
*
* Not a general merge API: only updates keys already present in the current
* map. Missing snapshot values default to `false`. Intended for callers with
* direct controller access (e.g. extension) to undo `#onAddNetwork` filter
* switches when adding a network without changing the active selection.
*
* @param enabledNetworkMap - Previously snapshotted enabledNetworkMap.
*/
export type NetworkEnablementControllerRestoreEnabledNetworkMapAction = {
type: `NetworkEnablementController:restoreEnabledNetworkMap`;
handler: NetworkEnablementController['restoreEnabledNetworkMap'];
};

/**
* Checks if a network is enabled.
*
Expand Down Expand Up @@ -186,6 +201,7 @@ export type NetworkEnablementControllerMethodActions =
| NetworkEnablementControllerInitAction
| NetworkEnablementControllerInitNativeAssetIdentifiersAction
| NetworkEnablementControllerDisableNetworkAction
| NetworkEnablementControllerRestoreEnabledNetworkMapAction
| NetworkEnablementControllerIsNetworkEnabledAction
| NetworkEnablementControllerListPopularEvmNetworksAction
| NetworkEnablementControllerListPopularMultichainNetworksAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const MESSENGER_EXPOSED_METHODS = [
'listPopularNetworks',
'listPopularEvmNetworks',
'listPopularMultichainNetworks',
'restoreEnabledNetworkMap',
] as const;

/**
Expand Down