Commit d6a0c20
authored
<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:
* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
Are there any issues or other links reviewers should consult to
understand this pull request better? For instance:
* Fixes #12345
* See: #67890
-->
Related to: https://consensyssoftware.atlassian.net/browse/MUL-1316
## 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]
> Introduces `EthKeyringWrapper` with shared Ethereum `submitRequest`
logic and updates `HdKeyringV2` to extend it, adding RPC param structs,
an `EthKeyring` alias, tests, and required deps.
>
> - **Keyring API**:
> - **New**: `eth/v2/EthKeyringWrapper` abstract class with common
Ethereum request routing (`submitRequest`) and `EthKeyringMethod` enum.
> - **RPC**: Add `EthGetEncryptionPublicKeyOptionsStruct` and
`EthGetEncryptionPublicKeyParamsStruct` (address, optional options).
> - **Exports**: Re-export from `eth/v2` and include new wrapper in
`eth/index`.
> - **Deps**: Add `@ethereumjs/tx` and `@metamask/eth-sig-util`.
> - **Tests**: Add comprehensive unit tests for wrapper routing and
errors.
> - **Keyring ETH HD**:
> - **Refactor**: `HdKeyringV2` now extends `EthKeyringWrapper`; removes
duplicate routing, uses shared methods list including
encryption/app-key/EIP-7702.
> - **Tests**: Adjust to pass address/options for
`eth_getEncryptionPublicKey` and align with wrapper behavior.
> - **Changelog**: Note extension of `EthKeyringWrapper`.
> - **Keyring Utils**:
> - **New**: Export `EthKeyring` type alias for legacy `Keyring`.
> - **Changelog**: Document alias addition.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
22051b5. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
1 parent 2fe2a8d commit d6a0c20
13 files changed
Lines changed: 833 additions & 162 deletions
File tree
- packages
- keyring-api
- src/eth
- rpc
- v2
- keyring-eth-hd
- src
- keyring-utils
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
129 | 137 | | |
130 | 138 | | |
131 | 139 | | |
| |||
214 | 222 | | |
215 | 223 | | |
216 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
0 commit comments