-
Notifications
You must be signed in to change notification settings - Fork 567
[SDK] Add EIP-5792 support to Coinbase and refactor wallet capabilities #7732
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 EIP-5792 support to Coinbase and refactor wallet capabilities #7732
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 718941b The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 update standardizes and extends EIP-5792 support across multiple wallet implementations. It introduces or refactors Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant Wallet
participant Account
App->>Wallet: getAccount()
Wallet->>Account: (returns Account object)
App->>Account: sendCalls(options)
Account->>Account: (optional) validate and prepare calls
Account->>Account: (optional) switch chain if needed
Account->>Account: (optional) provider call or delegate to utility
Account-->>App: SendCallsResult
App->>Account: getCallsStatus({ id, chain, client })
Account->>Account: (optional) provider call or delegate to utility
Account-->>App: GetCallsStatusResponse
App->>Account: getCapabilities({ chainId })
Account->>Account: (optional) provider call or static capability response
Account-->>App: GetCapabilitiesResult or message
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Complexity:
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (2)
✨ Finishing Touches
🧪 Generate unit tests
🪧 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. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7732 +/- ##
==========================================
- Coverage 56.66% 56.24% -0.42%
==========================================
Files 908 905 -3
Lines 58831 58876 +45
Branches 4204 4138 -66
==========================================
- Hits 33335 33115 -220
- Misses 25387 25656 +269
+ Partials 109 105 -4
🚀 New features to boost your workflow:
|
e1af198
to
19cf1d2
Compare
size-limit report 📦
|
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: 10
🔭 Outside diff range comments (2)
packages/thirdweb/src/wallets/eip5792/send-calls.ts (1)
176-178
: Clarify error message for call validationThe error message states that either
to
ordata
must be provided, but the condition checks if both are undefined. This could be confusing as it implies an OR relationship but enforces an AND condition.- if (to === undefined && call.data === undefined) { - throw new Error("Cannot send call, `to` or `data` must be provided."); + if (to === undefined && call.data === undefined) { + throw new Error("Cannot send call, both `to` and `data` are undefined. At least one must be provided.");packages/thirdweb/src/wallets/eip5792/get-capabilities.ts (1)
18-19
: Fix inconsistency between documentation and implementationThe JSDoc states "This function is dependent on the wallet's support for EIP-5792, but will not throw", but the implementation throws an error when the wallet doesn't support EIP-5792.
Either update the documentation or change the implementation to return an error message:
- throw new Error( - `Failed to get capabilities, wallet ${wallet.id} does not support EIP-5792`, - ); + return { + message: `Failed to get capabilities, wallet ${wallet.id} does not support EIP-5792`, + };Also applies to: 50-52
🧹 Nitpick comments (7)
packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts (1)
289-300
: Add test coverage for getCapabilities methodWhile the implementation looks correct, this method lacks test coverage according to static analysis.
Would you like me to generate unit tests for the new EIP-5792 methods?
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts (1)
298-324
: Remove unused sendBatchTransaction mockThe
sendBatchTransaction
mock is defined but never used in the test.const smartAccount = { ...TEST_ACCOUNT_A, - sendBatchTransaction: vi.fn(), sendCalls: async (options: SendCallsOptions) => {
packages/thirdweb/src/wallets/eip5792/send-calls.ts (2)
186-201
: Simplify conditional logic for call preparationThe nested conditional structure can be simplified for better readability.
- if (_to) { - return { - data: _data as Hex, - to: getAddress(_to), - value: - typeof _value === "bigint" || typeof _value === "number" - ? numberToHex(_value) - : undefined, - }; - } - - return { - data: _data as Hex, - to: undefined, - value: undefined, - }; + return { + data: _data as Hex, + to: _to ? getAddress(_to) : undefined, + value: _to && (typeof _value === "bigint" || typeof _value === "number") + ? numberToHex(_value) + : undefined, + };
157-218
: Add test coverage for toProviderCallParamsThe static analysis indicates that the
toProviderCallParams
function lacks test coverage. This is a critical utility function that handles parameter conversion for EIP-5792 calls.Would you like me to generate comprehensive unit tests for the
toProviderCallParams
function to ensure proper handling of various edge cases?packages/thirdweb/src/wallets/injected/index.ts (2)
323-327
: Consider more robust error detectionThe regex pattern
/unsupport|not support/i
might not catch all variations of unsupported method errors from different wallet providers.- if (/unsupport|not support/i.test((error as Error).message)) { + const errorMessage = (error as Error).message?.toLowerCase() || ''; + const unsupportedPatterns = ['unsupport', 'not support', 'method not found', 'unknown method']; + if (unsupportedPatterns.some(pattern => errorMessage.includes(pattern))) {
308-365
: Add test coverage for EIP-5792 methodsThe static analysis indicates that all three new methods (
sendCalls
,getCallsStatus
,getCapabilities
) lack test coverage. These are critical methods for EIP-5792 support.Would you like me to generate unit tests for these three methods to ensure proper functionality and error handling?
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts (1)
63-70
: Simplify capability copying logicThe inner loop that copies capabilities is unnecessary since you're creating a new object anyway.
- capabilities[Number(chainId)] = {}; - const capabilitiesCopy = {} as WalletCapabilities; - for (const [key, value] of Object.entries(capabilities_)) { - capabilitiesCopy[key] = value; - } - capabilities[Number(chainId)] = capabilitiesCopy; + capabilities[Number(chainId)] = { ...capabilities_ };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
.changeset/early-queens-drive.md
(1 hunks)apps/playground-web/src/components/account-abstraction/5792-get-capabilities.tsx
(2 hunks)packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
(2 hunks)packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
(4 hunks)packages/thirdweb/src/wallets/eip5792/get-calls-status.ts
(1 hunks)packages/thirdweb/src/wallets/eip5792/get-capabilities.test.ts
(1 hunks)packages/thirdweb/src/wallets/eip5792/get-capabilities.ts
(1 hunks)packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
(5 hunks)packages/thirdweb/src/wallets/eip5792/send-calls.ts
(5 hunks)packages/thirdweb/src/wallets/in-app/core/eip5972/in-app-wallet-calls.ts
(3 hunks)packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
(2 hunks)packages/thirdweb/src/wallets/injected/index.ts
(3 hunks)packages/thirdweb/src/wallets/interfaces/wallet.ts
(3 hunks)packages/thirdweb/src/wallets/smart/index.ts
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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@/types
or localtypes.ts
barrels
Prefer type aliases over interface except for nominal shapes
Avoidany
andunknown
unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial
,Pick
, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
apps/playground-web/src/components/account-abstraction/5792-get-capabilities.tsx
packages/thirdweb/src/wallets/in-app/core/eip5972/in-app-wallet-calls.ts
packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts
packages/thirdweb/src/wallets/eip5792/get-capabilities.test.ts
packages/thirdweb/src/wallets/smart/index.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
packages/thirdweb/src/wallets/interfaces/wallet.ts
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts
packages/thirdweb/src/wallets/injected/index.ts
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
packages/thirdweb/src/wallets/eip5792/send-calls.ts
packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/playground-web/src/components/account-abstraction/5792-get-capabilities.tsx
packages/thirdweb/src/wallets/in-app/core/eip5972/in-app-wallet-calls.ts
packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts
packages/thirdweb/src/wallets/eip5792/get-capabilities.test.ts
packages/thirdweb/src/wallets/smart/index.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
packages/thirdweb/src/wallets/interfaces/wallet.ts
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts
packages/thirdweb/src/wallets/injected/index.ts
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
packages/thirdweb/src/wallets/eip5792/send-calls.ts
packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
apps/{dashboard,playground-web}/**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
apps/{dashboard,playground-web}/**/*.{ts,tsx}
: Import UI primitives from@/components/ui/*
(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
UseNavLink
for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Usecn()
from@/lib/utils
for conditional class logic
Use design system tokens (e.g.,bg-card
,border-border
,text-muted-foreground
)
Server Components (Node edge): Start files withimport "server-only";
Client Components (browser): Begin files with'use client';
Always callgetAuthToken()
to retrieve JWT from cookies on server side
UseAuthorization: Bearer
header – never embed tokens in URLs
Return typed results (e.g.,Project[]
,User[]
) – avoidany
Wrap client-side data fetching calls in React Query (@tanstack/react-query
)
Use descriptive, stablequeryKeys
for React Query cache hits
ConfigurestaleTime
/cacheTime
in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never importposthog-js
in server components
Files:
apps/playground-web/src/components/account-abstraction/5792-get-capabilities.tsx
packages/thirdweb/src/wallets/**
📄 CodeRabbit Inference Engine (CLAUDE.md)
packages/thirdweb/src/wallets/**
: UnifiedWallet
andAccount
interfaces 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/eip5972/in-app-wallet-calls.ts
packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts
packages/thirdweb/src/wallets/eip5792/get-capabilities.test.ts
packages/thirdweb/src/wallets/smart/index.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
packages/thirdweb/src/wallets/interfaces/wallet.ts
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts
packages/thirdweb/src/wallets/injected/index.ts
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
packages/thirdweb/src/wallets/eip5792/send-calls.ts
packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
**/*.test.{ts,tsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
**/*.test.{ts,tsx}
: Place tests alongside code:foo.ts
↔foo.test.ts
Use real function invocations with stub data in tests; avoid brittle mocks
Use Mock Service Worker (MSW) for fetch/HTTP call interception in tests
Keep tests deterministic and side-effect free
UseFORKED_ETHEREUM_CHAIN
for mainnet interactions andANVIL_CHAIN
for isolated tests
Files:
packages/thirdweb/src/wallets/eip5792/get-capabilities.test.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
🧠 Learnings (16)
📓 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
Learnt from: joaquim-verges
PR: thirdweb-dev/js#7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
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
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 abstraction
Learnt 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`
.changeset/early-queens-drive.md (9)
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
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:82-90
Timestamp: 2025-06-13T13:03:41.732Z
Learning: The thirdweb contract
object is serializable and can safely be used in contexts (e.g., React-Query keys) that require serializable values.
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/** : Support for in-app wallets (social/email login)
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt from: MananTank
PR: #7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of defineChain
. When it's necessary to use defineChain
directly, it's acceptable to disable the rule with // eslint-disable-next-line no-restricted-syntax
.
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 abstraction
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
Learnt from: MananTank
PR: #7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
apps/playground-web/src/components/account-abstraction/5792-get-capabilities.tsx (14)
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
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/** : Support for in-app wallets (social/email login)
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
Learnt 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 abstraction
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Import UI primitives from @/components/ui/*
(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt from: MananTank
PR: #7434
File: apps/dashboard/src/app/(app)/team///contract/[chain]/[contractAddress]/components/project-selector.tsx:62-76
Timestamp: 2025-06-24T21:38:03.155Z
Learning: In the project-selector.tsx component for contract imports, the addToProject.mutate() call is intentionally not awaited (fire-and-forget pattern) to allow immediate navigation to the contract page while the import happens in the background. This is a deliberate design choice to prioritize user experience.
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
Learnt from: MananTank
PR: #7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from @tanstack/react-query
or thirdweb SDKs.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Client Components (browser): Begin files with 'use client';
packages/thirdweb/src/wallets/in-app/core/eip5972/in-app-wallet-calls.ts (14)
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
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
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
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/** : Support for in-app wallets (social/email login)
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 abstraction
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use FORKED_ETHEREUM_CHAIN
for mainnet interactions and ANVIL_CHAIN
for isolated tests
Learnt 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: MananTank
PR: #7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of defineChain
. When it's necessary to use defineChain
directly, it's acceptable to disable the rule with // eslint-disable-next-line no-restricted-syntax
.
Learnt from: MananTank
PR: #7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from @tanstack/react-query
or thirdweb SDKs.
Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:82-90
Timestamp: 2025-06-13T13:03:41.732Z
Learning: The thirdweb contract
object is serializable and can safely be used in contexts (e.g., React-Query keys) that require serializable values.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Auto-generated contracts from ABI definitions in extensions
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts (5)
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
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 abstraction
Learnt 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/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
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/** : Support for in-app wallets (social/email login)
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts (11)
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
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
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 abstraction
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt 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: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from @tanstack/react-query
or thirdweb SDKs.
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
Learnt from: MananTank
PR: #7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
packages/thirdweb/src/wallets/eip5792/get-capabilities.test.ts (8)
Learnt 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/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
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
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use FORKED_ETHEREUM_CHAIN
for mainnet interactions and ANVIL_CHAIN
for isolated tests
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 abstraction
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side-effect free
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
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/** : Support for in-app wallets (social/email login)
packages/thirdweb/src/wallets/smart/index.ts (6)
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 abstraction
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
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
Learnt 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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Auto-generated contracts from ABI definitions in extensions
packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts (11)
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
Learnt 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/** : Unified Wallet
and Account
interfaces in wallet architecture
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use FORKED_ETHEREUM_CHAIN
for mainnet interactions and ANVIL_CHAIN
for isolated tests
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side-effect free
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use real function invocations with stub data in tests; avoid brittle mocks
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 abstraction
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
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/** : Support for in-app wallets (social/email login)
Learnt from: jnsdls
PR: #7364
File: apps/dashboard/src/app/(app)/account/components/AccountHeader.tsx:36-41
Timestamp: 2025-06-18T02:13:34.500Z
Learning: In the logout flow in apps/dashboard/src/app/(app)/account/components/AccountHeader.tsx, when doLogout()
fails, the cleanup steps (resetAnalytics(), wallet disconnect, router refresh) should NOT execute. This is intentional to maintain consistency - if server-side logout fails, client-side cleanup should not occur.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use Mock Service Worker (MSW) for fetch/HTTP call interception in tests
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts (11)
Learnt 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/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
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
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 abstraction
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use FORKED_ETHEREUM_CHAIN
for mainnet interactions and ANVIL_CHAIN
for isolated tests
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side-effect free
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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use real function invocations with stub data in tests; avoid brittle mocks
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use Mock Service Worker (MSW) for fetch/HTTP call interception in tests
Learnt from: jnsdls
PR: #7364
File: apps/dashboard/src/app/(app)/account/components/AccountHeader.tsx:36-41
Timestamp: 2025-06-18T02:13:34.500Z
Learning: In the logout flow in apps/dashboard/src/app/(app)/account/components/AccountHeader.tsx, when doLogout()
fails, the cleanup steps (resetAnalytics(), wallet disconnect, router refresh) should NOT execute. This is intentional to maintain consistency - if server-side logout fails, client-side cleanup should not occur.
packages/thirdweb/src/wallets/interfaces/wallet.ts (16)
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
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
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 abstraction
Learnt 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/** : Support for in-app wallets (social/email login)
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Auto-generated contracts from ABI definitions in extensions
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from @tanstack/react-query
or thirdweb SDKs.
Learnt from: MananTank
PR: #7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:82-90
Timestamp: 2025-06-13T13:03:41.732Z
Learning: The thirdweb contract
object is serializable and can safely be used in contexts (e.g., React-Query keys) that require serializable values.
Learnt from: MananTank
PR: #7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of defineChain
. When it's necessary to use defineChain
directly, it's acceptable to disable the rule with // eslint-disable-next-line no-restricted-syntax
.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/components/*.client.tsx : Client components must start with 'use client';
before imports.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Client Components (browser): Begin files with 'use client';
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts (9)
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
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
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
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 abstraction
Learnt 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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/exports/react.native.ts : React Native specific exports are in src/exports/react.native.ts
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
packages/thirdweb/src/wallets/injected/index.ts (10)
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
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
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 abstraction
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/** : Support for in-app wallets (social/email login)
Learnt 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: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Auto-generated contracts from ABI definitions in extensions
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use FORKED_ETHEREUM_CHAIN
for mainnet interactions and ANVIL_CHAIN
for isolated tests
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/exports/react.native.ts : React Native specific exports are in src/exports/react.native.ts
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts (8)
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
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
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt 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 abstraction
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Auto-generated contracts from ABI definitions in extensions
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/** : Support for in-app wallets (social/email login)
Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:82-90
Timestamp: 2025-06-13T13:03:41.732Z
Learning: The thirdweb contract
object is serializable and can safely be used in contexts (e.g., React-Query keys) that require serializable values.
packages/thirdweb/src/wallets/eip5792/send-calls.ts (11)
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
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
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 abstraction
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt 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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from @tanstack/react-query
or thirdweb SDKs.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/components/*.client.tsx : Client components must start with 'use client';
before imports.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Client Components (browser): Begin files with 'use client';
packages/thirdweb/src/wallets/coinbase/coinbase-web.ts (7)
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
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
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 abstraction
Learnt 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/** : Support for in-app wallets (social/email login)
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Auto-generated contracts from ABI definitions in extensions
🪛 GitHub Check: codecov/patch
packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
[warning] 268-282: packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts#L268-L282
Added lines #L268 - L282 were not covered by tests
[warning] 284-288: packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts#L284-L288
Added lines #L284 - L288 were not covered by tests
[warning] 290-300: packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts#L290-L300
Added lines #L290 - L300 were not covered by tests
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts
[warning] 78-87: packages/thirdweb/src/wallets/eip5792/get-calls-status.ts#L78-L87
Added lines #L78 - L87 were not covered by tests
[warning] 89-89: packages/thirdweb/src/wallets/eip5792/get-calls-status.ts#L89
Added line #L89 was not covered by tests
[warning] 91-96: packages/thirdweb/src/wallets/eip5792/get-calls-status.ts#L91-L96
Added lines #L91 - L96 were not covered by tests
[warning] 98-110: packages/thirdweb/src/wallets/eip5792/get-calls-status.ts#L98-L110
Added lines #L98 - L110 were not covered by tests
packages/thirdweb/src/wallets/smart/index.ts
[warning] 370-384: packages/thirdweb/src/wallets/smart/index.ts#L370-L384
Added lines #L370 - L384 were not covered by tests
[warning] 386-390: packages/thirdweb/src/wallets/smart/index.ts#L386-L390
Added lines #L386 - L390 were not covered by tests
[warning] 392-402: packages/thirdweb/src/wallets/smart/index.ts#L392-L402
Added lines #L392 - L402 were not covered by tests
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts
[warning] 56-59: packages/thirdweb/src/wallets/eip5792/get-capabilities.ts#L56-L59
Added lines #L56 - L59 were not covered by tests
[warning] 63-67: packages/thirdweb/src/wallets/eip5792/get-capabilities.ts#L63-L67
Added lines #L63 - L67 were not covered by tests
[warning] 69-69: packages/thirdweb/src/wallets/eip5792/get-capabilities.ts#L69
Added line #L69 was not covered by tests
[warning] 71-72: packages/thirdweb/src/wallets/eip5792/get-capabilities.ts#L71-L72
Added lines #L71 - L72 were not covered by tests
packages/thirdweb/src/wallets/injected/index.ts
[warning] 309-330: packages/thirdweb/src/wallets/injected/index.ts#L309-L330
Added lines #L309 - L330 were not covered by tests
[warning] 332-346: packages/thirdweb/src/wallets/injected/index.ts#L332-L346
Added lines #L332 - L346 were not covered by tests
[warning] 348-365: packages/thirdweb/src/wallets/injected/index.ts#L348-L365
Added lines #L348 - L365 were not covered by tests
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
[warning] 180-194: packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts#L180-L194
Added lines #L180 - L194 were not covered by tests
[warning] 196-200: packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts#L196-L200
Added lines #L196 - L200 were not covered by tests
[warning] 202-212: packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts#L202-L212
Added lines #L202 - L212 were not covered by tests
packages/thirdweb/src/wallets/eip5792/send-calls.ts
[warning] 157-164: packages/thirdweb/src/wallets/eip5792/send-calls.ts#L157-L164
Added lines #L157 - L164 were not covered by tests
[warning] 166-171: packages/thirdweb/src/wallets/eip5792/send-calls.ts#L166-L171
Added lines #L166 - L171 were not covered by tests
[warning] 186-195: packages/thirdweb/src/wallets/eip5792/send-calls.ts#L186-L195
Added lines #L186 - L195 were not covered by tests
[warning] 199-200: packages/thirdweb/src/wallets/eip5792/send-calls.ts#L199-L200
Added lines #L199 - L200 were not covered by tests
[warning] 205-205: packages/thirdweb/src/wallets/eip5792/send-calls.ts#L205
Added line #L205 was not covered by tests
[warning] 217-217: packages/thirdweb/src/wallets/eip5792/send-calls.ts#L217
Added line #L217 was not covered by tests
packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
[warning] 281-302: packages/thirdweb/src/wallets/coinbase/coinbase-web.ts#L281-L302
Added lines #L281 - L302 were not covered by tests
[warning] 304-318: packages/thirdweb/src/wallets/coinbase/coinbase-web.ts#L304-L318
Added lines #L304 - L318 were not covered by tests
[warning] 320-337: packages/thirdweb/src/wallets/coinbase/coinbase-web.ts#L320-L337
Added lines #L320 - L337 were not covered by tests
⏰ 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). (3)
- GitHub Check: Size
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (16)
apps/playground-web/src/components/account-abstraction/5792-get-capabilities.tsx (1)
32-37
: LGTM! In-app wallet integration for EIP-5792 testing.The addition of
inAppWallet
with EIP7702 execution mode and gas sponsorship is correctly implemented and aligns with the PR's goal of improving EIP-5792 support.packages/thirdweb/src/wallets/in-app/core/eip5972/in-app-wallet-calls.ts (1)
1-1
: Good architectural simplification.Changing the function signature to accept
chain
directly instead of extracting it fromwallet
improves modularity and testability. This aligns well with the overall refactoring to delegate wallet-specific logic to account methods.Also applies to: 55-61
packages/thirdweb/src/wallets/smart/index.ts (1)
369-402
: Add smart wallet EIP-5792 integration testsThe
sendCalls
,getCallsStatus
, andgetCapabilities
methods in
packages/thirdweb/src/wallets/smart/index.ts
(lines 369–402) are not directly exercised by our existing tests. To ensure full coverage and guard against regressions, please add unit tests that:
- Create a smart wallet instance via
createWallet("smart")
, mock or spy on the imported in-app EIP-5972 module, and assert:
sendCalls({ wallet, calls, chain })
delegates toinAppWalletSendCalls
and returns{ client, chain, id }
.getCallsStatus({ wallet, client, id })
delegates toinAppWalletGetCallsStatus
and returns its response.- Invoke
getCapabilities({ wallet, chainId })
with and withoutsponsorGas
enabled and verify the returned structure matches the hard-coded atomic/paymasterService support flags.You can place these tests under:
packages/thirdweb/src/wallets/smart/__tests__/{send-calls,test-get-calls-status,test-get-capabilities}.test.ts
fix_required
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts (1)
44-70
: Excellent simplification of the getCallsStatus function.The refactoring to delegate to
account.getCallsStatus
removes complex conditional logic and aligns with the unified wallet architecture. The error messages are clear and helpful.packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts (1)
182-182
: LGTM!Good refactoring to assign the account to a constant, enabling internal referencing within the new EIP-5792 methods.
packages/thirdweb/src/wallets/interfaces/wallet.ts (2)
5-5
: LGTM!The new imports are properly organized and necessary for the EIP-5792 interface additions.
Also applies to: 16-24
314-333
: Well-designed interface extensions for EIP-5792 supportThe new optional methods are properly typed and follow good interface design principles. The
Omit
utility type usage forsendCalls
appropriately keeps the account interface decoupled from wallet concerns.packages/thirdweb/src/wallets/eip5792/send-calls.test.ts (2)
45-128
: Comprehensive test coverage for sendCalls delegationThe test suite properly covers error scenarios and delegation behavior, including the important chain switching functionality.
130-243
: Good coverage of injected wallet behaviorThe tests effectively simulate injected wallet account behavior, including proper error handling for unsupported methods.
packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts (2)
14-97
: Thorough error handling test coverageThe tests comprehensively cover all error scenarios with descriptive error messages that include the wallet ID for better debugging.
99-249
: Well-structured wallet-specific testsThe tests effectively simulate wallet-specific behaviors and error conditions, providing good coverage for both injected and in-app wallet scenarios.
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts (2)
201-212
: Correct capabilities implementationThe getCapabilities method properly reflects the 7702 minimal account's support for atomic transactions and conditional paymaster service based on the
sponsorGas
flag.
239-240
: Acceptable lint suppression with TODOThe lint suppression is reasonable given the TODO comment indicating future type improvements.
packages/thirdweb/src/wallets/injected/index.ts (1)
347-365
: Well-implemented error handling for getCapabilitiesThe implementation properly returns a user-friendly message instead of throwing when the method is unsupported, which aligns with the documented behavior of not throwing errors.
packages/thirdweb/src/wallets/eip5792/get-capabilities.test.ts (1)
1-306
: Well-structured test refactoringThe test suite has been excellently refactored to align with the new delegation pattern. Good coverage of edge cases including no account connected, missing support, and various wallet types.
packages/thirdweb/src/wallets/coinbase/coinbase-web.ts (1)
280-337
: Consistent EIP-5792 implementationThe implementation of
sendCalls
,getCallsStatus
, andgetCapabilities
methods is consistent with other wallet implementations, which is excellent for maintainability.
"thirdweb": patch | ||
--- | ||
|
||
Improve EIP5792 support |
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
Expand the changeset description to reflect the scope of changes.
The current description "Improve EIP5792 support" is too vague. Based on the PR changes, this should detail the specific improvements made, such as adding sendCalls
, getCallsStatus
, and getCapabilities
methods to wallet accounts and refactoring the EIP-5792 implementation.
-Improve EIP5792 support
+Improve EIP5792 support
+
+- Add `sendCalls`, `getCallsStatus`, and `getCapabilities` methods to wallet Account interface
+- Implement EIP-5792 methods for injected, Coinbase, smart, in-app, and enclave wallets
+- Refactor core EIP-5792 functions to delegate to wallet account methods
+- Add in-app wallet with EIP-5792 execution mode support to playground
📝 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.
Improve EIP5792 support | |
Improve EIP5792 support | |
- Add `sendCalls`, `getCallsStatus`, and `getCapabilities` methods to wallet Account interface | |
- Implement EIP-5792 methods for injected, Coinbase, smart, in-app, and enclave wallets | |
- Refactor core EIP-5792 functions to delegate to wallet account methods | |
- Add in-app wallet with EIP-5792 execution mode support to playground |
🤖 Prompt for AI Agents
In the .changeset/early-queens-drive.md file at line 5, the changeset
description is too vague. Update the description to explicitly mention the
specific improvements made, including the addition of sendCalls, getCallsStatus,
and getCapabilities methods to wallet accounts, as well as the refactoring of
the EIP-5792 implementation, to clearly reflect the scope of changes.
sendCalls: async (options) => { | ||
try { | ||
const { callParams, chain } = await toProviderCallParams( | ||
options, | ||
account, | ||
); | ||
const callId = await provider.request({ | ||
method: "wallet_sendCalls", | ||
params: callParams, | ||
}); | ||
if (callId && typeof callId === "object" && "id" in callId) { | ||
return { chain, client, id: callId.id as string }; | ||
} | ||
return { chain, client, id: callId as string }; | ||
} catch (error) { | ||
if (/unsupport|not support/i.test((error as Error).message)) { | ||
throw new Error( | ||
`${COINBASE} errored calling wallet_sendCalls, with error: ${error instanceof Error ? error.message : stringify(error)}`, | ||
); | ||
} | ||
throw error; | ||
} | ||
}, | ||
async getCallsStatus(options) { | ||
try { | ||
const rawResponse = (await provider.request({ | ||
method: "wallet_getCallsStatus", | ||
params: [options.id], | ||
})) as GetCallsStatusRawResponse; | ||
return toGetCallsStatusResponse(rawResponse); | ||
} catch (error) { | ||
if (/unsupport|not support/i.test((error as Error).message)) { | ||
throw new Error( | ||
`${COINBASE} does not support wallet_getCallsStatus, reach out to them directly to request EIP-5792 support.`, | ||
); | ||
} | ||
throw error; | ||
} | ||
}, | ||
async getCapabilities(options) { | ||
const chainId = options.chainId; | ||
try { | ||
const result = (await provider.request({ | ||
method: "wallet_getCapabilities", | ||
params: [getAddress(account.address)], | ||
})) as Record<string, WalletCapabilities>; | ||
return toGetCapabilitiesResult(result, chainId); | ||
} catch (error: unknown) { | ||
if ( | ||
/unsupport|not support|not available/i.test((error as Error).message) | ||
) { | ||
return { | ||
message: `${COINBASE} does not support wallet_getCapabilities, reach out to them directly to request EIP-5792 support.`, | ||
}; | ||
} | ||
throw error; | ||
} | ||
}, |
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.
💡 Verification agent
🧩 Analysis chain
Add test coverage for Coinbase EIP-5792 methods
Static analysis indicates these critical EIP-5792 methods lack test coverage.
Would you like me to create test cases for the Coinbase wallet's EIP-5792 implementation?
🏁 Script executed:
#!/bin/bash
# Check if there are any tests for Coinbase wallet EIP-5792 functionality
fd -e test.ts -e test.tsx . | xargs rg -l "coinbase.*sendCalls|coinbase.*getCallsStatus|coinbase.*getCapabilities" -i
Length of output: 119
🏁 Script executed:
#!/bin/bash
# Further verify test coverage for Coinbase EIP-5792 methods
# Search across all .test.ts and .test.tsx files for both wrapper and raw RPC method names
rg -l "sendCalls|getCallsStatus|getCapabilities|wallet_sendCalls|wallet_getCallsStatus|wallet_getCapabilities" -g "*.test.ts" -g "*.test.tsx"
Length of output: 395
Add tests for Coinbase wallet’s EIP-5792 wrapper methods
We have core EIP-5792 utilities covered under src/wallets/eip5792/*.test.ts
, but the Coinbase‐specific wrapper in packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
still lacks direct test coverage. Please add tests to validate:
• sendCalls
– correct provider.request parameters for wallet_sendCalls
– handling of both object‐ID and string‐ID responses
– error mapping when unsupported
• getCallsStatus
– provider.request is called with wallet_getCallsStatus
and the passed ID
– correct transformation via toGetCallsStatusResponse
– error mapping when unsupported
• getCapabilities
– provider.request is called with wallet_getCapabilities
and the account address
– correct transformation via toGetCapabilitiesResult
– fallback message
when unsupported
Suggested location:
– Create packages/thirdweb/src/wallets/coinbase/coinbase-web.test.ts
to cover these methods.
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 281-302: packages/thirdweb/src/wallets/coinbase/coinbase-web.ts#L281-L302
Added lines #L281 - L302 were not covered by tests
[warning] 304-318: packages/thirdweb/src/wallets/coinbase/coinbase-web.ts#L304-L318
Added lines #L304 - L318 were not covered by tests
[warning] 320-337: packages/thirdweb/src/wallets/coinbase/coinbase-web.ts#L320-L337
Added lines #L320 - L337 were not covered by tests
🤖 Prompt for AI Agents
In packages/thirdweb/src/wallets/coinbase/coinbase-web.ts around lines 280 to
337, the Coinbase wallet's EIP-5792 wrapper methods lack direct test coverage.
Add a new test file packages/thirdweb/src/wallets/coinbase/coinbase-web.test.ts
and write tests for sendCalls to verify correct provider.request calls with
"wallet_sendCalls", handling both object-ID and string-ID responses, and error
mapping for unsupported errors. Similarly, test getCallsStatus to ensure
provider.request is called with "wallet_getCallsStatus" and the passed ID,
correct transformation via toGetCallsStatusResponse, and error mapping. For
getCapabilities, test that provider.request is called with
"wallet_getCapabilities" and the account address, the correct transformation via
toGetCapabilitiesResult, and the fallback message when unsupported. Mock
dependencies and provider requests as needed to isolate and validate behavior.
export function toGetCallsStatusResponse( | ||
response: GetCallsStatusRawResponse, | ||
): GetCallsStatusResponse { | ||
const [status, statusCode] = (() => { | ||
const statusCode = response.status; | ||
if (statusCode >= 100 && statusCode < 200) | ||
return ["pending", statusCode] as const; | ||
if (statusCode >= 200 && statusCode < 300) | ||
return ["success", statusCode] as const; | ||
if (statusCode >= 300 && statusCode < 700) | ||
return ["failure", statusCode] as const; | ||
// @ts-expect-error: for backwards compatibility | ||
if (statusCode === "CONFIRMED") return ["success", 200] as const; | ||
// @ts-expect-error: for backwards compatibility | ||
if (statusCode === "PENDING") return ["pending", 100] as const; | ||
return [undefined, statusCode]; | ||
})(); | ||
return { | ||
...response, | ||
atomic: response.atomic, | ||
// @ts-expect-error: for backwards compatibility | ||
chainId: response.chainId ? hexToNumber(response.chainId) : undefined, | ||
receipts: | ||
response.receipts?.map((receipt) => ({ | ||
...receipt, | ||
blockNumber: hexToBigInt(receipt.blockNumber), | ||
gasUsed: hexToBigInt(receipt.gasUsed), | ||
status: receiptStatuses[receipt.status as "0x0" | "0x1"], | ||
})) ?? [], | ||
status, | ||
statusCode, | ||
version: response.version, | ||
}; | ||
} |
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.
💡 Verification agent
🧩 Analysis chain
Add test coverage and improve type safety for the helper function.
The toGetCallsStatusResponse
function handles complex status mapping and backwards compatibility but lacks test coverage. Additionally, the @ts-expect-error
comments indicate type safety issues that should be addressed.
Consider creating a dedicated test file for this utility function to ensure all edge cases and backwards compatibility scenarios are properly tested.
🏁 Script executed:
#!/bin/bash
# Check if this function is tested elsewhere
rg -A 10 "toGetCallsStatusResponse" --glob "*.test.ts" --glob "*.test.tsx"
# Check the type definitions to understand the backwards compatibility requirements
ast-grep --pattern 'type GetCallsStatusRawResponse = {
$$$
}'
Length of output: 1687
Add test coverage and tighten types for toGetCallsStatusResponse
The helper correctly handles numeric and legacy status codes and hex-to-number conversions but currently:
- Has no dedicated tests for its edge cases
- Relies on
@ts-expect-error
to mask type mismatches
To improve reliability and type safety:
• Add a new test file (e.g. get-calls-status.test.ts
) covering:
– Numeric status ranges (100–199 → “pending”, 200–299 → “success”, 300–699 → “failure”)
– Legacy "CONFIRMED"
→ [“success”, 200]
and "PENDING"
→ [“pending”, 100]
– chainId
conversion from hex string to number
– Receipt mapping (blockNumber, gasUsed, and status conversion via receiptStatuses
)
• Refine the raw and response types to remove the need for @ts-expect-error
:
// packages/thirdweb/src/wallets/eip5792/types.ts
export type GetCallsStatusRawResponse = {
version: string;
id: `0x${string}`;
- status: number; // See "Status Codes"
+ status: number | "CONFIRMED" | "PENDING"; // Include legacy statuses
atomic: boolean;
receipts?: {
// ...
}[];
- chainId: `0x${string}`;
+ chainId: `0x${string}`; // always present
};
// packages/thirdweb/src/wallets/eip5792/get-calls-status.ts
export function toGetCallsStatusResponse(
response: GetCallsStatusRawResponse,
): GetCallsStatusResponse {
const [status, statusCode] = (() => {
const statusCode = response.status;
if (statusCode >= 100 && statusCode < 200)
return ["pending", statusCode] as const;
if (statusCode >= 200 && statusCode < 300)
return ["success", statusCode] as const;
if (statusCode >= 300 && statusCode < 700)
return ["failure", statusCode] as const;
- // @ts-expect-error: for backwards compatibility
if (statusCode === "CONFIRMED") return ["success", 200] as const;
- // @ts-expect-error: for backwards compatibility
if (statusCode === "PENDING") return ["pending", 100] as const;
return [undefined, statusCode];
})();
return {
...response,
atomic: response.atomic,
- // @ts-expect-error: for backwards compatibility
- chainId: response.chainId ? hexToNumber(response.chainId) : undefined,
+ chainId: hexToNumber(response.chainId),
receipts:
response.receipts?.map((receipt) => ({
...receipt,
blockNumber: hexToBigInt(receipt.blockNumber),
gasUsed: hexToBigInt(receipt.gasUsed),
status: receiptStatuses[receipt.status as "0x0" | "0x1"],
})) ?? [],
status,
statusCode,
version: response.version,
};
}
These changes remove the need for @ts-expect-error
, enforce correct types at compile time, and ensure full test coverage of all mapping logic.
📝 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.
export function toGetCallsStatusResponse( | |
response: GetCallsStatusRawResponse, | |
): GetCallsStatusResponse { | |
const [status, statusCode] = (() => { | |
const statusCode = response.status; | |
if (statusCode >= 100 && statusCode < 200) | |
return ["pending", statusCode] as const; | |
if (statusCode >= 200 && statusCode < 300) | |
return ["success", statusCode] as const; | |
if (statusCode >= 300 && statusCode < 700) | |
return ["failure", statusCode] as const; | |
// @ts-expect-error: for backwards compatibility | |
if (statusCode === "CONFIRMED") return ["success", 200] as const; | |
// @ts-expect-error: for backwards compatibility | |
if (statusCode === "PENDING") return ["pending", 100] as const; | |
return [undefined, statusCode]; | |
})(); | |
return { | |
...response, | |
atomic: response.atomic, | |
// @ts-expect-error: for backwards compatibility | |
chainId: response.chainId ? hexToNumber(response.chainId) : undefined, | |
receipts: | |
response.receipts?.map((receipt) => ({ | |
...receipt, | |
blockNumber: hexToBigInt(receipt.blockNumber), | |
gasUsed: hexToBigInt(receipt.gasUsed), | |
status: receiptStatuses[receipt.status as "0x0" | "0x1"], | |
})) ?? [], | |
status, | |
statusCode, | |
version: response.version, | |
}; | |
} | |
export function toGetCallsStatusResponse( | |
response: GetCallsStatusRawResponse, | |
): GetCallsStatusResponse { | |
const [status, statusCode] = (() => { | |
const statusCode = response.status; | |
if (statusCode >= 100 && statusCode < 200) | |
return ["pending", statusCode] as const; | |
if (statusCode >= 200 && statusCode < 300) | |
return ["success", statusCode] as const; | |
if (statusCode >= 300 && statusCode < 700) | |
return ["failure", statusCode] as const; | |
if (statusCode === "CONFIRMED") return ["success", 200] as const; | |
if (statusCode === "PENDING") return ["pending", 100] as const; | |
return [undefined, statusCode]; | |
})(); | |
return { | |
...response, | |
atomic: response.atomic, | |
chainId: hexToNumber(response.chainId), | |
receipts: | |
response.receipts?.map((receipt) => ({ | |
...receipt, | |
blockNumber: hexToBigInt(receipt.blockNumber), | |
gasUsed: hexToBigInt(receipt.gasUsed), | |
status: receiptStatuses[receipt.status as "0x0" | "0x1"], | |
})) ?? [], | |
status, | |
statusCode, | |
version: response.version, | |
}; | |
} |
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 78-87: packages/thirdweb/src/wallets/eip5792/get-calls-status.ts#L78-L87
Added lines #L78 - L87 were not covered by tests
[warning] 89-89: packages/thirdweb/src/wallets/eip5792/get-calls-status.ts#L89
Added line #L89 was not covered by tests
[warning] 91-96: packages/thirdweb/src/wallets/eip5792/get-calls-status.ts#L91-L96
Added lines #L91 - L96 were not covered by tests
[warning] 98-110: packages/thirdweb/src/wallets/eip5792/get-calls-status.ts#L98-L110
Added lines #L98 - L110 were not covered by tests
🤖 Prompt for AI Agents
In packages/thirdweb/src/wallets/eip5792/get-calls-status.ts around lines 77 to
110, the function toGetCallsStatusResponse lacks dedicated tests for edge cases
and uses @ts-expect-error to bypass type mismatches. To fix this, create a new
test file named get-calls-status.test.ts that covers all status code mappings
including numeric ranges and legacy string codes, verifies chainId hex-to-number
conversion, and tests receipt field mappings. Additionally, refine the
TypeScript types for the raw response and the output response to accurately
represent possible values and remove the need for @ts-expect-error comments,
ensuring type safety and correctness at compile time.
return ( | ||
typeof chainId === "number" ? capabilities[chainId] : capabilities | ||
) as never; |
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
Avoid type assertion with 'as never'
Using as never
type assertion bypasses TypeScript's type checking and could hide type errors.
- return (
- typeof chainId === "number" ? capabilities[chainId] : capabilities
- ) as never;
+ if (typeof chainId === "number") {
+ return capabilities[chainId] || {} as GetCapabilitiesResult;
+ }
+ return capabilities;
📝 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.
return ( | |
typeof chainId === "number" ? capabilities[chainId] : capabilities | |
) as never; | |
if (typeof chainId === "number") { | |
return capabilities[chainId] || {} as GetCapabilitiesResult; | |
} | |
return capabilities; |
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 71-72: packages/thirdweb/src/wallets/eip5792/get-capabilities.ts#L71-L72
Added lines #L71 - L72 were not covered by tests
🤖 Prompt for AI Agents
In packages/thirdweb/src/wallets/eip5792/get-capabilities.ts around lines 71 to
73, remove the 'as never' type assertion because it bypasses TypeScript's type
checking and can hide errors. Instead, refine the return type properly by
defining or adjusting the function's return type to match the possible outputs,
ensuring TypeScript can correctly infer or check the types without forcing a
cast to 'never'.
if (wallet.getChain()?.id !== callChain.id) { | ||
await wallet.switchChain(callChain); | ||
} |
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 null check for wallet.getChain()
The optional chaining on wallet.getChain()?.id
could result in comparing undefined !== callChain.id
, which would always be true when the wallet doesn't have a current chain.
- if (wallet.getChain()?.id !== callChain.id) {
- await wallet.switchChain(callChain);
+ const currentChain = wallet.getChain();
+ if (!currentChain || currentChain.id !== callChain.id) {
+ await wallet.switchChain(callChain);
📝 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.
if (wallet.getChain()?.id !== callChain.id) { | |
await wallet.switchChain(callChain); | |
} | |
// before: if wallet.getChain() returns undefined, undefined !== callChain.id is always true | |
- if (wallet.getChain()?.id !== callChain.id) { | |
- await wallet.switchChain(callChain); | |
- } | |
+ const currentChain = wallet.getChain(); | |
+ if (!currentChain || currentChain.id !== callChain.id) { | |
+ await wallet.switchChain(callChain); | |
+ } |
🤖 Prompt for AI Agents
In packages/thirdweb/src/wallets/eip5792/send-calls.ts around lines 138 to 140,
add a null check for the result of wallet.getChain() before accessing its id to
avoid comparing undefined with callChain.id. Modify the condition to first check
if wallet.getChain() is not null or undefined, then compare the chain ids. This
prevents always entering the if block when the current chain is absent.
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
Outdated
Show resolved
Hide resolved
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
Outdated
Show resolved
Hide resolved
packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
Outdated
Show resolved
Hide resolved
packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
Outdated
Show resolved
Hide resolved
19cf1d2
to
36ea49c
Compare
36ea49c
to
b87a16c
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
♻️ Duplicate comments (1)
packages/thirdweb/src/wallets/eip5792/send-calls.ts (1)
138-140
: Add null check for wallet.getChain()The optional chaining on
wallet.getChain()?.id
could result in comparingundefined !== callChain.id
, which would always be true when the wallet doesn't have a current chain.- if (wallet.getChain()?.id !== callChain.id) { - await wallet.switchChain(callChain); + const currentChain = wallet.getChain(); + if (!currentChain || currentChain.id !== callChain.id) { + await wallet.switchChain(callChain);
🧹 Nitpick comments (2)
packages/thirdweb/src/wallets/in-app/core/eip5792/in-app-wallet-calls.ts (1)
39-46
: Consider adding error handling for partial executionIf a transaction fails in the middle of the loop, previous transactions will have been executed but the bundle will be in an inconsistent state. Consider wrapping this in a try-catch and storing the partial results, or documenting this behavior.
} else { + try { for (const tx of calls) { const receipt = await sendAndConfirmTransaction({ account, transaction: tx, }); hashes.push(receipt.transactionHash); bundlesToTransactions.set(id, hashes); } + } catch (error) { + // Store partial results for status tracking + bundlesToTransactions.set(id, hashes); + throw error; + } }packages/thirdweb/src/wallets/eip5792/send-calls.test.ts (1)
327-327
: Reminder: Add Coinbase SDK testsThe TODO indicates missing test coverage for Coinbase wallet functionality. Please ensure these tests are added to maintain comprehensive coverage.
Do you want me to generate the Coinbase SDK test cases or open a new issue to track this task?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
.changeset/early-queens-drive.md
(1 hunks)apps/playground-web/src/components/account-abstraction/5792-get-capabilities.tsx
(2 hunks)packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
(2 hunks)packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
(4 hunks)packages/thirdweb/src/wallets/eip5792/get-calls-status.ts
(1 hunks)packages/thirdweb/src/wallets/eip5792/get-capabilities.test.ts
(1 hunks)packages/thirdweb/src/wallets/eip5792/get-capabilities.ts
(1 hunks)packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
(5 hunks)packages/thirdweb/src/wallets/eip5792/send-calls.ts
(5 hunks)packages/thirdweb/src/wallets/in-app/core/eip5792/in-app-wallet-calls.ts
(3 hunks)packages/thirdweb/src/wallets/in-app/core/eip5972/in-app-wallet-capabilities.ts
(0 hunks)packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
(3 hunks)packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
(2 hunks)packages/thirdweb/src/wallets/injected/index.ts
(3 hunks)packages/thirdweb/src/wallets/interfaces/wallet.ts
(3 hunks)packages/thirdweb/src/wallets/smart/index.ts
(3 hunks)packages/thirdweb/src/wallets/smart/lib/smart-wallet-capabilities.ts
(0 hunks)
💤 Files with no reviewable changes (2)
- packages/thirdweb/src/wallets/in-app/core/eip5972/in-app-wallet-capabilities.ts
- packages/thirdweb/src/wallets/smart/lib/smart-wallet-capabilities.ts
🚧 Files skipped from review as they are similar to previous changes (11)
- .changeset/early-queens-drive.md
- packages/thirdweb/src/wallets/eip5792/get-calls-status.ts
- packages/thirdweb/src/wallets/interfaces/wallet.ts
- packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
- apps/playground-web/src/components/account-abstraction/5792-get-capabilities.tsx
- packages/thirdweb/src/wallets/eip5792/get-capabilities.ts
- packages/thirdweb/src/wallets/eip5792/get-capabilities.test.ts
- packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
- packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
- packages/thirdweb/src/wallets/injected/index.ts
- packages/thirdweb/src/wallets/smart/index.ts
🧰 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@/types
or localtypes.ts
barrels
Prefer type aliases over interface except for nominal shapes
Avoidany
andunknown
unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial
,Pick
, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
packages/thirdweb/src/wallets/in-app/core/eip5792/in-app-wallet-calls.ts
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
packages/thirdweb/src/wallets/eip5792/send-calls.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/eip5792/in-app-wallet-calls.ts
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
packages/thirdweb/src/wallets/eip5792/send-calls.ts
packages/thirdweb/src/wallets/**
📄 CodeRabbit Inference Engine (CLAUDE.md)
packages/thirdweb/src/wallets/**
: UnifiedWallet
andAccount
interfaces 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/eip5792/in-app-wallet-calls.ts
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
packages/thirdweb/src/wallets/eip5792/send-calls.ts
**/*.test.{ts,tsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
**/*.test.{ts,tsx}
: Place tests alongside code:foo.ts
↔foo.test.ts
Use real function invocations with stub data in tests; avoid brittle mocks
Use Mock Service Worker (MSW) for fetch/HTTP call interception in tests
Keep tests deterministic and side-effect free
UseFORKED_ETHEREUM_CHAIN
for mainnet interactions andANVIL_CHAIN
for isolated tests
Files:
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
🧠 Learnings (5)
📓 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
Learnt from: joaquim-verges
PR: thirdweb-dev/js#7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
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/** : Support for in-app wallets (social/email login)
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
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
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 abstraction
Learnt 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`
packages/thirdweb/src/wallets/in-app/core/eip5792/in-app-wallet-calls.ts (14)
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
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
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt 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 abstraction
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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use FORKED_ETHEREUM_CHAIN
for mainnet interactions and ANVIL_CHAIN
for isolated tests
Learnt from: MananTank
PR: #7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of defineChain
. When it's necessary to use defineChain
directly, it's acceptable to disable the rule with // eslint-disable-next-line no-restricted-syntax
.
Learnt from: MananTank
PR: #7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from @tanstack/react-query
or thirdweb SDKs.
Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:82-90
Timestamp: 2025-06-13T13:03:41.732Z
Learning: The thirdweb contract
object is serializable and can safely be used in contexts (e.g., React-Query keys) that require serializable values.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Auto-generated contracts from ABI definitions in extensions
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts (11)
Learnt 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/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
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
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 abstraction
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use FORKED_ETHEREUM_CHAIN
for mainnet interactions and ANVIL_CHAIN
for isolated tests
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/** : Support for in-app wallets (social/email login)
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use real function invocations with stub data in tests; avoid brittle mocks
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side-effect free
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use Mock Service Worker (MSW) for fetch/HTTP call interception in tests
Learnt from: jnsdls
PR: #7364
File: apps/dashboard/src/app/(app)/account/components/AccountHeader.tsx:36-41
Timestamp: 2025-06-18T02:13:34.500Z
Learning: In the logout flow in apps/dashboard/src/app/(app)/account/components/AccountHeader.tsx, when doLogout()
fails, the cleanup steps (resetAnalytics(), wallet disconnect, router refresh) should NOT execute. This is intentional to maintain consistency - if server-side logout fails, client-side cleanup should not occur.
packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts (12)
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
Learnt 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 **/*.test.{ts,tsx} : Use FORKED_ETHEREUM_CHAIN
for mainnet interactions and ANVIL_CHAIN
for isolated tests
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
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side-effect free
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use real function invocations with stub data in tests; avoid brittle mocks
Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
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 abstraction
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/** : Support for in-app wallets (social/email login)
Learnt from: jnsdls
PR: #7364
File: apps/dashboard/src/app/(app)/account/components/AccountHeader.tsx:36-41
Timestamp: 2025-06-18T02:13:34.500Z
Learning: In the logout flow in apps/dashboard/src/app/(app)/account/components/AccountHeader.tsx, when doLogout()
fails, the cleanup steps (resetAnalytics(), wallet disconnect, router refresh) should NOT execute. This is intentional to maintain consistency - if server-side logout fails, client-side cleanup should not occur.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use Mock Service Worker (MSW) for fetch/HTTP call interception in tests
packages/thirdweb/src/wallets/eip5792/send-calls.ts (16)
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
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
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 abstraction
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt 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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use FORKED_ETHEREUM_CHAIN
for mainnet interactions and ANVIL_CHAIN
for isolated tests
Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/components/table.tsx:304-313
Timestamp: 2025-05-26T16:27:26.443Z
Learning: The useChainSlug
hook returns a string
, not string | undefined
. When the input chainId is undefined or falsy, the hook returns an empty string "", but never returns undefined itself.
Learnt from: MananTank
PR: #7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of defineChain
. When it's necessary to use defineChain
directly, it's acceptable to disable the rule with // eslint-disable-next-line no-restricted-syntax
.
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenPriceData.ts:49-49
Timestamp: 2025-05-27T19:55:25.056Z
Learning: In the ERC20 public pages token price data hook (useTokenPriceData.ts
), direct array access on json.data[0]
without optional chaining is intentionally correct and should not be changed to use safety checks.
Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/components/table.tsx:304-313
Timestamp: 2025-05-26T16:27:26.443Z
Learning: The useChainSlug
hook returns string | number
, not string | undefined
as previously assumed. It does not return undefined values.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from @tanstack/react-query
or thirdweb SDKs.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/components/*.client.tsx : Client components must start with 'use client';
before imports.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Client Components (browser): Begin files with 'use client';
⏰ 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)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Size
- GitHub Check: Unit Tests
- GitHub Check: Build Packages
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (11)
packages/thirdweb/src/wallets/in-app/core/eip5792/in-app-wallet-calls.ts (1)
55-101
: LGTM! Clean refactor to accept chain directlyThe function correctly implements the EIP-5792 getCallsStatus interface. The refactor to accept
chain
directly simplifies the function and aligns with the broader architectural changes.packages/thirdweb/src/wallets/eip5792/send-calls.ts (1)
157-218
: LGTM! Well-structured helper functionThe
toProviderCallParams
function properly prepares EIP-5792 call parameters with appropriate validation and formatting. This abstraction supports the unified approach to EIP-5792 implementation across wallet types.packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts (9)
10-12
: LGTM: Simplified mock structure aligns with refactored implementation.The hoisted mock has been appropriately simplified to only include
getCallsStatus
, reflecting the architectural shift towards account method delegation.
14-34
: LGTM: Proper error handling test for missing account.The test correctly verifies that the function fails when no account is present, with appropriate error messaging that includes the wallet ID.
36-49
: LGTM: Comprehensive error handling for missing chain.The test properly validates the chain requirement and provides clear error messaging.
51-67
: LGTM: EIP-5792 support validation test.The test correctly verifies that wallets without EIP-5792 support (no
getCallsStatus
method on account) are properly rejected with informative error messages.
69-97
: LGTM: Delegation test follows best practices.The test properly verifies delegation to the account's
getCallsStatus
method with:
- Realistic mock response structure
- Proper parameter passing verification
- Clean mock setup and assertion
99-144
: LGTM: Comprehensive injected wallet testing.The test effectively simulates the injected wallet account behavior:
- Mimics actual implementation patterns from
injected/index.ts
- Tests successful RPC call flow
- Verifies proper parameter passing and response transformation
- Uses realistic provider mock structure
146-184
: LGTM: Proper error handling for unsupported wallets.The test correctly simulates provider rejection scenarios and verifies that appropriate error messages are thrown when wallets don't support EIP-5792 methods.
186-226
: LGTM: In-app wallet delegation testing.The test properly verifies in-app wallet integration with:
- Realistic response structure including transaction receipts
- Proper BigInt usage for blockchain data types
- Clean delegation pattern testing
228-249
: LGTM: Error handling for unknown bundle IDs.The test appropriately covers the error case for invalid bundle IDs, ensuring robust error handling in the in-app wallet implementation.
b87a16c
to
718941b
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: 0
♻️ Duplicate comments (2)
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts (1)
77-110
: Critical: Address test coverage and type safety issues identified in previous review.This helper function still lacks test coverage and uses
@ts-expect-error
to bypass type mismatches, as flagged in the previous review. The complex status mapping logic, legacy compatibility handling, and hex conversions are critical paths that need comprehensive testing.The previous review provided detailed suggestions for:
- Adding dedicated test file
get-calls-status.test.ts
- Covering all status code mappings (numeric ranges + legacy strings)
- Refining types to eliminate
@ts-expect-error
comments- Testing
chainId
hex-to-number conversion and receipt transformationsThis function is a core utility for EIP-5792 support and must be thoroughly tested and type-safe before merging.
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts (1)
55-74
: Fix type assertion and simplify capability transformation logic.This utility function has several issues that need addressing:
- The
as never
type assertion bypasses TypeScript's type checking (flagged in previous review)- The capability copying logic is unnecessarily complex
- Missing handling when
chainId
is specified but doesn't exist in capabilities-export function toGetCapabilitiesResult( - result: Record<string, WalletCapabilities>, - chainId?: number, -): GetCapabilitiesResult { - const capabilities = {} as WalletCapabilitiesRecord< - WalletCapabilities, - number - >; - for (const [chainId, capabilities_] of Object.entries(result)) { - capabilities[Number(chainId)] = {}; - const capabilitiesCopy = {} as WalletCapabilities; - for (const [key, value] of Object.entries(capabilities_)) { - capabilitiesCopy[key] = value; - } - capabilities[Number(chainId)] = capabilitiesCopy; - } - return ( - typeof chainId === "number" ? capabilities[chainId] : capabilities - ) as never; -} +export function toGetCapabilitiesResult( + result: Record<string, WalletCapabilities>, + chainId?: number, +): GetCapabilitiesResult { + const capabilities: WalletCapabilitiesRecord<WalletCapabilities, number> = {}; + + for (const [chainIdStr, capabilities_] of Object.entries(result)) { + capabilities[Number(chainIdStr)] = { ...capabilities_ }; + } + + if (typeof chainId === "number") { + return capabilities[chainId] || {} as GetCapabilitiesResult; + } + + return capabilities as GetCapabilitiesResult; +}
🧹 Nitpick comments (1)
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts (1)
46-53
: Update JSDoc to reflect the new error-throwing behavior.The delegation to
account.getCapabilities
is a clean approach that aligns with the unified account interface. However, the JSDoc comment on line 18 states "will not throw" and line 19 mentions a "message field detailing any issues," but the new implementation throws an error when EIP-5792 is unsupported.- * This function is dependent on the wallet's support for EIP-5792, but will not throw. - * **The returned object contains a `message` field detailing any issues with the wallet's support for EIP-5792.** + * This function is dependent on the wallet's support for EIP-5792 and will throw if unsupported. + * **Throws an error if the wallet does not support EIP-5792.**
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
.changeset/early-queens-drive.md
(1 hunks)apps/playground-web/src/components/account-abstraction/5792-get-capabilities.tsx
(2 hunks)packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
(2 hunks)packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
(4 hunks)packages/thirdweb/src/wallets/eip5792/get-calls-status.ts
(1 hunks)packages/thirdweb/src/wallets/eip5792/get-capabilities.test.ts
(1 hunks)packages/thirdweb/src/wallets/eip5792/get-capabilities.ts
(1 hunks)packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
(5 hunks)packages/thirdweb/src/wallets/eip5792/send-calls.ts
(5 hunks)packages/thirdweb/src/wallets/in-app/core/eip5792/in-app-wallet-calls.ts
(3 hunks)packages/thirdweb/src/wallets/in-app/core/eip5972/in-app-wallet-capabilities.ts
(0 hunks)packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
(3 hunks)packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
(2 hunks)packages/thirdweb/src/wallets/injected/index.ts
(3 hunks)packages/thirdweb/src/wallets/interfaces/wallet.ts
(3 hunks)packages/thirdweb/src/wallets/smart/index.ts
(3 hunks)packages/thirdweb/src/wallets/smart/lib/smart-wallet-capabilities.ts
(0 hunks)
💤 Files with no reviewable changes (2)
- packages/thirdweb/src/wallets/smart/lib/smart-wallet-capabilities.ts
- packages/thirdweb/src/wallets/in-app/core/eip5972/in-app-wallet-capabilities.ts
🚧 Files skipped from review as they are similar to previous changes (13)
- .changeset/early-queens-drive.md
- apps/playground-web/src/components/account-abstraction/5792-get-capabilities.tsx
- packages/thirdweb/src/wallets/interfaces/wallet.ts
- packages/thirdweb/src/wallets/in-app/core/eip5792/in-app-wallet-calls.ts
- packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
- packages/thirdweb/src/wallets/eip5792/send-calls.test.ts
- packages/thirdweb/src/wallets/eip5792/get-capabilities.test.ts
- packages/thirdweb/src/wallets/eip5792/get-calls-status.test.ts
- packages/thirdweb/src/wallets/smart/index.ts
- packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
- packages/thirdweb/src/wallets/injected/index.ts
- packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
- packages/thirdweb/src/wallets/eip5792/send-calls.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{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@/types
or localtypes.ts
barrels
Prefer type aliases over interface except for nominal shapes
Avoidany
andunknown
unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial
,Pick
, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts
packages/thirdweb/src/wallets/eip5792/get-capabilities.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/eip5792/get-calls-status.ts
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts
packages/thirdweb/src/wallets/**
📄 CodeRabbit Inference Engine (CLAUDE.md)
packages/thirdweb/src/wallets/**
: UnifiedWallet
andAccount
interfaces 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/eip5792/get-calls-status.ts
packages/thirdweb/src/wallets/eip5792/get-capabilities.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
Learnt from: joaquim-verges
PR: thirdweb-dev/js#7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
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/** : Support for in-app wallets (social/email login)
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
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
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 abstraction
Learnt 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`
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts (19)
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
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
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 abstraction
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt 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: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use FORKED_ETHEREUM_CHAIN
for mainnet interactions and ANVIL_CHAIN
for isolated tests
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Use real function invocations with stub data in tests; avoid brittle mocks
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side-effect free
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Auto-generated contracts from ABI definitions in extensions
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/exports/** : Every public symbol must have comprehensive TSDoc with at least one @example
block that compiles and custom annotation tags (@beta
, @internal
, @experimental
)
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenPriceData.ts:49-49
Timestamp: 2025-05-27T19:55:25.056Z
Learning: In the ERC20 public pages token price data hook (useTokenPriceData.ts
), direct array access on json.data[0]
without optional chaining is intentionally correct and should not be changed to use safety checks.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/@/analytics/report.ts : Review src/@/analytics/report.ts
before adding analytics events to check for duplicates
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from @tanstack/react-query
or thirdweb SDKs.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
Learnt from: MananTank
PR: #7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts (19)
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
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
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 abstraction
Learnt from: joaquim-verges
PR: #7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt 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 apps/{dashboard,playground-web}/**/*.{ts,tsx} : Return typed results (e.g., Project[]
, User[]
) – avoid any
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Avoid any
and unknown
unless unavoidable; narrow generics when possible
Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/upload-nfts/single-upload/attributes.tsx:24-25
Timestamp: 2025-06-10T00:49:12.707Z
Learning: In React Hook Form with TypeScript generics, when using useFieldArray with a generic form type T that extends a specific interface, it's often necessary to use type assertions like as unknown as UseFormReturn<WithAttributes>
rather than trying to use as keyof T
. The type assertion approach works better because useFieldArray needs specific type information about the array field structure, and the generic constraint ensures the field exists safely.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Return typed results (Project[]
, User[]
, …) – avoid any
.
Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/_common/SocialUrls.tsx:24-25
Timestamp: 2025-06-10T15:59:29.585Z
Learning: In the SocialUrlsFieldset component in React Hook Form with TypeScript generics, when using useFieldArray with a generic form type T that extends WithSocialUrls, the type assertion as unknown as UseFormReturn<WithSocialUrls>
is the preferred approach rather than trying to use as keyof T
, because useFieldArray needs specific type information about the array field structure.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Write idiomatic TypeScript with explicit function declarations and return types
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenPriceData.ts:49-49
Timestamp: 2025-05-27T19:55:25.056Z
Learning: In the ERC20 public pages token price data hook (useTokenPriceData.ts
), direct array access on json.data[0]
without optional chaining is intentionally correct and should not be changed to use safety checks.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Comment only ambiguous logic; avoid restating TypeScript in prose
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Choose composition over inheritance; leverage utility types (Partial
, Pick
, etc.)
Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/components/table.tsx:304-313
Timestamp: 2025-05-26T16:27:26.443Z
Learning: The useChainSlug
hook returns string | number
, not string | undefined
as previously assumed. It does not return undefined values.
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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/exports/react.native.ts : React Native specific exports are in src/exports/react.native.ts
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
🧬 Code Graph Analysis (2)
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts (1)
packages/thirdweb/src/wallets/eip5792/types.ts (2)
GetCallsStatusRawResponse
(68-87)GetCallsStatusResponse
(58-66)
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts (2)
packages/thirdweb/src/exports/wallets/eip5792.ts (3)
WalletCapabilities
(22-22)GetCapabilitiesResult
(7-7)WalletCapabilitiesRecord
(23-23)packages/thirdweb/src/wallets/eip5792/types.ts (2)
WalletCapabilities
(5-7)WalletCapabilitiesRecord
(9-16)
⏰ 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)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Lint Packages
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Unit Tests
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts (1)
44-70
: Excellent refactoring to unified architecture pattern.The simplification effectively removes wallet-specific branching and delegates to account methods, which aligns perfectly with the unified
Wallet
andAccount
interfaces mentioned in the coding guidelines. The error handling is clear and consistent.packages/thirdweb/src/wallets/eip5792/get-capabilities.ts (1)
1-14
: Well-structured type definitions and imports.The imports are clean and the type definitions properly leverage utility types like
Prettify
for better developer experience. TheGetCapabilitiesOptions
type correctly constrains the wallet ID while allowing flexibility.
PR-Codex overview
This PR focuses on enhancing support for EIP-5792 across various wallet implementations in the
thirdweb
library, introducing new capabilities and improving existing functionalities.Detailed summary
inAppWallet
execution mode in wallet configurations.sendCalls
,getCallsStatus
, andgetCapabilities
methods in various wallet classes.Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Tests
Chores