Skip to content

feat(accounts-controller)!: use new SnapAccountService account data events#8978

Merged
ccharly merged 22 commits into
mainfrom
cc/feat/use-new-snap-account-service-events
Jun 4, 2026
Merged

feat(accounts-controller)!: use new SnapAccountService account data events#8978
ccharly merged 22 commits into
mainfrom
cc/feat/use-new-snap-account-service-events

Conversation

@ccharly
Copy link
Copy Markdown
Contributor

@ccharly ccharly commented Jun 2, 2026

Explanation

We used to get those events from the SnapKeyring but now it all comes from the SnapAccountService!

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Breaking messenger event wiring can break balance/asset/transaction UI updates for snap accounts if consumers are not updated alongside this package.

Overview
Breaking: AccountsController now listens for snap account data on SnapAccountService instead of SnapKeyring.

Subscriptions and allowed incoming events switch from SnapKeyring:account{AssetList,Balances,Transactions}Updated to SnapAccountService:account{AssetList,Balances,Transactions}Updated. Payload shapes are unchanged (reused via new types in types.ts). The controller still re-publishes the same AccountsController:account* events.

Integrators must register the three SnapAccountService events on the messenger and stop requiring the SnapKeyring variants. Tests and the changelog document the breaking messenger contract.

Reviewed by Cursor Bugbot for commit 4bcc1c6. Bugbot is set up for automated code reviews on this repo. Configure here.

@ccharly ccharly marked this pull request as ready for review June 3, 2026 08:07
@ccharly ccharly requested review from a team as code owners June 3, 2026 08:07
@ccharly ccharly enabled auto-merge June 3, 2026 08:07
@ccharly ccharly temporarily deployed to default-branch June 3, 2026 08:07 — with GitHub Actions Inactive
Comment on lines +17 to +30
export type SnapAccountServiceAccountBalancesUpdatedEvent = {
type: `SnapAccountService:accountBalancesUpdated`;
payload: SnapKeyringAccountBalancesUpdatedEvent['payload'];
};

export type SnapAccountServiceAccountTransactionsUpdatedEvent = {
type: `SnapAccountService:accountTransactionsUpdated`;
payload: SnapKeyringAccountTransactionsUpdatedEvent['payload'];
};

