Commit 483677e
authored
feat: add
Related to: https://consensyssoftware.atlassian.net/browse/MUL-1319
## Examples
<!--
Are there any examples of this change being used in another repository?
When considering changes to the MetaMask module template, it's strongly
preferred that the change be experimented with in another repository
first. This gives reviewers a better sense of how the change works,
making it less likely the change will need to be reverted or adjusted
later.
-->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduce `SimpleKeyringV2` wrapping legacy `SimpleKeyring` to expose
the unified Keyring V2 API with EOA support, private-key import/export,
request handling, and robust concurrency/rollback.
>
> - **@metamask/eth-simple-keyring**:
> - **New Adapter**: Add `SimpleKeyringV2` extending `EthKeyringWrapper`
to expose EOA accounts via `KeyringV2`.
> - Supports private-key import (hex) and export; maintains
`KeyringAccount` registry.
> - Routes requests for `eth_signTransaction`, `eth_sign`,
`personal_sign`, `eth_signTypedData_v1/v3/v4`,
`eth_getEncryptionPublicKey`, `eth_decrypt`, `eth_getAppKeyAddress`,
`eth_signEip7702Authorization`.
> - Adds mutex-based concurrency control and transactional rollback for
safe imports; implements account deletion.
> - **Tests**: Add comprehensive tests for account CRUD, exports,
request handling, concurrency, and registry syncing.
> - **Build/Deps**: Add deps `@metamask/keyring-api`, `async-mutex`;
update TS project references; update CHANGELOG.
> - **@metamask/keyring-api**:
> - Update `KeyringWrapper` docs to reference the account "registry"
(not "resolver").
> - **README**:
> - Update dependency graph to add `eth_simple_keyring --> keyring_api`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
a6aef0d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->SimpleKeyringV2 (#409)1 parent 6133e50 commit 483677e
File tree
9 files changed
+1343
-3
lines changed- packages
- keyring-api/src/api/v2/wrapper
- keyring-eth-simple
- src
9 files changed
+1343
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
0 commit comments