You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 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 -->
0 commit comments