Skip to content

feat(money-account-controller): multi-keyring accounts and default (POC) - #10299

Draft
matthiasgeihs wants to merge 1 commit into
mainfrom
feat/money-account-multi-keyring
Draft

matthiasgeihs wants to merge 1 commit into
mainfrom
feat/money-account-multi-keyring

Conversation

@matthiasgeihs

Copy link
Copy Markdown
Contributor

Summary

  • POC: MoneyAccountController can hold multiple KeyringAccounts from Money and MPC keyrings at once.
  • Adds createMoneyAccount({ keyringType, ... }) (Money: create-if-missing; MPC: existing keyring only + addAccounts(1)), addMoneyAccount, setDefaultMoneyAccount, and persisted defaultMoneyAccountId.
  • Breaking: MoneyAccount is now KeyringAccount; getMoneyAccount() with no args returns the default account, not the primary HD entropy source.

Test plan

  • yarn workspace @metamask/money-account-controller run test
  • Confirm Money create path still mints/reuses a Money Keyring account by entropy source
  • Confirm MPC create path throws if no MPC keyring is registered, and requires keyringId when more than one exists
  • Confirm first create/add sets default; later accounts do not override; setDefaultMoneyAccount switches
  • Confirm addMoneyAccount registers an already-built account without KeyringController calls
  • Confirm clearState clears accounts and default
  • Follow-up: implement MPCKeyring.addAccounts in the accounts repo; do not treat this as client-ready until that lands

Made with Cursor

…lt account

Allow Money and MPC keyring accounts in the same controller, with create/add APIs and getMoneyAccount() resolving to a configurable default.

Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

No deployments
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