Skip to content

feat(wallet): wire AddressBookController into default initialization#9291

Open
sirtimid wants to merge 1 commit into
mainfrom
sirtimid/wire-address-book-controller
Open

feat(wallet): wire AddressBookController into default initialization#9291
sirtimid wants to merge 1 commit into
mainfrom
sirtimid/wire-address-book-controller

Conversation

@sirtimid

@sirtimid sirtimid commented Jun 26, 2026

Copy link
Copy Markdown
Member

Explanation

Wires the @metamask/address-book-controller package into @metamask/wallet's default initialization. The default Wallet now constructs an AddressBookController and exposes its AddressBookController:* messenger actions (getState/stateChange plus list/set/delete/clear and the contactUpdated/contactDeleted events).

The cross-platform compatibility audit found no client divergence: both extension and mobile construct AddressBookController from @metamask/address-book-controller with only { messenger, state }, and the controller has no cross-controller messenger dependencies (its messenger carries only its own actions/events). So no injectable instanceOptions are needed and none were added — the instance mirrors the other wired default controllers (namespaced child messenger + constructor), and each client keeps supplying only its persisted AddressBookController state via WalletOptions.state.

References

Client adoption PRs (integrate this default into each client): follow-ups; not yet opened. With no divergence, adoption is a mechanical delete-of-local-init + resolve-from-wallet.

Client construction sites (live main):

Jira: 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, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes (follow-up — extension and mobile adoption PRs)

🤖 Generated with Claude Code


Note

Medium Risk
Marked breaking: duplicate AddressBookController registration will collide for extension/mobile until they drop local init; contact data is user-facing but the wiring pattern is low-complexity and well-tested.

Overview
BREAKING: Default Wallet initialization now constructs AddressBookController and registers AddressBookController:* messenger actions on the root messenger, matching other wired controllers (namespaced child messenger, { state, messenger } only—no new instanceOptions).

Adds @metamask/address-book-controller as a wallet dependency, a new initialization instance module, registration in default configurations/exports, TS project references, CODEOWNERS for the init path, README dependency graph edge, and unit/integration tests (including Wallet state hydration and messenger set/list).

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

Wire `AddressBookController` into the default `Wallet` initialization so
the shared integration layer constructs it and exposes its
`AddressBookController:*` messenger actions. Both extension and mobile
construct it from `@metamask/address-book-controller` with only
`{ messenger, state }` and no client-specific options, so no injectable
`instanceOptions` are needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sirtimid sirtimid force-pushed the sirtimid/wire-address-book-controller branch from 2b6c3a6 to 3a74600 Compare June 26, 2026 19:06
@sirtimid sirtimid marked this pull request as ready for review June 26, 2026 19:09
@sirtimid sirtimid requested a review from a team as a code owner June 26, 2026 19:09
@sirtimid sirtimid temporarily deployed to default-branch June 26, 2026 19:09 — with GitHub Actions Inactive
@sirtimid

Copy link
Copy Markdown
Member Author

@metamaskbot publish-previews

@github-actions

