-
Notifications
You must be signed in to change notification settings - Fork 619
[SDK] Add documentation for create7702MinimalAccount function #7996
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] Add documentation for create7702MinimalAccount function #7996
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
WalkthroughAdds a new exported factory function Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant Lib as create7702MinimalAccount
participant Client as ThirdwebClient
participant Admin as Admin Account (EOA)
participant MA as MinimalAccount (EIP-7702)
Note over Lib: New factory API
Dev->>Lib: create7702MinimalAccount({ client, adminAccount, sponsorGas? })
Lib->>Client: initialize dependencies / config
Lib->>Admin: bind EOA as admin/delegator (EIP-7702)
Lib->>MA: construct MinimalAccount wrapper
alt sponsorGas enabled
Lib->>MA: enable sponsored-gas handling
end
Lib-->>Dev: return Account (supports batch tx, EIP-5792)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (3)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
✨ Finishing Touches
🧪 Generate unit tests
Comment |
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. |
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: 2
🧹 Nitpick comments (1)
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts (1)
134-139: Grammar: “a EIP-7702” → “an EIP-7702”.- * // Wrap it with a EIP-7702 account + * // Wrap it with an EIP-7702 account
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from@/typeswhere applicable
Prefertypealiases overinterfaceexcept for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size
Files:
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
packages/thirdweb/src/wallets/**
📄 CodeRabbit inference engine (CLAUDE.md)
packages/thirdweb/src/wallets/**: UnifiedWalletandAccountinterfaces in wallet architecture
Support for in-app wallets (social/email login)
Smart wallets with account abstraction
EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Files:
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
packages/thirdweb/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling@exampleand a custom tag (@beta,@internal,@experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g.,const { jsPDF } = await import("jspdf"))
Files:
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Applied to files:
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Unified `Wallet` and `Account` interfaces in wallet architecture
Applied to files:
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Unit Tests
- GitHub Check: Build Packages
- GitHub Check: Size
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts (1)
118-121: Fix the example to use the Account API (and remove a likely non-existent root helper).Use
minimal7702Account.sendBatchTransaction(...)instead of importingsendBatchTransactionfromthirdweb, and destructuretransactionHashfrom the result.- * import { createThirdwebClient, sendBatchTransaction } from "thirdweb"; + * import { createThirdwebClient } from "thirdweb"; * import { privateKeyToAccount } from "thirdweb/wallets"; * import { create7702MinimalAccount } from "thirdweb/wallets/in-app"; * import { sepolia } from "thirdweb/chains"; @@ - * // Send a batch of transactions - * const result = await sendBatchTransaction({ - * account: minimal7702Account, - * transactions: [ - * { - * to: "0x...", - * data: "0x...", - * value: 0n, - * chainId: sepolia.id - * }, - * { - * to: "0x...", - * data: "0x...", - * value: 0n, - * chainId: sepolia.id - * } - * ]}); - * - * console.log("Batch transaction hash:", result.transactionHash); + * // Send a batch of transactions + * const { transactionHash } = await minimal7702Account.sendBatchTransaction([ + * { + * to: "0x...", + * data: "0x...", + * value: 0n, + * chainId: sepolia.id, + * }, + * { + * to: "0x...", + * data: "0x...", + * value: 0n, + * chainId: sepolia.id, + * }, + * ]); + * + * console.log("Batch transaction hash:", transactionHash);Also applies to: 141-160
⛔ Skipped due to learnings
Learnt from: CR PR: thirdweb-dev/js#0 File: CLAUDE.md:0-0 Timestamp: 2025-07-18T19:19:55.613Z Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modulesLearnt from: CR PR: thirdweb-dev/js#0 File: CLAUDE.md:0-0 Timestamp: 2025-07-18T19:19:55.613Z Learning: Applies to packages/thirdweb/src/wallets/** : Unified `Wallet` and `Account` interfaces in wallet architectureLearnt from: CR PR: thirdweb-dev/js#0 File: CLAUDE.md:0-0 Timestamp: 2025-07-18T19:19:55.613Z Learning: Applies to test/src/test-wallets.ts : Predefined test accounts are in `test/src/test-wallets.ts`Learnt from: CR PR: thirdweb-dev/js#0 File: CLAUDE.md:0-0 Timestamp: 2025-07-18T19:19:55.613Z Learning: Applies to packages/thirdweb/src/wallets/** : Smart wallets with account abstractionLearnt from: CR PR: thirdweb-dev/js#0 File: CLAUDE.md:0-0 Timestamp: 2025-07-18T19:19:55.613Z Learning: Applies to packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)
| * ``` | ||
| * | ||
| * @wallet | ||
| */ |
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.
🛠️ Refactor suggestion
Add required stability tag and a short remark per package docs policy.
Public symbols need a custom stability tag; also note the bundler requirement for sponsored gas.
* @wallet
+ * @beta
+ * @remarks Sponsored gas (`sponsorGas: true`) requires a bundler/paymaster setup that supports the `tw_getDelegationContract` RPC on the target chain.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * ``` | |
| * | |
| * @wallet | |
| */ | |
| * |
🤖 Prompt for AI Agents
In packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts around
lines 160-163, the public symbol is missing the required stability JSDoc tag and
a short remark per package docs policy; add a stability tag (e.g., @stability
experimental or @stability stable as appropriate for the package) directly in
the comment block for this exported wallet symbol and append a one-line remark
noting that sponsored-gas functionality requires using a bundler (i.e.,
"Requires a bundler to use sponsored gas") so documentation and tooling can pick
up both the stability level and the bundler requirement.
size-limit report 📦
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7996 +/- ##
=======================================
Coverage 56.63% 56.63%
=======================================
Files 904 904
Lines 58677 58677
Branches 4161 4163 +2
=======================================
Hits 33231 33231
Misses 25340 25340
Partials 106 106
🚀 New features to boost your workflow:
|
6a7d126 to
b68d1c0
Compare

PR-Codex overview
This PR adds a detailed documentation comment for the
create7702MinimalAccountfunction, explaining its purpose, parameters, return value, and providing an example for users.Detailed summary
create7702MinimalAccountfunction.client,adminAccount,sponsorGas.Summary by CodeRabbit