Skip to content

Update erc-7715 client to latest spec#53

Closed
jeffsmale90 wants to merge 1 commit into
mainfrom
cursor/update-erc-7715-client-to-latest-spec-cf1e
Closed

Update erc-7715 client to latest spec#53
jeffsmale90 wants to merge 1 commit into
mainfrom
cursor/update-erc-7715-client-to-latest-spec-cf1e

Conversation

@jeffsmale90

Copy link
Copy Markdown
Collaborator

📝 Description

This PR updates the experimental ERC-7715 client in the delegation toolkit to align with the latest ERC-7715 specification changes.

🔄 What Changed?

  • Renamed the RPC method wallet_grantPermissions to wallet_requestExecutionPermissions.
  • Renamed the client method and action grantPermissions to requestExecutionPermissions.
  • Updated the permission and response object shapes to conform to types defined in @metamask/permission-types.
  • Added developer-friendly formatters for native-token-stream, native-token-periodic, erc20-token-stream, and erc20-token-periodic permission types.
  • Added @metamask/permission-types as a dependency to @metamask/delegation-toolkit.
  • Renamed erc7715GrantPermissionsAction.ts to erc7715RequestExecutionPermissionsAction.ts and updated imports/exports.
  • Removed the expiry field from permission requests, as it is no longer part of the ERC specification.
  • Updated and renamed the associated test file (erc7715GrantPermissionsAction.test.ts to erc7715RequestExecutionPermissionsAction.test.ts).

🚀 Why?

  • To ensure the experimental ERC-7715 client remains compliant with the evolving ERC-7715 standard.
  • To improve developer experience by providing type-safe and convenient input formatting for new permission types.
  • To leverage shared and standardized permission types from the @metamask/permission-types package for consistency across MetaMask projects.

🧪 How to Test?

  • Manual testing steps: N/A
  • Automated tests added/updated
  • All existing tests pass

To run the specific tests for these changes:

  1. yarn workspace @metamask/permission-types run build
  2. yarn workspace @metamask/delegation-toolkit vitest test/experimental/erc7715RequestExecutionPermissionsAction.test.ts

⚠️ Breaking Changes

  • No breaking changes
  • Breaking changes (describe below):
    • The grantPermissions method and action have been renamed to requestExecutionPermissions.
    • The structure of permission request and response objects has changed significantly, requiring updates to how permissions are constructed and consumed.
    • The expiry field is no longer supported in permission requests.

📋 Checklist

Check off completed items:

  • Code follows the project's coding standards
  • Self-review completed
  • Documentation updated (if needed)
  • Tests added/updated
  • Changelog updated (if needed)
  • All CI checks pass (Note: Full monorepo CI may fail due to unrelated package dependencies, but the new code is self-contained and tested.)

🔗 Related Issues

Closes #
Related to #

📚 Additional Notes

The full monorepo build/tests might surface unrelated errors due to missing/resolution failures for @metamask/delegation-abis and @metamask/delegation-core required elsewhere in the toolkit. The new ERC-7715 action code compiles, and its dedicated tests are set up to pass.


Open in Cursor Open in Web

…tation

Co-authored-by: jeff.smale <jeff.smale@consensys.net>
@cursor

cursor Bot commented Aug 7, 2025

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@jeffsmale90 jeffsmale90 closed this Aug 8, 2025
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