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
1 change: 1 addition & 0 deletions packages/assets-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([#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:<address>`) are now correctly typed as `spl` instead of `erc20` in `assetsInfo` ([#8811](https://github.com/MetaMask/core/pull/8811))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -144,7 +145,8 @@ const defaultSnapState: SnapDataSourceState = {
*/
export type SnapDataSourceAllowedEvents =
| AccountsControllerAccountBalancesUpdatedEvent
| PermissionControllerStateChange;
| PermissionControllerStateChange
| SnapControllerSnapInstalledEvent;

export type SnapDataSourceAllowedActions =
| SnapControllerGetRunnableSnapsAction
Expand Down Expand Up @@ -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();
});
Comment thread
salimtb marked this conversation as resolved.
}

/**
Expand Down
Loading