Skip to content

Conversation

Kriys94
Copy link
Contributor

@Kriys94 Kriys94 commented Oct 14, 2025

Explanation

This release includes major version bumps for 4 packages, primarily driven by breaking changes in @metamask/core-backend that introduce automatic WebSocket connection management and several API improvements.

Note: While these are marked as breaking changes, they should not affect MetaMask Extension or MetaMask Mobile at this time, as WebSocket integration has not been implemented in these clients yet. The breaking changes are primarily API improvements that will be relevant once WebSocket functionality is adopted.

📦 Packages Included

  • @metamask/core-backend: 1.0.1 → 2.0.0
  • @metamask/assets-controllers: 80.0.0 → 81.0.0
  • @metamask/bridge-controller: 51.0.0 → 52.0.0
  • @metamask/bridge-status-controller: 50.1.0 → 51.0.0

Current State and Why It Needs to Change

The @metamask/core-backend package required several breaking changes to improve WebSocket connection management, type safety, and API consistency. The package needed to automatically manage WebSocket connections based on wallet lock state, and the type definitions needed improvements for better developer experience.

Solution

@metamask/core-backend (1.0.1 → 2.0.0)

Breaking Changes:

  • Added required channelType argument to BackendWebSocketService.subscribe method for better subscription management
  • Updated Asset type to require decimals field for proper token amount formatting
  • Implemented automatic WebSocket connection management based on wallet lock state (requires KeyringController:lock and KeyringController:unlock events)
  • Renamed Transaction.hash to Transaction.id for consistency with backend API
  • Added new peer dependency on @metamask/keyring-controller (^23.0.0)
  • Removed getSupportedChains method from AccountActivityService (replaced with system notification-driven chain tracking)

Non-Breaking Additions:

  • Added optional traceFn parameter for performance tracing integration (e.g., Sentry)
  • Added optional timestamp property to various notification types

@metamask/assets-controllers (80.0.0 → 81.0.0)

Changes:

  • BREAKING: Bump dependency @metamask/core-backend from ^1.0.1 to ^2.0.0
  • BREAKING: Bump peer dependency @metamask/core-backend from ^1.0.1 to ^2.0.0
  • Fixed: Address casing in WebSocket-based token balance updates to ensure consistency

@metamask/bridge-controller (51.0.0 → 52.0.0)

Changes:

  • BREAKING: Bump dependency @metamask/assets-controllers from ^80.0.0 to ^81.0.0
  • BREAKING: Bump peer dependency @metamask/assets-controllers from ^80.0.0 to ^81.0.0

@metamask/bridge-status-controller (50.1.0 → 51.0.0)

Changes:

  • BREAKING: Bump dependency @metamask/bridge-controller from ^51.0.0 to ^52.0.0
  • BREAKING: Bump peer dependency @metamask/bridge-controller from ^51.0.0 to ^52.0.0

Why Cascade Updates Were Necessary

The breaking changes in @metamask/core-backend required a major version bump. Since @metamask/assets-controllers has @metamask/core-backend as both a dependency and peer dependency, it needed to be updated to accept the new version. This cascaded to @metamask/bridge-controller (which depends on @metamask/assets-controllers) and @metamask/bridge-status-controller (which depends on @metamask/bridge-controller).

Migration Guide for Consumers

  1. Update subscribe calls to include channelType:

    // Before
    await messenger.call('BackendWebSocketService:subscribe', {
      account: '0x123...',
    });
    
    // After
    await messenger.call('BackendWebSocketService:subscribe', {
      account: '0x123...',
      channelType: 'balance', // or 'transaction'
    });
  2. Add KeyringController events to your messenger:

    AllowedEvents: [
      'KeyringController:lock',
      'KeyringController:unlock',
      // ... other events
    ]
  3. Update Asset type usage to include decimals:

    const asset: Asset = {
      address: '0x...',
      symbol: 'TOKEN',
      decimals: 18, // now required
    };
  4. Update Transaction references from hash to id:

    // Before: transaction.hash
    // After: transaction.id
  5. Add @metamask/keyring-controller peer dependency:

    {
      "peerDependencies": {
        "@metamask/keyring-controller": "^23.0.0"
      }
    }
  6. Remove getSupportedChains calls - chain tracking is now automatic via system notifications

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

Releases core-backend v2 with breaking WebSocket and type changes, and cascades required peer/dependency bumps across assets and bridge packages.

  • Backend
    • @metamask/core-backend@2.0.0 (major):
      • Requires channelType in BackendWebSocketService.subscribe
      • Adds required Asset.decimals; renames transaction hashid
      • Auto WebSocket connection management tied to lock/unlock; new peer dep @metamask/keyring-controller
      • Optional traceFn; optional timestamp fields in notifications/events
  • Assets
    • @metamask/assets-controllers@81.0.0 (major): bump peer/dev dep @metamask/core-backend to ^2.0.0.
  • Bridge
    • @metamask/bridge-controller@52.0.0 (major): bump peer/dev dep @metamask/assets-controllers to ^81.0.0.
    • @metamask/bridge-status-controller@51.0.0 (major): bump peer/dev dep @metamask/bridge-controller to ^52.0.0.
  • Repo
    • Monorepo version 618.0.0619.0.0; lockfile updated.

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

@Kriys94 Kriys94 marked this pull request as ready for review October 14, 2025 18:05
@Kriys94 Kriys94 requested review from a team as code owners October 14, 2025 18:05
Copy link
Contributor

@bergarces bergarces left a comment

Choose a reason for hiding this comment

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

LGTM

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.

LGTM!

@Kriys94 Kriys94 merged commit 932bbce into main Oct 14, 2025
246 checks passed
@Kriys94 Kriys94 deleted the release/619.0.0 branch October 14, 2025 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants