Skip to content

Conversation

MoMannn
Copy link

@MoMannn MoMannn commented Oct 7, 2025

Explanation

This PR adds RPC methods for upgrading Externally Owned Accounts (EOAs) to EIP-7702 delegator accounts. This functions are only callable by preinstalled snaps. It adds

wallet_upgradeAccount for upgrading the account
wallet_getAccountUpgradeStatus for checking if account is upgraded or not

References

Needed for: MetaMask/metamask-extension#36452

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, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Adds new package implementing internal RPC methods wallet_upgradeAccount and wallet_getAccountUpgradeStatus for EIP-7702 account upgrades, with tests/docs and monorepo wiring (README, tsconfig, ownership).

  • New package: packages/eip-7702-internal-rpc-middleware
    • Methods: wallet_upgradeAccount, wallet_getAccountUpgradeStatus
    • Core: validation utils (validateParams, validateAndNormalizeAddress), constants (METHOD_NAMES, DELEGATION_INDICATOR_PREFIX), types, and hook-based handlers with error handling and EIP-7702 support checks/delegation code parsing.
    • Tooling: Jest tests, Typedoc config, tsconfigs, package metadata, changelog, license.
  • Monorepo integration:
    • Update README.md (package list and graph) and add build reference in tsconfig.build.json.
    • Add ownership: .github/CODEOWNERS and teams.json entries for the new package.

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

@MoMannn MoMannn requested a review from a team as a code owner October 7, 2025 11:56
cursor[bot]

This comment was marked as outdated.

jeffsmale90
jeffsmale90 previously approved these changes Oct 8, 2025
Copy link
Contributor

@jeffsmale90 jeffsmale90 left a comment

Choose a reason for hiding this comment

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

This looks great. A couple minor naming comments.

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Did a brief pass, will do a round 2 later.

One question I had: Is it necessary to add internal-rpc within the package name? We didn't do that for eip-5792-middleware I notice.

@jeffsmale90
Copy link
Contributor

@mcmire

Is it necessary to add internal-rpc within the package name? We didn't do that for eip-5792-middleware I notice.

The reasoning for this is that these RPCs aren't strictly EIP-7702, they're internal RPCs for supporting EIP-7702, not intended for consumption by third parties.

@MoMannn MoMannn self-assigned this Oct 10, 2025
@MoMannn MoMannn requested a review from jiexi October 15, 2025 08:49
@MoMannn MoMannn requested a review from jiexi October 17, 2025 08:59
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