Copy link
Copy Markdown
Contributor

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.3-preview-3a7460003
@metamask-previews/accounts-controller@39.0.3-preview-3a7460003
@metamask-previews/address-book-controller@7.1.2-preview-3a7460003
@metamask-previews/ai-controllers@0.7.0-preview-3a7460003
@metamask-previews/analytics-controller@1.2.0-preview-3a7460003
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-3a7460003
@metamask-previews/announcement-controller@8.1.0-preview-3a7460003
@metamask-previews/app-metadata-controller@2.0.1-preview-3a7460003
@metamask-previews/approval-controller@9.0.2-preview-3a7460003
@metamask-previews/assets-controller@9.1.0-preview-3a7460003
@metamask-previews/assets-controllers@109.2.2-preview-3a7460003
@metamask-previews/authenticated-user-storage@2.1.0-preview-3a7460003
@metamask-previews/base-controller@9.1.0-preview-3a7460003
@metamask-previews/base-data-service@0.1.3-preview-3a7460003
@metamask-previews/bitcoin-regtest-up@0.0.0-preview-3a7460003
@metamask-previews/bridge-controller@77.0.0-preview-3a7460003
@metamask-previews/bridge-status-controller@73.1.0-preview-3a7460003
@metamask-previews/build-utils@3.0.4-preview-3a7460003
@metamask-previews/chain-agnostic-permission@1.6.2-preview-3a7460003
@metamask-previews/chomp-api-service@3.1.0-preview-3a7460003
@metamask-previews/claims-controller@0.5.3-preview-3a7460003
@metamask-previews/client-controller@1.0.1-preview-3a7460003
@metamask-previews/compliance-controller@2.1.0-preview-3a7460003
@metamask-previews/composable-controller@12.0.1-preview-3a7460003
@metamask-previews/config-registry-controller@0.4.1-preview-3a7460003
@metamask-previews/connectivity-controller@0.2.0-preview-3a7460003
@metamask-previews/controller-utils@12.3.0-preview-3a7460003
@metamask-previews/core-backend@6.3.3-preview-3a7460003
@metamask-previews/delegation-controller@3.0.2-preview-3a7460003
@metamask-previews/earn-controller@12.2.1-preview-3a7460003
@metamask-previews/eip-5792-middleware@3.0.4-preview-3a7460003
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-3a7460003
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-3a7460003
@metamask-previews/ens-controller@19.1.4-preview-3a7460003
@metamask-previews/eth-block-tracker@15.0.1-preview-3a7460003
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-3a7460003
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-3a7460003
@metamask-previews/foundryup@1.0.1-preview-3a7460003
@metamask-previews/gas-fee-controller@26.2.3-preview-3a7460003
@metamask-previews/gator-permissions-controller@4.2.1-preview-3a7460003
@metamask-previews/geolocation-controller@0.1.3-preview-3a7460003
@metamask-previews/java-tron-up@0.0.0-preview-3a7460003
@metamask-previews/json-rpc-engine@10.5.0-preview-3a7460003
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-3a7460003
@metamask-previews/keyring-controller@27.1.0-preview-3a7460003
@metamask-previews/local-node-utils@0.0.0-preview-3a7460003
@metamask-previews/logging-controller@8.0.2-preview-3a7460003
@metamask-previews/message-manager@14.1.2-preview-3a7460003
@metamask-previews/messenger@1.2.0-preview-3a7460003
@metamask-previews/messenger-cli@0.2.0-preview-3a7460003
@metamask-previews/money-account-balance-service@2.1.1-preview-3a7460003
@metamask-previews/money-account-controller@0.3.3-preview-3a7460003
@metamask-previews/money-account-upgrade-controller@2.1.0-preview-3a7460003
@metamask-previews/multichain-account-service@11.1.0-preview-3a7460003
@metamask-previews/multichain-api-middleware@3.1.5-preview-3a7460003
@metamask-previews/multichain-network-controller@3.2.0-preview-3a7460003
@metamask-previews/multichain-transactions-controller@7.1.1-preview-3a7460003
@metamask-previews/name-controller@9.1.2-preview-3a7460003
@metamask-previews/network-controller@33.0.0-preview-3a7460003
@metamask-previews/network-enablement-controller@5.4.0-preview-3a7460003
@metamask-previews/notification-services-controller@24.2.0-preview-3a7460003
@metamask-previews/passkey-controller@2.0.1-preview-3a7460003
@metamask-previews/permission-controller@13.1.1-preview-3a7460003
@metamask-previews/permission-log-controller@5.1.0-preview-3a7460003
@metamask-previews/perps-controller@9.0.0-preview-3a7460003
@metamask-previews/phishing-controller@17.2.0-preview-3a7460003
@metamask-previews/polling-controller@16.0.7-preview-3a7460003
@metamask-previews/preferences-controller@23.1.0-preview-3a7460003
@metamask-previews/profile-metrics-controller@4.0.0-preview-3a7460003
@metamask-previews/profile-sync-controller@28.2.0-preview-3a7460003
@metamask-previews/ramps-controller@15.0.0-preview-3a7460003
@metamask-previews/rate-limit-controller@7.0.1-preview-3a7460003
@metamask-previews/react-data-query@0.2.1-preview-3a7460003
@metamask-previews/remote-feature-flag-controller@4.2.2-preview-3a7460003
@metamask-previews/sample-controllers@5.0.2-preview-3a7460003
@metamask-previews/seedless-onboarding-controller@10.0.3-preview-3a7460003
@metamask-previews/selected-network-controller@26.1.4-preview-3a7460003
@metamask-previews/shield-controller@5.1.2-preview-3a7460003
@metamask-previews/signature-controller@39.2.6-preview-3a7460003
@metamask-previews/smart-transactions-controller@24.2.3-preview-3a7460003
@metamask-previews/snap-account-service@1.0.0-preview-3a7460003
@metamask-previews/social-controllers@2.3.1-preview-3a7460003
@metamask-previews/solana-test-validator-up@0.0.0-preview-3a7460003
@metamask-previews/storage-service@1.0.2-preview-3a7460003
@metamask-previews/subscription-controller@6.2.0-preview-3a7460003
@metamask-previews/transaction-controller@68.2.0-preview-3a7460003
@metamask-previews/transaction-pay-controller@23.17.1-preview-3a7460003
@metamask-previews/user-operation-controller@41.2.5-preview-3a7460003
@metamask-previews/wallet@5.0.0-preview-3a7460003
@metamask-previews/wallet-cli@0.0.0-preview-3a7460003

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.

1 participant