Skip to content

feat(snap-account-service): track account management Snaps + add :getSnaps#8725

Merged
ccharly merged 10 commits intomainfrom
cc/feat/snap-account-service-track-snaps
May 7, 2026
Merged

feat(snap-account-service): track account management Snaps + add :getSnaps#8725
ccharly merged 10 commits intomainfrom
cc/feat/snap-account-service-track-snaps

Conversation

@ccharly
Copy link
Copy Markdown
Contributor

@ccharly ccharly commented May 6, 2026

Explanation

Tracking account management Snaps so we can "restrict" the use of this service only for those Snaps.

This will also be used later on to initialize their associated SnapKeyring v2.

References

N/A

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
Changes SnapAccountService.ensureReady semantics to reject unknown/uninitialized Snap IDs and adds new messenger dependencies on SnapController lifecycle events, which could break existing consumers or event wiring if not updated.

Overview
Adds SnapTracker, which seeds and maintains an in-memory set of account-management Snaps (installed/enabled, not blocked, and declaring endowment:keyring) based on SnapController:getRunnableSnaps plus SnapController lifecycle events.

SnapAccountService now initializes this tracker in init(), exposes a new getSnaps() messenger method, and updates ensureReady(snapId) to throw Unknown snap: "<id>" unless the snap is currently tracked (effectively requiring callers to run init() and only use eligible Snaps). Tests and exports/changelog are updated accordingly, and the service messenger contract expands to include the new SnapController actions/events.

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

@ccharly ccharly changed the base branch from main to cc/feat/snap-account-service-snap-platform May 6, 2026 13:36
@ccharly ccharly force-pushed the cc/feat/snap-account-service-track-snaps branch from 239aa39 to 051934c Compare May 6, 2026 14:03
@ccharly ccharly marked this pull request as ready for review May 6, 2026 14:07
@ccharly ccharly requested review from a team as code owners May 6, 2026 14:07
Base automatically changed from cc/feat/snap-account-service-snap-platform to main May 6, 2026 20:14
@ccharly ccharly force-pushed the cc/feat/snap-account-service-track-snaps branch from 051934c to a6b5060 Compare May 6, 2026 20:18
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 96d8578. Configure here.

Comment thread packages/snap-account-service/src/SnapAccountService.ts Outdated
Comment thread packages/snap-account-service/src/SnapTracker.ts
@ccharly
Copy link
Copy Markdown
Contributor Author

