feat(wallet): wire AddressBookController into default initialization#9291
Open
sirtimid wants to merge 1 commit into
Open
feat(wallet): wire AddressBookController into default initialization#9291sirtimid wants to merge 1 commit into
AddressBookController into default initialization#9291sirtimid wants to merge 1 commit into
Conversation
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>
2b6c3a6 to
3a74600
Compare
Member
Author
|
@metamaskbot publish-previews |
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.
Explanation
Wires the
@metamask/address-book-controllerpackage into@metamask/wallet's default initialization. The defaultWalletnow constructs anAddressBookControllerand exposes itsAddressBookController:*messenger actions (getState/stateChangepluslist/set/delete/clearand thecontactUpdated/contactDeletedevents).The cross-platform compatibility audit found no client divergence: both extension and mobile construct
AddressBookControllerfrom@metamask/address-book-controllerwith only{ messenger, state }, and the controller has no cross-controller messenger dependencies (its messenger carries only its own actions/events). So no injectableinstanceOptionsare needed and none were added — the instance mirrors the other wired default controllers (namespaced child messenger + constructor), and each client keeps supplying only its persistedAddressBookControllerstate viaWalletOptions.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
🤖 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
Walletinitialization now constructsAddressBookControllerand registersAddressBookController:*messenger actions on the root messenger, matching other wired controllers (namespaced child messenger,{ state, messenger }only—no newinstanceOptions).Adds
@metamask/address-book-controlleras 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 (includingWalletstate hydration and messengerset/list).Reviewed by Cursor Bugbot for commit 3a74600. Bugbot is set up for automated code reviews on this repo. Configure here.