Skip to content

Conversation

@bergarces
Copy link
Contributor

@bergarces bergarces commented Oct 10, 2025

Explanation

Assets controllers release.

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

Bumps monorepo to 614, releases assets-controllers 80 with real-time WebSocket balances, and updates bridge packages to 50 with peer dep alignment.

  • Packages:
    • packages/assets-controllers v80.0.0:
      • Add real-time balance updates via WebSocket (AccountActivityService) with intelligent polling (30s default; 5m when WS up).
      • Add TokenDetectionController:addDetectedTokensViaWs action; subscribe to status/balance events.
      • Perf: reduce NFT detection API calls; minor bug fix for address format.
      • BREAKING: messenger must allow new WS events/actions; default polling interval changed.
    • packages/bridge-controller v50.0.0:
      • BREAKING: bump peer/dev deps to @metamask/assets-controllers@^80.0.0.
    • packages/bridge-status-controller v50.0.0:
      • BREAKING: bump peer/dev deps to @metamask/bridge-controller@^50.0.0.
  • Repo:
    • Root version to 614.0.0; update yarn.lock accordingly.

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

@bergarces bergarces requested review from a team as code owners October 10, 2025 16:31
@bergarces bergarces enabled auto-merge (squash) October 10, 2025 16:41
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 minor suggestion but otherwise LGTM.

@bergarces bergarces merged commit 4a4aedc into main Oct 13, 2025
243 checks passed
@bergarces bergarces deleted the release/614.0.0 branch October 13, 2025 09:01
@Kriys94 Kriys94 mentioned this pull request Oct 14, 2025
4 tasks
Kriys94 added a commit that referenced this pull request 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`:
   ```typescript
   // 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:
   ```typescript
   AllowedEvents: [
     'KeyringController:lock',
     'KeyringController:unlock',
     // ... other events
   ]
   ```

3. **Update Asset type usage** to include `decimals`:
   ```typescript
   const asset: Asset = {
     address: '0x...',
     symbol: 'TOKEN',
     decimals: 18, // now required
   };
   ```

4. **Update Transaction references** from `hash` to `id`:
   ```typescript
   // Before: transaction.hash
   // After: transaction.id
   ```

5. **Add @metamask/keyring-controller** peer dependency:
   ```json
   {
     "peerDependencies": {
       "@metamask/keyring-controller": "^23.0.0"
     }
   }
   ```

6. **Remove `getSupportedChains` calls** - chain tracking is now
automatic via system notifications

## References

- Primary PR: #6819 - WebSocket connection management improvements
- Related: #6818, #6824
- Release PR: #6834

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Releases core-backend v2 with breaking WebSocket and type changes, and
cascades required peer/dependency bumps across assets and bridge
packages.
> 
> - **Backend**
>   - `@metamask/[email protected]` (major):
>     - Requires `channelType` in `BackendWebSocketService.subscribe`
> - Adds required `Asset.decimals`; renames transaction `hash` → `id`
> - Auto WebSocket connection management tied to lock/unlock; new peer
dep `@metamask/keyring-controller`
> - Optional `traceFn`; optional `timestamp` fields in
notifications/events
> - **Assets**
> - `@metamask/[email protected]` (major): bump peer/dev dep
`@metamask/core-backend` to `^2.0.0`.
> - **Bridge**
> - `@metamask/[email protected]` (major): bump peer/dev dep
`@metamask/assets-controllers` to `^81.0.0`.
> - `@metamask/[email protected]` (major): bump peer/dev
dep `@metamask/bridge-controller` to `^52.0.0`.
> - **Repo**
>   - Monorepo version `618.0.0` → `619.0.0`; lockfile updated.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9e01bed. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

5 participants