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 metadata, updating messaging, types, snapshots, and changelog.

  • Controllers:
    • Migrate MultichainAssetsController, MultichainBalancesController, NftDetectionController, RatesController, and TokenSearchDiscoveryDataController from RestrictedMessenger to @metamask/messenger (messagingSystemmessenger).
    • Update types to use Messenger<...> and adopt @metamask/base-controller/next where applicable.
    • Replace state metadata anonymous with includeInDebugSnapshot; add StateMetadata typing.
    • Swap publish/subscribe/call sites to the new messenger API; adjust event publishing (e.g., ${name}:pollingStarted|Stopped).
  • Tests:
    • Rework test messengers to use root Messenger with namespace/delegate; replace helper extraction types with MessengerActions/MessengerEvents.
    • Update deriveStateFromMetadata calls to use includeInDebugSnapshot.
  • Changelog:
    • Consolidate and expand the BREAKING change note to reflect migration to @metamask/messenger and reference related PRs.
  • Misc:
    • Minor ESLint threshold adjustments in eslint-warning-thresholds.json.

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

@mikesposito mikesposito mentioned this pull request Sep 29, 2025
42 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