Skip to content

feat(keyring-eth-money): add money account keyring based on hd-key-ring#472

Merged
danroc merged 16 commits intomainfrom
create-cash-account-keyring
Mar 19, 2026
Merged

feat(keyring-eth-money): add money account keyring based on hd-key-ring#472
danroc merged 16 commits intomainfrom
create-cash-account-keyring

Conversation

@Jwhiles
Copy link
Contributor

@Jwhiles Jwhiles commented Mar 9, 2026

Implements a new keyring to support MUSD-386

Examples


Note

Medium Risk
Introduces a new keyring package and extends the public KeyringType enum, which may affect downstream consumers and account derivation behavior if integrated incorrectly.

Overview
Adds a new @metamask/eth-money-keyring package that extends @metamask/eth-hd-keyring with a dedicated type ("Money Keyring"), a fixed derivation path (m/44'/4392018'/0'/0), and enforced single-account behavior (overridden deserialize/addAccounts).

Updates @metamask/keyring-api to include KeyringType.Money (plus type-level tests and changelog), and wires the new package into repo tooling/docs (README module list/graph, root tsconfig.build.json, PR-title scope allowlist, and yarn.lock).

Written by Cursor Bugbot for commit 62f41a9. This will update automatically on new commits. Configure here.

@Jwhiles Jwhiles force-pushed the create-cash-account-keyring branch 5 times, most recently from 5f50434 to ca5f3e9 Compare March 9, 2026 19:10
@Jwhiles Jwhiles force-pushed the create-cash-account-keyring branch from ca5f3e9 to 01e9b64 Compare March 9, 2026 19:19
@danroc
Copy link
Contributor

danroc commented Mar 10, 2026

Should we remove the ability to add accounts directly? We could override addAccounts to only allow 1 account to be added.

Yes, if this is what the product expects, we should enforce it. Otherwise, we might mistakenly create more than one account and end up dealing with this kind of hard-to-solve bug.

@danroc
Copy link
Contributor

danroc commented Mar 10, 2026

Calling it Cash Account for a keyring is a bit confusing because it overlaps with the concept of account. Using just Cash might be clearer.

WDYT @gantunesr, @ccharly ?

@ccharly
Copy link
Contributor

ccharly commented Mar 10, 2026

Calling it Cash Account for a keyring is a bit confusing because it overlaps with the concept of account. Using just Cash might be clearer.

WDYT @gantunesr, @ccharly ?

I think you're right yep!

@Jwhiles Jwhiles force-pushed the create-cash-account-keyring branch from 81d726d to fe35f69 Compare March 10, 2026 10:25
@Jwhiles Jwhiles changed the title feat: add cash account keyring based on hd-key-ring feat(keyring-cash): add cash account keyring based on hd-key-ring Mar 10, 2026
@Jwhiles Jwhiles force-pushed the create-cash-account-keyring branch from 5395223 to b26b341 Compare March 10, 2026 10:52
@Jwhiles Jwhiles marked this pull request as ready for review March 10, 2026 11:35
@Jwhiles Jwhiles requested a review from a team as a code owner March 10, 2026 11:35
@Jwhiles Jwhiles requested review from ccharly and danroc March 10, 2026 11:35
Copy link

@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 3 potential issues.

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

@Jwhiles Jwhiles changed the title feat(keyring-cash): add cash account keyring based on hd-key-ring feat(keyring-eth-cash): add cash account keyring based on hd-key-ring Mar 10, 2026
@Jwhiles Jwhiles requested a review from gantunesr March 10, 2026 15:20
@Jwhiles
Copy link
Contributor Author

Jwhiles commented Mar 10, 2026

@metamaskbot publish-preview

@github-actions
Copy link

Preview builds have been published. See these instructions (from the core monorepo) for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/account-api": "1.0.0-25e4b24",
  "@metamask-previews/hw-wallet-sdk": "0.5.0-25e4b24",
  "@metamask-previews/keyring-api": "21.5.0-25e4b24",
  "@metamask-previews/eth-cash-keyring": "0.0.0-25e4b24",
  "@metamask-previews/eth-hd-keyring": "13.1.0-25e4b24",
  "@metamask-previews/eth-ledger-bridge-keyring": "11.3.0-25e4b24",
  "@metamask-previews/eth-qr-keyring": "1.1.0-25e4b24",
  "@metamask-previews/eth-simple-keyring": "11.0.0-25e4b24",
  "@metamask-previews/eth-trezor-keyring": "9.0.0-25e4b24",
  "@metamask-previews/keyring-internal-api": "10.0.0-25e4b24",
  "@metamask-previews/keyring-internal-snap-client": "9.0.0-25e4b24",
  "@metamask-previews/eth-snap-keyring": "19.0.0-25e4b24",
  "@metamask-previews/keyring-snap-client": "8.2.0-25e4b24",
  "@metamask-previews/keyring-snap-sdk": "7.2.1-25e4b24",
  "@metamask-previews/keyring-utils": "3.2.0-25e4b24"
}

@Jwhiles Jwhiles changed the title feat(keyring-eth-cash): add cash account keyring based on hd-key-ring feat(keyring-eth-money): add money account keyring based on hd-key-ring Mar 19, 2026
Copy link
Contributor

@ccharly ccharly left a comment

Choose a reason for hiding this comment

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

LGTM, we'll follow-up with another PR to re-specialize serialize and deserialize so it matches the keyring's semantic even more (see https://github.com/MetaMask/accounts/pull/472/files#r2959166319)

@danroc danroc added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit a806bb5 Mar 19, 2026
37 of 39 checks passed
@danroc danroc deleted the create-cash-account-keyring branch March 19, 2026 13:41
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.

5 participants