Skip to content

feat: add discoverability methods#127

Merged
MoMannn merged 7 commits intomainfrom
feat--add-7715-discoverability-methods
Jan 14, 2026
Merged

feat: add discoverability methods#127
MoMannn merged 7 commits intomainfrom
feat--add-7715-discoverability-methods

Conversation

@MoMannn
Copy link
Contributor

@MoMannn MoMannn commented Jan 12, 2026

📝 Description

This PR adds ERC-7715 discoverability methods (wallet_getSupportedExecutionPermissions and wallet_getGrantedExecutionPermissions) to the smart-accounts-kit package, enabling applications to query wallet capabilities and previously granted permissions. It also includes refactoring to improve code organization and maintainability.

🔄 What Changed?

List the specific changes made:

  • Added erc7715GetSupportedExecutionPermissionsAction to query supported permission types, chain IDs, and rule types from the wallet
  • Added erc7715GetGrantedExecutionPermissionsAction to retrieve all previously granted permissions that haven't been revoked
  • Extended erc7715ProviderActions with getSupportedExecutionPermissions and getGrantedExecutionPermissions methods
  • Extracted shared types into a new erc7715Types.ts file (MetaMaskExtensionSchema, MetaMaskExtensionClient, result types)
  • Moved utility functions (isDefined, assertIsDefined, toHexOrThrow) from the action file to utils.ts for reuse
  • Updated MetaMaskExtensionSchema to include the new RPC method definitions

🚀 Why?

Explain the motivation behind these changes:

  • Applications need to discover what permissions a wallet supports before requesting them, improving UX by preventing unsupported permission requests
  • Applications need to query existing granted permissions to avoid duplicate requests and to display permission status to users
  • Extracting types into a dedicated file creates a cleaner dependency graph and makes the code easier to maintain
  • Moving utility functions to utils.ts enables reuse across the codebase and follows DRY principles

🧪 How to Test?

Describe how to test these changes:

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

⚠️ Breaking Changes

List any breaking changes:

  • No breaking changes
  • Breaking changes (describe below):

📋 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

🔗 Related Issues

Link to related issues:
Closes #
Depends on: MetaMask/metamask-extension#39176

📚 Additional Notes

Any additional information, concerns, or context:


Note

Adds ERC‑7715 discoverability to smart-accounts-kit and refactors shared types/utilities.

  • New actions: erc7715GetSupportedExecutionPermissionsAction and erc7715GetGrantedExecutionPermissionsAction (RPC: wallet_getSupportedExecutionPermissions, wallet_getGrantedExecutionPermissions, retryCount: 0)
  • Extends erc7715ProviderActions with getSupportedExecutionPermissions and getGrantedExecutionPermissions
  • Extracts MetaMaskExtensionSchema, MetaMaskExtensionClient, and result types to src/actions/erc7715Types.ts; updates exports in index.ts
  • Moves isDefined, assertIsDefined, toHexOrThrow into src/utils.ts and updates erc7715RequestExecutionPermissionsAction to use them
  • Adds unit tests for the two new actions and provider extensions

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

@MoMannn MoMannn requested a review from a team as a code owner January 12, 2026 13:47
@MoMannn MoMannn requested a review from mj-kiwi January 13, 2026 10:25
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.

Looking good! Left some minor comments on using revised 7715 types, and there is a small merge conflict that needs resolution.

Copy link
Contributor

@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.

LGTM

@MoMannn MoMannn merged commit 7536fb5 into main Jan 14, 2026
23 of 29 checks passed
@MoMannn MoMannn deleted the feat--add-7715-discoverability-methods branch January 14, 2026 09:51
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.

3 participants