-
Notifications
You must be signed in to change notification settings - Fork 543
[SDK] Support EIP7702 execution for ecosystem wallets #7268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDK] Support EIP7702 execution for ecosystem wallets #7268
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 0bcc997 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis change introduces support for the EIP-7702 execution mode in ecosystem wallets, updates type definitions and UI to allow users to select between EIP-4337 and EIP-7702, and refactors smart account option resolution logic for improved maintainability. Several components and types are updated to accommodate the new execution mode. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant EcosystemPermissionsPage
participant AuthOptionsSection
participant AuthOptionsForm
participant ThirdwebClient
participant InAppWalletCore
User->>EcosystemPermissionsPage: Loads permissions page
EcosystemPermissionsPage->>ThirdwebClient: getClientThirdwebClient(authToken, teamId)
EcosystemPermissionsPage->>AuthOptionsSection: Render with client
AuthOptionsSection->>AuthOptionsForm: Render with client
User->>AuthOptionsForm: Selects executionMode (EIP4337 or EIP7702)
AuthOptionsForm->>ThirdwebClient: (If needed) Fetch chain info
AuthOptionsForm->>InAppWalletCore: Submit form with executionMode, sponsorGas, etc.
InAppWalletCore->>InAppWalletCore: resolveSmartAccountOptionsFromEcosystem()
InAppWalletCore->>InAppWalletCore: Set options based on executionMode
Possibly related PRs
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
87d6fd2
to
c515d8b
Compare
c515d8b
to
0bcc997
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (2)
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx (2)
48-53
:⚠️ Potential issue
defaultChainId
must allowundefined
to satisfy current usage
defaultValues
and several validators allowdefaultChainId
to be omitted, but the type marks it as mandatory.
This will fail a strict TypeScript build.- defaultChainId: number; + defaultChainId?: number;
194-218
: 🛠️ Refactor suggestion
accountFactoryAddress
should be conditioned on EIP-4337 onlyWhen
executionMode
isEIP7702
the factory address is irrelevant but still sent.
Safer pattern:- smartAccountOptions = { - defaultChainId: data.defaultChainId, - sponsorGas: data.sponsorGas, - accountFactoryAddress, - executionMode: data.executionMode, - }; + smartAccountOptions = { + defaultChainId: data.defaultChainId, + sponsorGas: data.sponsorGas, + executionMode: data.executionMode, + ...(data.executionMode === "EIP4337" + ? { accountFactoryAddress } + : {}), + };
🧹 Nitpick comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx (1)
103-108
: Minor schema mismatch after makingdefaultChainId
optionalOnce the field is typed
number | undefined
, you can drop the redundant.optional()
call:- defaultChainId: z.coerce.number({ ... }).optional(), + defaultChainId: z.coerce.number({ ... }).optional(),(The call is now consistent with the new optional type, so no behaviour change – purely clarity.)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
.changeset/small-moons-add.md
(1 hunks)apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/EcosystemPermissionsPage.tsx
(3 hunks)apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx
(8 hunks)apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/server/auth-options-section.tsx
(2 hunks)apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/types.ts
(1 hunks)apps/playground-web/src/components/in-app-wallet/ecosystem.tsx
(1 hunks)packages/thirdweb/src/wallets/ecosystem/get-ecosystem-wallet-auth-options.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts
(5 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/EcosystemPermissionsPage.tsx (2)
packages/engine/src/client/client.gen.ts (1)
client
(24-28)apps/dashboard/src/@/constants/thirdweb-client.client.ts (1)
getClientThirdwebClient
(3-11)
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx (2)
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/types.ts (1)
Ecosystem
(21-48)packages/thirdweb/src/exports/thirdweb.ts (1)
ThirdwebClient
(26-26)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Unit Tests
- GitHub Check: Size
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (10)
apps/playground-web/src/components/in-app-wallet/ecosystem.tsx (1)
11-11
: Ecosystem identifier updated for development environment.The change from
"ecosystem.catlovers"
to"ecosystem.catfans"
is a straightforward identifier update for the development ecosystem. This aligns with the broader ecosystem wallet enhancements in this PR..changeset/small-moons-add.md (1)
1-6
: Changeset documentation is properly formatted.The changeset correctly documents the new EIP7702 execution mode support for ecosystem wallets as a patch-level change to the thirdweb package.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/EcosystemPermissionsPage.tsx (3)
2-2
: Import addition looks good.The import of
getClientThirdwebClient
is correctly added to support the new client prop functionality.
22-22
: Client instantiation is properly implemented.The client is correctly created using the provided
authToken
as JWT andteamId
, which aligns with the function signature from the relevant code snippets.
35-35
: Client prop properly passed to AuthOptionsSection.The newly created client instance is correctly passed down to the
AuthOptionsSection
component, enabling the enhanced functionality for EIP7702 execution mode support.apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/types.ts (1)
41-42
: Type definition updates properly support EIP7702 execution mode.The changes correctly:
- Make
accountFactoryAddress
optional, which is appropriate since EIP7702 may not require a factory address- Add the new
executionMode
property with the correct union type supporting both"EIP4337"
and"EIP7702"
- Maintain backward compatibility by making both properties optional
These type updates align well with the PR objectives to introduce EIP7702 execution mode support.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/server/auth-options-section.tsx (1)
12-18
: Prop definition looks goodThe new
client
prop is clearly typed and plumbed through to the child form – no issues spotted here.packages/thirdweb/src/wallets/ecosystem/get-ecosystem-wallet-auth-options.ts (1)
18-20
: Remember to update downstream type-guards / serializers
accountFactoryAddress
is now optional andexecutionMode
added, but consumers ofSmartAccountOptions
(e.g. runtime validators, schema Zod objects, backend responses) may still treat these fields as required / unknown. Double-check anyzod
,io-ts
, or manual checks that touch this shape.apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx (1)
525-529
: VerifySingleNetworkSelector
signatureThe control passes
field.value
(number | undefined) andonChange
(value ⇒ void).
EnsureSingleNetworkSelector
receives exactly these props (chainId?: number
,onChange(id: number)
).packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts (1)
60-99
: Good extraction of ecosystem-specific logicCentralising smart-account resolution removes duplication in three call-sites and keeps the behaviour consistent.
size-limit report 📦
|
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (72.34%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #7268 +/- ##
=======================================
Coverage 55.57% 55.57%
=======================================
Files 909 909
Lines 58680 58667 -13
Branches 4157 4156 -1
=======================================
- Hits 32610 32606 -4
+ Misses 25963 25954 -9
Partials 107 107
🚀 New features to boost your workflow:
|
PR-Codex overview
This PR introduces support for EIP7702 execution in ecosystem wallets, enhancing wallet functionality and options for users. It modifies several components to accommodate this new execution mode and refines the user interface for better interaction.
Detailed summary
executionMode
option to wallet configuration, supporting "EIP4337" and "EIP7702".accountFactoryAddress
to be optional.ecosystemWallet
call from"ecosystem.catlovers"
to"ecosystem.catfans"
.AuthOptionsSection
andAuthOptionsForm
to acceptclient
prop.resolveSmartAccountOptionsFromEcosystem
function to handle options based on ecosystem settings.AuthOptionsForm
to includeexecutionMode
selection.Summary by CodeRabbit