Skip to content

Conversation

jeffsmale90
Copy link
Contributor

@jeffsmale90 jeffsmale90 commented Aug 18, 2025

Adds methods wallet_requestExecutionPermissions and wallet_revokeExecutionPermission, as defined in this revision of the EIP-7715 specification ethereum/ERCs#1098.

This supports Readable Permissions project, and is related to the following PRs:

Note: workflows are failing due to existing problems, fixed by #397

@jeffsmale90 jeffsmale90 force-pushed the feat/eip7715_executionPermissions branch from 6eb865b to 4f8bc87 Compare August 18, 2025 21:19
@jeffsmale90 jeffsmale90 force-pushed the feat/eip7715_executionPermissions branch from 4f8bc87 to f339980 Compare August 18, 2025 21:26
@jeffsmale90 jeffsmale90 changed the title add methods to support EIP-7715 feat: add RPC methods described in (revised) EIP-7715 Aug 19, 2025
@jeffsmale90 jeffsmale90 marked this pull request as ready for review August 19, 2025 07:28
@jeffsmale90 jeffsmale90 requested review from a team as code owners August 19, 2025 07:28
cursor[bot]

This comment was marked as outdated.

it('throws if no hook', async () => {
await expect(
walletRequestExecutionPermissions(request, response, {}),
).rejects.toMatchInlineSnapshot(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Curious, why are we using a snapshot in these tests rather than .toThrow(new Error(...))?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's a bit silly - I think it was due to the complex error messages. I've replaced it with the more succinct error reason.

…to 5792 and 7715 async middleware to match correct naming.
@jeffsmale90 jeffsmale90 requested a review from mcmire August 20, 2025 21:48
): Promise<void> {
if (!processRequestExecutionPermissions) {
throw rpcErrors.resourceNotFound(
'wallet_requestExecutionPermissions - no middleware configured',
Copy link

Choose a reason for hiding this comment

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

we are throwing methodNotSupported() in the 5792 methods. Thoughts on doing the same here?

https://github.com/MetaMask/eth-json-rpc-middleware/blob/main/src/methods/wallet-get-calls-status.ts#L62C21-L62C39

Copy link

@jiexi jiexi left a comment

Choose a reason for hiding this comment

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

functionally LGTM. I have some concerns regarding spec about if isAdjustmentAllowed should even be included as it ultimately is a proxy for something optional and if something is not strictly required for execution then IMO it should not be included in the request by the dapp

Please ping for re-approval if you feel that my nit above is fair

Comment on lines +88 to +89
res.result = await processRequestExecutionPermissions(params, req);
}
Copy link
Contributor

@adonesky1 adonesky1 Aug 26, 2025

Choose a reason for hiding this comment

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

I believe you'll need to pass end in as a param as well for the JSON RPC Engine to handle this gracefully

Suggested change
res.result = await processRequestExecutionPermissions(params, req);
}
res.result = await processRequestExecutionPermissions(params, req);
return end()
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess they aren't doing this in the 5792 methods you used as a model. Need to figure out why that's ok 🤔

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