feat(assets-controller): gate non-EVM account-activity websocket behind a namespace feature flag#9430
Draft
salimtb wants to merge 3 commits into
Draft
feat(assets-controller): gate non-EVM account-activity websocket behind a namespace feature flag#9430salimtb wants to merge 3 commits into
salimtb wants to merge 3 commits into
Conversation
…nd a namespace feature flag Add a generic `webSocketEnabledNamespaces` constructor option so non-EVM account-activity balances (starting with Solana, extensible to e.g. Tron) are served over WebSocket only when their CAIP namespace is enabled. EVM (`eip155`) is always served over WebSocket. - BackendWebsocketDataSource claims an enabled namespace's chains (from a namespace -> chains map, since the supported-networks API is EVM-only) while the WebSocket is connected, and subscribes their account-activity channels. Disabled namespaces are left unclaimed and unsubscribed so the SnapDataSource serves them. - When a chain (or a whole non-EVM namespace) is reported down via `system-notifications`, it is excluded from the claimable set and automatically falls back to the SnapDataSource until it recovers. - AccountsApiDataSource is documented as EVM-only (removing the stale "restore solana" TODO); non-EVM is served by WebSocket or Snap, keeping Snap as the sole non-EVM fallback.
978e821 to
ce89685
Compare
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add a generic
webSocketEnabledNamespacesconstructor option so non-EVM account-activity balances (starting with Solana, extensible to e.g. Tron) are served over WebSocket only when their CAIP namespace is enabled. EVM (eip155) is always served over WebSocket.system-notifications, it is excluded from the claimable set and automatically falls back to the SnapDataSource until it recovers.Explanation
References
Checklist