Skip to content

Conversation

@MoMannn
Copy link
Contributor

@MoMannn MoMannn commented Jan 12, 2026

Explanation

What is the current state of things and why does it need to change?

The @metamask/eth-json-rpc-middleware package currently supports two EIP-7715 methods:

  • wallet_requestExecutionPermissions — for requesting new execution permissions
  • wallet_revokeExecutionPermission — for revoking existing execution permissions

However, the EIP-7715 specification also defines two additional "discoverability" methods that allow dApps to query the wallet about its execution permission capabilities. Without these methods, dApps have no way to:

  1. Discover which permission types the wallet supports and on which chains
  2. Retrieve the list of currently granted (non-revoked) permissions for the user

What is the solution your changes offer and how does it work?

This PR adds support for the two missing EIP-7715 discoverability methods:

  • wallet_getSupportedExecutionPermissions — Returns an object keyed by permission type (e.g., native-token-allowance, erc20-token-allowance) with their supported chain IDs and rule types. This allows dApps to understand what the wallet can handle before making permission requests.

  • wallet_getGrantedExecutionPermissions — Returns an array of all currently active (non-revoked) execution permissions. Each permission includes chain ID, addresses, permission details, context, dependencies, and delegation manager information.

The implementation follows the established patterns in this package:

  • Each method has a dedicated handler file with a factory function (createWallet*Handler)
  • Hook-based architecture allows consumers to provide their own processing logic
  • Superstruct schemas are defined for result types, enabling runtime validation
  • Types and structs are exported from the package index for consumer use

Are there any changes whose purpose might not obvious to those unfamiliar with the domain?

The handlers don't perform parameter validation since these methods don't accept parameters (they're pure query methods). This is intentional and differs from wallet_requestExecutionPermissions and wallet_revokeExecutionPermission which validate their params using Superstruct schemas.

References

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Adds EIP-7715 discoverability support enabling dApps to query supported and granted execution permissions.

  • New handlers: wallet_getSupportedExecutionPermissions and wallet_getGrantedExecutionPermissions with hook-based processing (methods/*)
  • Wire-up in createWalletMiddleware to expose both RPC methods
  • Export associated types and Superstruct schemas from src/index.ts
  • Unit tests for new handlers and updated index.test.ts snapshot
  • Update CHANGELOG.md with new RPC methods

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

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.

2 participants