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

EIP-7715 spec alignment for wallet_requestExecutionPermissions

The request/response schema has been updated to align with the latest EIP-7715 specification:

  • Simplified address fields: Replaced the nested address + signer: { type, data: { address } } structure with flat from (optional) and to (required) fields
  • Removed isAdjustmentAllowed from rules: This property is only relevant at the permission level, not individual rules
  • Extended result type: Added dependencies (array of { factory, factoryData }) and delegationManager to the response
  • New export: Added PermissionDependency type export for consumers
  • Consistent address validation: Updated GrantedExecutionPermissionStruct to use HexChecksumAddressStruct for address fields

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

Implements EIP-7715 discoverability methods and integrates them into the wallet middleware.

  • New handlers: createWalletGetSupportedExecutionPermissionsHandler and createWalletGetGrantedExecutionPermissionsHandler using hook-based processing and NoParamsStruct validation
  • Exports new types and structs from index.ts (SupportedExecutionPermissionConfig*, GrantedExecutionPermission*, results)
  • Adds EmptyArrayStruct/NoParamsStruct in utils/structs for "no params" validation
  • Wires methods into createWalletMiddleware via optional processGet* hooks
  • Unit tests for both methods: hook invocation, result passthrough, missing-hook error, and params validation
  • Changelog updated to note new RPC support

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

@MoMannn MoMannn requested a review from mj-kiwi January 13, 2026 09:42
mj-kiwi
mj-kiwi previously approved these changes Jan 13, 2026
Copy link

@mj-kiwi mj-kiwi left a comment

Choose a reason for hiding this comment

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

Let's go

mj-kiwi
mj-kiwi previously approved these changes Jan 13, 2026
@github-project-automation github-project-automation bot moved this to Needs dev review in PR review queue Jan 13, 2026
@MoMannn MoMannn moved this from Needs dev review to Has approvals, needs CODEOWNER in PR review queue Jan 13, 2026
V00D00-child
V00D00-child previously approved these changes Jan 13, 2026
Copy link
Member

@V00D00-child V00D00-child left a comment

Choose a reason for hiding this comment

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

LGTM

mcmire
mcmire previously approved these changes Jan 13, 2026
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.

LGTM.

@github-project-automation github-project-automation bot moved this from Has approvals, needs CODEOWNER to Review finalised - Ready to be merged in PR review queue Jan 13, 2026
@MoMannn MoMannn changed the title feat: support 7715 discoverability methods feat: align with 7715 specification Jan 14, 2026
@MoMannn MoMannn dismissed stale reviews from mcmire and V00D00-child via 9b72205 January 14, 2026 09:33

const { params } = request;

validateParams(params, GetGrantedExecutionPermissionsParamsStruct);
Copy link
Contributor

Choose a reason for hiding this comment

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

we can probably just forgo validation in this case?


### Added