export type SnapAccountServiceAccountAssetListUpdatedEvent = {
type: `SnapAccountService:accountAssetListUpdated`;
payload: SnapKeyringAccountAssetListUpdatedEvent['payload'];
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We put them here to avoid having a cycle:

snap-account-service -> account-tree-controller -> accounts-controller

@ccharly
Copy link
Copy Markdown
Contributor Author

ccharly commented Jun 3, 2026

@metamaskbot publish-preview

@ccharly ccharly disabled auto-merge June 3, 2026 19:49
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.5.0-preview-4bcc1c6c1
@metamask-previews/accounts-controller@38.1.2-preview-4bcc1c6c1
@metamask-previews/address-book-controller@7.1.2-preview-4bcc1c6c1
@metamask-previews/ai-controllers@0.7.0-preview-4bcc1c6c1
@metamask-previews/analytics-controller@1.1.0-preview-4bcc1c6c1
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-4bcc1c6c1
@metamask-previews/announcement-controller@8.1.0-preview-4bcc1c6c1
@metamask-previews/app-metadata-controller@2.0.1-preview-4bcc1c6c1
@metamask-previews/approval-controller@9.0.1-preview-4bcc1c6c1
@metamask-previews/assets-controller@8.2.0-preview-4bcc1c6c1
@metamask-previews/assets-controllers@108.3.0-preview-4bcc1c6c1
@metamask-previews/authenticated-user-storage@2.0.0-preview-4bcc1c6c1
@metamask-previews/base-controller@9.1.0-preview-4bcc1c6c1
@metamask-previews/base-data-service@0.1.3-preview-4bcc1c6c1
@metamask-previews/bridge-controller@73.2.0-preview-4bcc1c6c1
@metamask-previews/bridge-status-controller@72.0.0-preview-4bcc1c6c1
@metamask-previews/build-utils@3.0.4-preview-4bcc1c6c1
@metamask-previews/chain-agnostic-permission@1.6.1-preview-4bcc1c6c1
@metamask-previews/chomp-api-service@3.1.0-preview-4bcc1c6c1
@metamask-previews/claims-controller@0.5.2-preview-4bcc1c6c1
@metamask-previews/client-controller@1.0.1-preview-4bcc1c6c1
@metamask-previews/compliance-controller@2.1.0-preview-4bcc1c6c1
@metamask-previews/composable-controller@12.0.1-preview-4bcc1c6c1
@metamask-previews/config-registry-controller@0.4.0-preview-4bcc1c6c1
@metamask-previews/connectivity-controller@0.2.0-preview-4bcc1c6c1
@metamask-previews/controller-utils@12.1.0-preview-4bcc1c6c1
@metamask-previews/core-backend@6.3.1-preview-4bcc1c6c1
@metamask-previews/delegation-controller@3.0.1-preview-4bcc1c6c1
@metamask-previews/earn-controller@12.2.0-preview-4bcc1c6c1
@metamask-previews/eip-5792-middleware@3.0.4-preview-4bcc1c6c1
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-4bcc1c6c1
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-4bcc1c6c1
@metamask-previews/ens-controller@19.1.3-preview-4bcc1c6c1
@metamask-previews/eth-block-tracker@15.0.1-preview-4bcc1c6c1
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-4bcc1c6c1
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-4bcc1c6c1
@metamask-previews/foundryup@1.0.1-preview-4bcc1c6c1
@metamask-previews/gas-fee-controller@26.2.2-preview-4bcc1c6c1
@metamask-previews/gator-permissions-controller@4.2.0-preview-4bcc1c6c1
@metamask-previews/geolocation-controller@0.1.3-preview-4bcc1c6c1
@metamask-previews/json-rpc-engine@10.5.0-preview-4bcc1c6c1
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-4bcc1c6c1
@metamask-previews/keyring-controller@26.0.0-preview-4bcc1c6c1
@metamask-previews/logging-controller@8.0.2-preview-4bcc1c6c1
@metamask-previews/message-manager@14.1.2-preview-4bcc1c6c1
@metamask-previews/messenger@1.2.0-preview-4bcc1c6c1
@metamask-previews/messenger-cli@0.2.0-preview-4bcc1c6c1
@metamask-previews/money-account-balance-service@1.0.2-preview-4bcc1c6c1
@metamask-previews/money-account-controller@0.3.1-preview-4bcc1c6c1
@metamask-previews/money-account-upgrade-controller@2.0.3-preview-4bcc1c6c1
@metamask-previews/multichain-account-service@10.0.1-preview-4bcc1c6c1
@metamask-previews/multichain-api-middleware@3.1.2-preview-4bcc1c6c1
@metamask-previews/multichain-network-controller@3.1.2-preview-4bcc1c6c1
@metamask-previews/multichain-transactions-controller@7.1.0-preview-4bcc1c6c1
@metamask-previews/name-controller@9.1.2-preview-4bcc1c6c1
@metamask-previews/network-controller@32.0.0-preview-4bcc1c6c1
@metamask-previews/network-enablement-controller@5.2.0-preview-4bcc1c6c1
@metamask-previews/notification-services-controller@24.1.2-preview-4bcc1c6c1
@metamask-previews/passkey-controller@2.0.1-preview-4bcc1c6c1
@metamask-previews/permission-controller@13.1.1-preview-4bcc1c6c1
@metamask-previews/permission-log-controller@5.1.0-preview-4bcc1c6c1
@metamask-previews/perps-controller@7.0.0-preview-4bcc1c6c1
@metamask-previews/phishing-controller@17.2.0-preview-4bcc1c6c1
@metamask-previews/polling-controller@16.0.6-preview-4bcc1c6c1
@metamask-previews/preferences-controller@23.1.0-preview-4bcc1c6c1
@metamask-previews/profile-metrics-controller@3.1.5-preview-4bcc1c6c1
@metamask-previews/profile-sync-controller@28.1.1-preview-4bcc1c6c1
@metamask-previews/ramps-controller@14.1.0-preview-4bcc1c6c1
@metamask-previews/rate-limit-controller@7.0.1-preview-4bcc1c6c1
@metamask-previews/react-data-query@0.2.1-preview-4bcc1c6c1
@metamask-previews/remote-feature-flag-controller@4.2.1-preview-4bcc1c6c1
@metamask-previews/sample-controllers@5.0.1-preview-4bcc1c6c1
@metamask-previews/seedless-onboarding-controller@10.0.0-preview-4bcc1c6c1
@metamask-previews/selected-network-controller@26.1.3-preview-4bcc1c6c1
@metamask-previews/shield-controller@5.1.2-preview-4bcc1c6c1
@metamask-previews/signature-controller@39.2.3-preview-4bcc1c6c1
@metamask-previews/snap-account-service@0.2.1-preview-4bcc1c6c1
@metamask-previews/social-controllers@2.2.1-preview-4bcc1c6c1
@metamask-previews/storage-service@1.0.1-preview-4bcc1c6c1
@metamask-previews/subscription-controller@6.1.3-preview-4bcc1c6c1
@metamask-previews/transaction-controller@66.0.0-preview-4bcc1c6c1
@metamask-previews/transaction-pay-controller@23.1.0-preview-4bcc1c6c1
@metamask-previews/user-operation-controller@41.2.3-preview-4bcc1c6c1
@metamask-previews/wallet@2.0.0-preview-4bcc1c6c1

Copy link
Copy Markdown
Contributor

@mathieuartu mathieuartu left a comment

Choose a reason for hiding this comment

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

LGTM!

@ccharly ccharly added this pull request to the merge queue Jun 4, 2026
Merged via the queue into main with commit 378eb4e Jun 4, 2026
370 checks passed
@ccharly ccharly deleted the cc/feat/use-new-snap-account-service-events branch June 4, 2026 08:09
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.

2 participants