feat: migrate eip-5792 & capabilities middleware handlers into monorepo#6422
feat: migrate eip-5792 & capabilities middleware handlers into monorepo#6422
Conversation
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
…re package has them)
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
FrederikBolding
left a comment
There was a problem hiding this comment.
CODEOWNERS LGTM, have not reviewed wallet API specific details.
FrederikBolding
left a comment
There was a problem hiding this comment.
CODEOWNERS change LGTM. Have not reviewed the rest in detail.
…6477) ## Explanation The newly created EIP-5792 Middleware package ([PR #6422](#6422)) currently contains only the hooks required for the existing wallet middleware. To align with the intended abstraction and reduce the monolithic nature of wallet-middleware, we should fully extract the relevant middleware logic from eth-json-rpc-middleware ([GitHub - MetaMask/eth-json-rpc-middleware: Ethereum middleware for composing an Ethereum provider using json-rpc-engine. Intended to replace provider-engine](https://github.com/MetaMask/eth-json-rpc-middleware)) into this new package. This PR moves the identified middleware into @metamask/eip-5792-middleware. <!-- 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 changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> * Fixes https://consensyssoftware.atlassian.net/browse/WAPI-691 ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
…) package (#401) <!-- 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 --> ## Explanation The newly created EIP-5792 Middleware package ([PR #6422](MetaMask/core#6422)) currently contains only the hooks required for the existing wallet middleware. To align with the intended abstraction and reduce the monolithic nature of wallet-middleware, we should fully extract the relevant middleware logic from eth-json-rpc-middleware ([GitHub - MetaMask/eth-json-rpc-middleware: Ethereum middleware for composing an Ethereum provider using json-rpc-engine. Intended to replace provider-engine](https://github.com/MetaMask/eth-json-rpc-middleware)) into this new package. This PR removes the identified middleware into @metamask/eip-5792-middleware. PR [#6477](MetaMask/core#6477) from https://github.com/MetaMask/core moves this middleware to the specified package. * Fixes https://consensyssoftware.atlassian.net/browse/WAPI-691
…) package (#401) <!-- 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 --> ## Explanation The newly created EIP-5792 Middleware package ([PR #6422](#6422)) currently contains only the hooks required for the existing wallet middleware. To align with the intended abstraction and reduce the monolithic nature of wallet-middleware, we should fully extract the relevant middleware logic from eth-json-rpc-middleware ([GitHub - MetaMask/eth-json-rpc-middleware: Ethereum middleware for composing an Ethereum provider using json-rpc-engine. Intended to replace provider-engine](https://github.com/MetaMask/eth-json-rpc-middleware)) into this new package. This PR removes the identified middleware into @metamask/eip-5792-middleware. PR [#6477](#6477) from https://github.com/MetaMask/core moves this middleware to the specified package. * Fixes https://consensyssoftware.atlassian.net/browse/WAPI-691
…) package (#401) <!-- 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 --> ## Explanation The newly created EIP-5792 Middleware package ([PR #6422](MetaMask/core#6422)) currently contains only the hooks required for the existing wallet middleware. To align with the intended abstraction and reduce the monolithic nature of wallet-middleware, we should fully extract the relevant middleware logic from eth-json-rpc-middleware ([GitHub - MetaMask/eth-json-rpc-middleware: Ethereum middleware for composing an Ethereum provider using json-rpc-engine. Intended to replace provider-engine](https://github.com/MetaMask/eth-json-rpc-middleware)) into this new package. This PR removes the identified middleware into @metamask/eip-5792-middleware. PR [#6477](MetaMask/core#6477) from https://github.com/MetaMask/core moves this middleware to the specified package. * Fixes https://consensyssoftware.atlassian.net/browse/WAPI-691
Explanation
We identified duplication in JSON RPC middleware logic between the mobile and extension clients, particularly around the 5792 middleware stack and capability handling. During recent Wallet API and Perps integration discussions, the team agreed this presents an opportunity to abstract and centralize this logic into a core monorepo module.
The motivation here is to:
So the work done on this PR aims to:
eip-5792-middlewareto host shared middleware logic.a. Extension
b. Mobile
References
Checklist