- Support for `wallet_getSupportedExecutionPermissions` and `wallet_getGrantedExecutionPermissions` RPC methods ([#7603](https://github.com/MetaMask/core/pull/7603))
Copy link
Contributor

Choose a reason for hiding this comment

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

PermissionDependency is also exported now


const REQUEST_MOCK = {
params: [],
} as unknown as JsonRpcRequest;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. if we add, id, jsonrpc, and method, we can drop the typecast here and the several below. Seems like the trouble might be worth it

@MoMannn MoMannn added this pull request to the merge queue Jan 14, 2026
Merged via the queue into main with commit d4c3591 Jan 14, 2026
290 checks passed
@MoMannn MoMannn deleted the feat--support-7715-discoverability-methods branch January 14, 2026 19:56
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Jan 21, 2026
## **Description**

This PR updates the codebase to align with API changes in the
`@metamask/gator-permissions-controller` package.

**Reason for the change:**
The upstream `@metamask/gator-permissions-controller` package has
updated its type definitions and data structures. This PR ensures
compatibility with those changes.

**Changes included:**

1. **Type simplification**: Removed the `Signer` generic parameter from
`StoredGatorPermissionSanitized<Signer, PermissionTypesWithCustom>` →
`StoredGatorPermissionSanitized<PermissionTypesWithCustom>` across all
files (selectors, hooks, components, and tests).

2. **Data structure updates**:
- `permissionResponse.address` → `permissionResponse.from` (delegator
address)
- `decodedPermission.signer.data.address` → `decodedPermission.to`
(delegate/recipient address)
- `permissionResponse.signerMeta.delegationManager` →
`permissionResponse.delegationManager` (flattened structure)
- `permission.rules` → `permissionResponse.rules` (rules array location
change)

3. **New RPC methods**: Added support for two new unrestricted methods:
- `wallet_getSupportedExecutionPermissions` - Returns supported
permission types (filtered by enabled advanced permissions)
- `wallet_getGrantedExecutionPermissions` - Returns granted execution
permissions

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/39176?quickstart=1)
## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Added support for
`wallet_getSupportedExecutionPermissions` and
`wallet_getGrantedExecutionPermissions` RPC methods.
CHANGELOG entry: Updated to latest 7715 standart.

## **Related issues**

Depends on: MetaMask/core#7603
Relates to: MetaMask/snap-7715-permissions#249
Requires: MetaMask/core#7634
Requires: MetaMask/snap-7715-permissions#254

## **Manual testing steps**

For manual testing check:
MetaMask/snap-7715-permissions#249

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Updates codebase to the 7715/gator-permissions v1 API and introduces
execution-permissions query RPCs.
> 
> - Refactors to `@metamask/gator-permissions-controller@^1.0.0`: remove
`Signer` generic, move `permission.rules` to `permissionResponse.rules`,
rename `permissionResponse.address`→`from`,
`signerMeta.delegationManager`→`delegationManager`, and decoded
permission `signer...address`→`to`; applies across hooks, selectors,
components, and tests
> - Adds `wallet_getSupportedExecutionPermissions` (filters by enabled
advanced types) and `wallet_getGrantedExecutionPermissions`; wires
through `createMetamaskMiddleware` and forwards to the permissions
kernel snap
> - Bumps related deps (`eth-json-rpc-middleware@^23`,
`permissions-kernel-snap@^1.0.0`, `signature-controller@^39`,
`shield-controller@^5`, etc.) and adjusts LavaMoat policies to use the
updated middleware pathing
> - Updates PPOM/confirmation tests and stories to the new permission
shape; no functional changes beyond API alignment
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
a522169. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Jan 21, 2026
## **Description**

This PR updates the codebase to align with API changes in the
`@metamask/gator-permissions-controller` package.

**Reason for the change:**
The upstream `@metamask/gator-permissions-controller` package has
updated its type definitions and data structures. This PR ensures
compatibility with those changes.

**Changes included:**

1. **Type simplification**: Removed the `Signer` generic parameter from
`StoredGatorPermissionSanitized<Signer, PermissionTypesWithCustom>` →
`StoredGatorPermissionSanitized<PermissionTypesWithCustom>` across all
files (selectors, hooks, components, and tests).

2. **Data structure updates**:
- `permissionResponse.address` → `permissionResponse.from` (delegator
address)
- `decodedPermission.signer.data.address` → `decodedPermission.to`
(delegate/recipient address)
- `permissionResponse.signerMeta.delegationManager` →
`permissionResponse.delegationManager` (flattened structure)
- `permission.rules` → `permissionResponse.rules` (rules array location
change)

3. **New RPC methods**: Added support for two new unrestricted methods:
- `wallet_getSupportedExecutionPermissions` - Returns supported
permission types (filtered by enabled advanced permissions)
- `wallet_getGrantedExecutionPermissions` - Returns granted execution
permissions

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/39176?quickstart=1)
## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Added support for
`wallet_getSupportedExecutionPermissions` and
`wallet_getGrantedExecutionPermissions` RPC methods.
CHANGELOG entry: Updated to latest 7715 standart.

## **Related issues**

Depends on: MetaMask/core#7603
Relates to: MetaMask/snap-7715-permissions#249
Requires: MetaMask/core#7634
Requires: MetaMask/snap-7715-permissions#254

## **Manual testing steps**

For manual testing check:
MetaMask/snap-7715-permissions#249

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Updates codebase to the 7715/gator-permissions v1 API and introduces
execution-permissions query RPCs.
> 
> - Refactors to `@metamask/gator-permissions-controller@^1.0.0`: remove
`Signer` generic, move `permission.rules` to `permissionResponse.rules`,
rename `permissionResponse.address`→`from`,
`signerMeta.delegationManager`→`delegationManager`, and decoded
permission `signer...address`→`to`; applies across hooks, selectors,
components, and tests
> - Adds `wallet_getSupportedExecutionPermissions` (filters by enabled
advanced types) and `wallet_getGrantedExecutionPermissions`; wires
through `createMetamaskMiddleware` and forwards to the permissions
kernel snap
> - Bumps related deps (`eth-json-rpc-middleware@^23`,
`permissions-kernel-snap@^1.0.0`, `signature-controller@^39`,
`shield-controller@^5`, etc.) and adjusts LavaMoat policies to use the
updated middleware pathing
> - Updates PPOM/confirmation tests and stories to the new permission
shape; no functional changes beyond API alignment
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
a522169. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants