Skip to content

Feat/7702 5792 support#2378

Closed
lwin-kyaw wants to merge 16 commits intov10from
feat/7702-5792-support
Closed

Feat/7702 5792 support#2378
lwin-kyaw wants to merge 16 commits intov10from
feat/7702-5792-support

Conversation

@lwin-kyaw
Copy link

@lwin-kyaw lwin-kyaw commented Feb 17, 2026

Motivation and Context

Summary

Adds EIP-7702 (Account Delegation) and EIP-5792 (Wallet Call API) support to the Web3Auth SDK, enabling dapps to make batch transactions and smart account capabilities through wagmi hooks.

Key Changes

  • Guarded provider for graceful error handling: Introduced createGuardedRawProvider, a Proxy-based provider wrapper that intercepts RPC requests and translates "method not found" errors (-32601) from EIP-7702/5792 methods into clear, developer-friendly rpcErrors.methodNotFound messages (e.g., "Connected wallet does not support wallet_sendCalls"). This prevents cryptic errors from propagating to dapps when a connected wallet doesn't support these methods.

  • Applied guarded provider across all integration points:

    • BaseProvider.request() now checks responses and errors for 7702/5792 method-not-found conditions.
    • Web3AuthNoModal wraps the provider in a guarded proxy before emitting the CONNECTED event.
    • Both @web3auth/no-modal and @web3auth/modal wagmi providers use the guarded provider when setting up connectors.
  • Dependency bump: Upgraded @toruslabs/ethereum-controllers from ^8.15.0 to ^8.17.0 to pull in EIP_5792_METHODS and EIP_7702_METHODS constants.

  • Updated wagmi demo app: Added an EIP-5792 playground section with buttons for useCapabilities, useSendCalls, and useCallsStatus wagmi hooks, demonstrating batch call workflows end-to-end.

Important Note

Currently, only MetaMask and Web3Auth embedded Wallet Services support EIP-5792 methods from the dapp side. Other connected wallets will receive a clear "method not supported" error when attempting to use these methods.

Jira Link: https://consensyssoftware.atlassian.net/browse/W3APD-5325?atlOrigin=eyJpIjoiZTNmNmNkMjc4ODJmNGQ5YTgzYWJiYjhjZWM3MTUyNDUiLCJwIjoiaiJ9

Description

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code requires a db migration.

Note

Medium Risk
Touches wallet transaction flows and introduces new provider RPC method usage (wallet_* EIP-7702/5792), which can affect signing/sending behavior in demos; core logic changes appear limited and mostly additive.

Overview
Adds an EIP-7702/EIP-5792 playground to the Next.js SSR demo Main.tsx, including buttons to call wallet_getAccountUpgradeStatus, wallet_upgradeAccount, wallet_getCapabilities, wallet_sendCalls, and wallet_getCallsStatus, and a simple wagmi “send zero transaction” action with displayed tx hash/errors.

Updates the demo Web3Auth provider config to set defaultChainId and enable walletServicesConfig modal confirmations/login mode. Also refreshes demo lockfiles to @web3auth/modal/@web3auth/no-modal 10.14.1 and related dependency bumps, and fixes a missing newline in demo/react-app-no-modal/src/web3RPC.ts.

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

@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web3auth-web Error Error Feb 23, 2026 5:00pm

Request Review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

@lwin-kyaw lwin-kyaw marked this pull request as ready for review February 23, 2026 17:04
"@toruslabs/http-helpers": "^8.1.1",
"@web3auth/auth": "^10.8.0",
"@web3auth/no-modal": "^10.14.1",
"@web3auth/no-modal": "file:../no-modal",
Copy link
Author

Choose a reason for hiding this comment

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

TODO: update this to published version.

Copy link
Member

Choose a reason for hiding this comment

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

No.. this is linked via lerna

Copy link
Author

Choose a reason for hiding this comment

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

okie. But originally, it uses the npm version.

const guardedProviderMap = new WeakMap<object, IProvider>();
const guardedProviders = new WeakSet<object>(); // We're using Set here to avoid duplicate guarded providers.

export function createGuardedRawProvider(provider: IProvider): IProvider {
Copy link
Member

Choose a reason for hiding this comment

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

this is a good approach but this breaks some chain event emits from our provider strategy.
Pls keep this guarding at connector level.

Also, the best way to check is via making wallet_getCapabilities
and checking for -32602 or 4100 error

Copy link
Author

Choose a reason for hiding this comment

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

the best way to check is via making wallet_getCapabilities
Yes, but I think it would add an extra request if the connector supports it.

@chaitanyapotti
Copy link
Member

Superseded by #2383

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