From c5125594b5669e046af8bbcbdef841e1a246b3a0 Mon Sep 17 00:00:00 2001 From: salimtb Date: Wed, 20 May 2026 16:06:04 +0200 Subject: [PATCH 1/2] fix(assets-controller): re-run snap discovery on snap install Subscribe to `SnapController:snapInstalled` so that keyring snap chain discovery is re-triggered whenever a new snap is installed. This ensures snap-backed chains (Bitcoin, Solana, Tron, etc.) appear in `activeChains` immediately after install without waiting for a permission state change. --- packages/assets-controller/CHANGELOG.md | 1 + .../assets-controller/src/data-sources/SnapDataSource.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/assets-controller/CHANGELOG.md b/packages/assets-controller/CHANGELOG.md index c90b71f634..568d1fdb32 100644 --- a/packages/assets-controller/CHANGELOG.md +++ b/packages/assets-controller/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- **BREAKING:** **SnapDataSource:** `SnapControllerSnapInstalledEvent` has been added to `SnapDataSourceAllowedEvents`. Hosts that restrict which events flow through the `AssetsController` messenger must now also delegate `SnapController:snapInstalled`; failing to do so will prevent snap chain re-discovery after install. Re-run keyring snap discovery when a new snap is installed so that snap-backed chains (Bitcoin, Solana, Tron, etc.) become available immediately after install ([#8857](https://github.com/MetaMask/core/pull/8857)) - Non-EVM assets with a `slip44` asset namespace (e.g. Bitcoin, Solana native, TRON) are now correctly typed as `native` instead of `erc20` in `assetsInfo` ([#8811](https://github.com/MetaMask/core/pull/8811)) - Solana SPL tokens (CAIP-19 `solana:.../token:
`) are now correctly typed as `spl` instead of `erc20` in `assetsInfo` ([#8811](https://github.com/MetaMask/core/pull/8811)) diff --git a/packages/assets-controller/src/data-sources/SnapDataSource.ts b/packages/assets-controller/src/data-sources/SnapDataSource.ts index 7ee04140d5..c1925e5355 100644 --- a/packages/assets-controller/src/data-sources/SnapDataSource.ts +++ b/packages/assets-controller/src/data-sources/SnapDataSource.ts @@ -10,6 +10,7 @@ import type { import type { SnapControllerGetRunnableSnapsAction, SnapControllerHandleRequestAction, + SnapControllerSnapInstalledEvent, } from '@metamask/snaps-controllers'; import type { Snap, SnapId } from '@metamask/snaps-sdk'; import { HandlerType, SnapCaveatType } from '@metamask/snaps-utils'; @@ -144,7 +145,8 @@ const defaultSnapState: SnapDataSourceState = { */ export type SnapDataSourceAllowedEvents = | AccountsControllerAccountBalancesUpdatedEvent - | PermissionControllerStateChange; + | PermissionControllerStateChange + | SnapControllerSnapInstalledEvent; export type SnapDataSourceAllowedActions = | SnapControllerGetRunnableSnapsAction @@ -254,6 +256,10 @@ export class SnapDataSource extends AbstractDataSource< 'PermissionController:stateChange', this.#handlePermissionStateChangeBound, ); + // Rediscover keyring snaps when any snap gets installed + messenger.subscribe('SnapController:snapInstalled', () => { + this.#discoverKeyringSnaps(); + }); } /** From bf74ff732d90ecea719af5844a4d3d726db8c865 Mon Sep 17 00:00:00 2001 From: salimtb Date: Wed, 20 May 2026 16:32:44 +0200 Subject: [PATCH 2/2] fix: fix changelog --- packages/assets-controller/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/assets-controller/CHANGELOG.md b/packages/assets-controller/CHANGELOG.md index 568d1fdb32..f3012d7243 100644 --- a/packages/assets-controller/CHANGELOG.md +++ b/packages/assets-controller/CHANGELOG.md @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- **BREAKING:** **SnapDataSource:** `SnapControllerSnapInstalledEvent` has been added to `SnapDataSourceAllowedEvents`. Hosts that restrict which events flow through the `AssetsController` messenger must now also delegate `SnapController:snapInstalled`; failing to do so will prevent snap chain re-discovery after install. Re-run keyring snap discovery when a new snap is installed so that snap-backed chains (Bitcoin, Solana, Tron, etc.) become available immediately after install ([#8857](https://github.com/MetaMask/core/pull/8857)) +- **BREAKING:** **SnapDataSource:** `SnapControllerSnapInstalledEvent` has been added to `SnapDataSourceAllowedEvents`. Hosts that restrict which events flow through the `AssetsController` messenger must now also delegate `SnapController:snapInstalled`; failing to do so will prevent snap chain re-discovery after install. Re-run keyring snap discovery when a new snap is installed so that snap-backed chains (Bitcoin, Solana, Tron, etc.) become available immediately after install ([#8862](https://github.com/MetaMask/core/pull/8862)) - Non-EVM assets with a `slip44` asset namespace (e.g. Bitcoin, Solana native, TRON) are now correctly typed as `native` instead of `erc20` in `assetsInfo` ([#8811](https://github.com/MetaMask/core/pull/8811)) - Solana SPL tokens (CAIP-19 `solana:.../token:
`) are now correctly typed as `spl` instead of `erc20` in `assetsInfo` ([#8811](https://github.com/MetaMask/core/pull/8811))