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
2 changes: 2 additions & 0 deletions packages/assets-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Expose missing `AssetsController:setSelectedCurrency` action through its messenger ([#8719](https://github.com/MetaMask/core/pull/8719))
- Corresponding action type is available as well.
- Bump `@metamask/transaction-controller` from `^65.0.0` to `^65.1.0` ([#8691](https://github.com/MetaMask/core/pull/8691))
- Bump `@metamask/network-enablement-controller` from `^5.0.2` to `^5.1.0` ([#8665](https://github.com/MetaMask/core/pull/8665))
- Bump `@metamask/keyring-controller` from `^25.3.0` to `^25.4.0` ([#8665](https://github.com/MetaMask/core/pull/8665))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ export type AssetsControllerUnhideAssetAction = {
handler: AssetsController['unhideAsset'];
};

/**
* Set the current currency.
*
* @param selectedCurrency - The ISO 4217 currency code to set.
*/
export type AssetsControllerSetSelectedCurrencyAction = {
type: `AssetsController:setSelectedCurrency`;
handler: AssetsController['setSelectedCurrency'];
};

/**
* Union of all AssetsController action types.
*/
Expand All @@ -129,4 +139,5 @@ export type AssetsControllerMethodActions =
| AssetsControllerRemoveCustomAssetAction
| AssetsControllerGetCustomAssetsAction
| AssetsControllerHideAssetAction
| AssetsControllerUnhideAssetAction;
| AssetsControllerUnhideAssetAction
| AssetsControllerSetSelectedCurrencyAction;
4 changes: 4 additions & 0 deletions packages/assets-controller/src/AssetsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ const MESSENGER_EXPOSED_METHODS = [
'getCustomAssets',
'hideAsset',
'unhideAsset',
'setSelectedCurrency',
Comment thread
GuillaumeRx marked this conversation as resolved.
] as const;

/** Default polling interval hint for data sources (30 seconds) */
Expand Down Expand Up @@ -3165,5 +3166,8 @@ export class AssetsController extends BaseController<
this.messenger.unregisterActionHandler('AssetsController:getCustomAssets');
this.messenger.unregisterActionHandler('AssetsController:hideAsset');
this.messenger.unregisterActionHandler('AssetsController:unhideAsset');
this.messenger.unregisterActionHandler(
'AssetsController:setSelectedCurrency',
);
}
}
1 change: 1 addition & 0 deletions packages/assets-controller/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export type {
AssetsControllerUnhideAssetAction,
AssetsControllerGetExchangeRatesForBridgeAction,
AssetsControllerGetStateForTransactionPayAction,
AssetsControllerSetSelectedCurrencyAction,
} from './AssetsController-method-action-types';

// Core types
Expand Down
Loading