ccharly commented May 7, 2026

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 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.3.0-preview-fe37b4f9a
@metamask-previews/accounts-controller@38.0.0-preview-fe37b4f9a
@metamask-previews/address-book-controller@7.1.1-preview-fe37b4f9a
@metamask-previews/ai-controllers@0.6.3-preview-fe37b4f9a
@metamask-previews/analytics-controller@1.0.1-preview-fe37b4f9a
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-fe37b4f9a
@metamask-previews/announcement-controller@8.1.0-preview-fe37b4f9a
@metamask-previews/app-metadata-controller@2.0.1-preview-fe37b4f9a
@metamask-previews/approval-controller@9.0.1-preview-fe37b4f9a
@metamask-previews/assets-controller@6.4.0-preview-fe37b4f9a
@metamask-previews/assets-controllers@106.0.0-preview-fe37b4f9a
@metamask-previews/authenticated-user-storage@1.0.0-preview-fe37b4f9a
@metamask-previews/base-controller@9.1.0-preview-fe37b4f9a
@metamask-previews/base-data-service@0.1.1-preview-fe37b4f9a
@metamask-previews/bridge-controller@71.1.1-preview-fe37b4f9a
@metamask-previews/bridge-status-controller@71.1.0-preview-fe37b4f9a
@metamask-previews/build-utils@3.0.4-preview-fe37b4f9a
@metamask-previews/chain-agnostic-permission@1.5.0-preview-fe37b4f9a
@metamask-previews/chomp-api-service@3.0.0-preview-fe37b4f9a
@metamask-previews/claims-controller@0.5.0-preview-fe37b4f9a
@metamask-previews/client-controller@1.0.1-preview-fe37b4f9a
@metamask-previews/compliance-controller@2.0.0-preview-fe37b4f9a
@metamask-previews/composable-controller@12.0.1-preview-fe37b4f9a
@metamask-previews/config-registry-controller@0.3.0-preview-fe37b4f9a
@metamask-previews/connectivity-controller@0.2.0-preview-fe37b4f9a
@metamask-previews/controller-utils@11.20.0-preview-fe37b4f9a
@metamask-previews/core-backend@6.2.1-preview-fe37b4f9a
@metamask-previews/delegation-controller@3.0.0-preview-fe37b4f9a
@metamask-previews/earn-controller@12.1.0-preview-fe37b4f9a
@metamask-previews/eip-5792-middleware@3.0.3-preview-fe37b4f9a
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.0-preview-fe37b4f9a
@metamask-previews/eip1193-permission-middleware@2.0.0-preview-fe37b4f9a
@metamask-previews/ens-controller@19.1.1-preview-fe37b4f9a
@metamask-previews/eth-block-tracker@15.0.1-preview-fe37b4f9a
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-fe37b4f9a
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-fe37b4f9a
@metamask-previews/foundryup@1.0.1-preview-fe37b4f9a
@metamask-previews/gas-fee-controller@26.2.0-preview-fe37b4f9a
@metamask-previews/gator-permissions-controller@4.1.0-preview-fe37b4f9a
@metamask-previews/geolocation-controller@0.1.2-preview-fe37b4f9a
@metamask-previews/json-rpc-engine@10.3.0-preview-fe37b4f9a
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-fe37b4f9a
@metamask-previews/keyring-controller@25.5.0-preview-fe37b4f9a
@metamask-previews/logging-controller@8.0.1-preview-fe37b4f9a
@metamask-previews/message-manager@14.1.1-preview-fe37b4f9a
@metamask-previews/messenger@1.2.0-preview-fe37b4f9a
@metamask-previews/messenger-cli@0.2.0-preview-fe37b4f9a
@metamask-previews/money-account-balance-service@0.2.0-preview-fe37b4f9a
@metamask-previews/money-account-controller@0.3.0-preview-fe37b4f9a
@metamask-previews/money-account-upgrade-controller@1.3.1-preview-fe37b4f9a
@metamask-previews/multichain-account-service@9.0.0-preview-fe37b4f9a
@metamask-previews/multichain-api-middleware@3.0.0-preview-fe37b4f9a
@metamask-previews/multichain-network-controller@3.1.0-preview-fe37b4f9a
@metamask-previews/multichain-transactions-controller@7.1.0-preview-fe37b4f9a
@metamask-previews/name-controller@9.1.1-preview-fe37b4f9a
@metamask-previews/network-controller@30.1.0-preview-fe37b4f9a
@metamask-previews/network-enablement-controller@5.1.0-preview-fe37b4f9a
@metamask-previews/notification-services-controller@23.1.0-preview-fe37b4f9a
@metamask-previews/passkey-controller@2.0.1-preview-fe37b4f9a
@metamask-previews/permission-controller@13.1.0-preview-fe37b4f9a
@metamask-previews/permission-log-controller@5.1.0-preview-fe37b4f9a
@metamask-previews/perps-controller@6.0.0-preview-fe37b4f9a
@metamask-previews/phishing-controller@17.1.1-preview-fe37b4f9a
@metamask-previews/polling-controller@16.0.4-preview-fe37b4f9a
@metamask-previews/preferences-controller@23.1.0-preview-fe37b4f9a
@metamask-previews/profile-metrics-controller@3.1.3-preview-fe37b4f9a
@metamask-previews/profile-sync-controller@28.0.2-preview-fe37b4f9a
@metamask-previews/ramps-controller@13.3.0-preview-fe37b4f9a
@metamask-previews/rate-limit-controller@7.0.1-preview-fe37b4f9a
@metamask-previews/react-data-query@0.2.0-preview-fe37b4f9a
@metamask-previews/remote-feature-flag-controller@4.2.0-preview-fe37b4f9a
@metamask-previews/sample-controllers@4.0.4-preview-fe37b4f9a
@metamask-previews/seedless-onboarding-controller@9.1.0-preview-fe37b4f9a
@metamask-previews/selected-network-controller@26.1.1-preview-fe37b4f9a
@metamask-previews/shield-controller@5.1.1-preview-fe37b4f9a
@metamask-previews/signature-controller@39.2.0-preview-fe37b4f9a
@metamask-previews/snap-account-service@0.0.0-preview-fe37b4f9a
@metamask-previews/social-controllers@2.2.0-preview-fe37b4f9a
@metamask-previews/storage-service@1.0.1-preview-fe37b4f9a
@metamask-previews/subscription-controller@6.1.2-preview-fe37b4f9a
@metamask-previews/transaction-controller@65.2.0-preview-fe37b4f9a
@metamask-previews/transaction-pay-controller@21.1.0-preview-fe37b4f9a
@metamask-previews/user-operation-controller@41.2.0-preview-fe37b4f9a

@ccharly ccharly enabled auto-merge May 7, 2026 14:01
Comment thread packages/snap-account-service/src/SnapTracker.ts Outdated
Comment thread packages/snap-account-service/src/SnapTracker.ts Outdated
Comment thread packages/snap-account-service/src/SnapTracker.test.ts Outdated
@ccharly ccharly added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 6b67d84 May 7, 2026
366 checks passed
@ccharly ccharly deleted the cc/feat/snap-account-service-track-snaps branch May 7, 2026 15:23
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