feat(TokenBalanceContoller): bump to 79.0.1 #36782
Closed
+111
−57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds messenger allowlist support for the TokenBalancesController WebSocket integration introduced in MetaMask/core#6784.
What is the reason for the change?
The updated
@metamask/assets-controllers
package (v79.0.0+) includes a TokenBalancesController that can optionally receive real-time balance updates via WebSocket events from@metamask/core-backend
services. Without updating the messenger allowlist, the extension throws an error:Event missing from allow list: AccountActivityService:balanceUpdated
.What is the improvement/solution?
This PR makes minimal changes to support the new TokenBalancesController capabilities:
@metamask/core-backend
(^1.0.1) for TypeScript type definitionstoken-balances-controller-messenger.ts
:AccountActivityService:balanceUpdated
,AccountActivityService:statusChanged
,BackendWebSocketService:connectionStateChanged
TokenDetectionController:addDetectedTokensViaWs
Bumping the
@metamask/assets-controllers
version changes nothing about TokenBalancesController behavior. The controller will continue to work exactly as it does today using HTTP polling.Why? The WebSocket integration requires
BackendWebSocketService
andAccountActivityService
to be initialized and connected. Since these services are not initialized in this PR, no WebSocket connection is established, and no real-time events are triggered. The TokenBalancesController gracefully detects their absence and continues using the existing HTTP polling mechanism.This PR only updates the messenger allowlist to prevent validation errors when the controller checks for the optional WebSocket events.
Benefits:
Changelog
CHANGELOG entry: null
Related issues
Fixes: #[issue number if applicable]
Related:
Note
Expands
TokenBalancesController
messenger allowlist for WebSocket integration, adds@metamask/core-backend
types, and bumps@metamask/assets-controllers
to79.0.1-preview
.AccountActivityService:balanceUpdated
,AccountActivityService:statusChanged
,BackendWebSocketService:connectionStateChanged
.TokenDetectionController:addDetectedTokensViaWs
.@metamask/core-backend
(^1.0.1).@metamask/assets-controllers
to79.0.1-preview
(via resolutions).Written by Cursor Bugbot for commit 0b6881b. This will update automatically on new commits. Configure here.