Skip to content

Conversation

mikesposito
Copy link
Member

@mikesposito mikesposito commented Sep 29, 2025

Explanation

This PR migrates all remaining assets controllers to @metamask/messenger instead of @metamask/base-controller. This is part of a larger effort to migrate all controllers to use @metamask/messenger.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Migrates remaining assets controllers and tests to the new @metamask/messenger API and base-controller/next, updates metadata flags, and consolidates the changelog breaking note.

  • BREAKING: Messenger migration
    • Replace RestrictedMessenger from @metamask/base-controller with Messenger from @metamask/messenger in MultichainAssetsController, MultichainBalancesController, NftDetectionController, RatesController, and TokenSearchDiscoveryDataController.
    • Switch controller internals from messagingSystem to messenger (publish/subscribe/call).
  • Base Controller vNext
    • Update imports to @metamask/base-controller/next; adopt StateMetadata and deriveStateFromMetadata with includeInDebugSnapshot.
    • Update controller metadata to use includeInDebugSnapshot instead of anonymous.
  • Tests
    • Refactor tests to construct a root Messenger with namespaces and delegate allowed actions/events; remove legacy getRestricted usage where applicable.
  • Changelog
    • Consolidate and expand the breaking-change entry to reference all controller migrations and related PRs.

Written by Cursor Bugbot for commit dfa7ce1. This will update automatically on new commits. Configure here.

@mikesposito mikesposito mentioned this pull request Sep 29, 2025
43 tasks
@mikesposito mikesposito force-pushed the mikesposito/messenger/assets-controllers branch from 6a27d5a to 6e80728 Compare September 29, 2025 09:31
@mikesposito mikesposito marked this pull request as ready for review September 29, 2025 09:35
@mikesposito mikesposito requested review from a team as code owners September 29, 2025 09:35
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that Cursor noticed.

AllEvents,
RootMessenger
>({
namespace: controllerName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it does seem that we need a parent option here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants