Skip to content

[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

Conversation

joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Jul 28, 2025


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

  • Improved EIP-5792 support in wallet capabilities.
  • Added inAppWallet execution mode in wallet configurations.
  • Implemented sendCalls, getCallsStatus, and getCapabilities methods in various wallet classes.
  • Updated test cases to validate new functionalities.
  • Refactored existing code to streamline wallet interactions.

The following files were skipped due to too many changes: packages/thirdweb/src/wallets/eip5792/send-calls.test.ts

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Expanded support for EIP-5792, enabling batch transaction sending, status querying, and capability detection across multiple wallet types, including injected, smart, in-app, and Coinbase wallets.
    • Added in-app wallet integration with enhanced EIP-7702 support and extended timeout for transaction hash waiting.
  • Bug Fixes

    • Improved error handling and standardized messages for unsupported EIP-5792 features.
  • Refactor

    • Streamlined internal logic for EIP-5792 methods, reducing wallet-specific branching and simplifying capability and call handling.
    • Removed deprecated wallet capability detection code and simplified delegation to wallet account methods.
  • Tests

    • Updated and reorganized test suites for EIP-5792 functionality to improve clarity, coverage, and maintainability.
  • Chores

    • Documentation updated to reflect improved EIP-5792 support.

Copy link

vercel bot commented Jul 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 1:31am
nebula ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 1:31am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 1:31am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 1:31am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 1:31am

Copy link

changeset-bot bot commented Jul 28, 2025

🦋 Changeset detected

Latest commit: 718941b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
thirdweb Patch
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch

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

Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

Walkthrough

This update standardizes and extends EIP-5792 support across multiple wallet implementations. It introduces or refactors sendCalls, getCallsStatus, and getCapabilities methods on wallet accounts, consolidates logic into these methods, and removes wallet-type-specific and provider-specific branching from EIP-5792 utility functions. Related test suites are refactored to match the new abstraction.

Changes

Cohort / Files Change Summary
EIP-5792 Utility Functions
packages/thirdweb/src/wallets/eip5792/get-capabilities.ts
packages/thirdweb/src/wallets/eip5792/get-calls-status.ts
packages/thirdweb/src/wallets/eip5792/send-calls.ts
Simplified all functions to delegate to account methods (sendCalls, getCallsStatus, getCapabilities), removing wallet-type/provider-specific logic. Introduced utility functions for response normalization and provider call parameter construction.
Wallet Account Interface
packages/thirdweb/src/wallets/interfaces/wallet.ts
Extended Account type with optional sendCalls, getCallsStatus, and getCapabilities methods for EIP-5792 support.
Injected Wallet Implementation
packages/thirdweb/src/wallets/injected/index.ts
Added EIP-5792 methods to account: provider-based implementations for sendCalls, getCallsStatus, and getCapabilities, with error handling for unsupported methods.
Coinbase Wallet Implementation
packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
Added EIP-5792 methods to account: provider-based implementations for sendCalls, getCallsStatus, and getCapabilities, with error handling for unsupported methods.
In-App Wallet Implementations
packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
Added EIP-5792 methods to account: dynamic import and delegation to in-app wallet call utilities; capability reporting based on context. Increased transaction hash wait timeout.
Smart Wallet Implementations
packages/thirdweb/src/wallets/smart/index.ts
Added EIP-5792 methods to account: dynamic import and delegation to in-app wallet call utilities; capability reporting based on context and options.
In-App Wallet Call Utilities
packages/thirdweb/src/wallets/in-app/core/eip5792/in-app-wallet-calls.ts
Updated status query function to accept chain directly, removing wallet-based chain extraction.
Removed Capabilities Utility Functions
packages/thirdweb/src/wallets/in-app/core/eip5972/in-app-wallet-capabilities.ts
packages/thirdweb/src/wallets/smart/lib/smart-wallet-capabilities.ts
Deleted wallet-specific capability utility functions, as capability logic is now handled within account methods.
EIP-5792 Test Suites
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
Refactored tests to mock and verify at the account method level, removed provider-level mocks, reorganized structure, and updated error handling checks to match new abstraction.
Playground Example
apps/playground-web/src/components/account-abstraction/5792-get-capabilities.tsx
Updated wallet connection logic: prepends inAppWallet with EIP-7702 execution mode and gas sponsorship to the wallets array.
Changeset
.changeset/early-queens-drive.md
Added a changeset documenting a patch update for improved EIP-5792 support in the "thirdweb" package.

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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Complexity:

  • Multiple wallet implementations updated with new EIP-5792 methods.
  • Core utility functions refactored for abstraction and delegation.
  • Several test suites significantly reorganized.
  • Some removed files and altered function signatures.
  • Review requires attention to interface consistency, error handling, and test coverage.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • EIP-5792: Entity not found: Issue - Could not find referenced Issue.
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch _SDK_Add_EIP-5792_support_to_Coinbase_and_refactor_wallet_capabilities

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Playground Changes involving the Playground codebase. packages SDK Involves changes to the thirdweb SDK labels Jul 28, 2025
@joaquim-verges joaquim-verges marked this pull request as ready for review July 28, 2025 00:47
@joaquim-verges joaquim-verges requested review from a team as code owners July 28, 2025 00:47
Copy link
Member Author

joaquim-verges commented Jul 28, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

Copy link

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 16.07629% with 308 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.24%. Comparing base (58dbe90) to head (718941b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/wallets/smart/index.ts 5.79% 65 Missing ⚠️
...ages/thirdweb/src/wallets/coinbase/coinbase-web.ts 11.29% 55 Missing ⚠️
packages/thirdweb/src/wallets/injected/index.ts 9.83% 55 Missing ⚠️
...src/wallets/in-app/core/eip7702/minimal-account.ts 11.42% 31 Missing ⚠️
...b/src/wallets/in-app/core/wallet/enclave-wallet.ts 13.88% 31 Missing ⚠️
...s/thirdweb/src/wallets/eip5792/get-calls-status.ts 25.00% 30 Missing ⚠️
...ackages/thirdweb/src/wallets/eip5792/send-calls.ts 35.55% 29 Missing ⚠️
...s/thirdweb/src/wallets/eip5792/get-capabilities.ts 36.84% 12 Missing ⚠️
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     
Flag Coverage Δ
packages 56.24% <16.07%> (-0.42%) ⬇️
Files with missing lines Coverage Δ
...s/thirdweb/src/wallets/eip5792/get-capabilities.ts 54.54% <36.84%> (-24.56%) ⬇️
...ackages/thirdweb/src/wallets/eip5792/send-calls.ts 35.22% <35.55%> (-46.68%) ⬇️
...s/thirdweb/src/wallets/eip5792/get-calls-status.ts 50.00% <25.00%> (-20.12%) ⬇️
...src/wallets/in-app/core/eip7702/minimal-account.ts 92.16% <11.42%> (-3.62%) ⬇️
...b/src/wallets/in-app/core/wallet/enclave-wallet.ts 40.33% <13.88%> (-4.99%) ⬇️
...ages/thirdweb/src/wallets/coinbase/coinbase-web.ts 35.42% <11.29%> (-5.83%) ⬇️
packages/thirdweb/src/wallets/injected/index.ts 30.89% <9.83%> (-4.18%) ⬇️
packages/thirdweb/src/wallets/smart/index.ts 52.71% <5.79%> (-6.71%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

github-actions bot commented Jul 28, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.19 KB (0%) 1.3 s (0%) 386 ms (+87.56% 🔺) 1.7 s
thirdweb (cjs) 353.01 KB (0%) 7.1 s (0%) 1.6 s (+5.37% 🔺) 8.6 s
thirdweb (minimal + tree-shaking) 5.7 KB (0%) 114 ms (0%) 48 ms (+434.02% 🔺) 162 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 81 ms (+1285.35% 🔺) 91 ms
thirdweb/react (minimal + tree-shaking) 19.24 KB (+0.05% 🔺) 385 ms (+0.05% 🔺) 88 ms (+199.49% 🔺) 473 ms

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 validation

The error message states that either to or data 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 implementation

The 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 method

While 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 mock

The 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 preparation

The 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 toProviderCallParams

The 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 detection

The 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 methods

The 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 logic

The 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

📥 Commits

Reviewing files that changed from the base of the PR and between 58dbe90 and 19cf1d2.

📒 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 local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown 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
Use NavLink for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Use cn() 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 with import "server-only";
Client Components (browser): Begin files with 'use client';
Always call getAuthToken() to retrieve JWT from cookies on server side
Use Authorization: Bearer header – never embed tokens in URLs
Return typed results (e.g., Project[], User[]) – avoid any
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stable queryKeys for React Query cache hits
Configure staleTime/cacheTime in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never import posthog-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/**: Unified Wallet and Account 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.tsfoo.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
Use FORKED_ETHEREUM_CHAIN for mainnet interactions and ANVIL_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 from wallet 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 tests

The sendCalls, getCallsStatus, and getCapabilities 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 to inAppWalletSendCalls and returns { client, chain, id }.
    • getCallsStatus({ wallet, client, id }) delegates to inAppWalletGetCallsStatus and returns its response.
  • Invoke getCapabilities({ wallet, chainId }) with and without sponsorGas 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 support

The new optional methods are properly typed and follow good interface design principles. The Omit utility type usage for sendCalls 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 delegation

The test suite properly covers error scenarios and delegation behavior, including the important chain switching functionality.


130-243: Good coverage of injected wallet behavior

The 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 coverage

The tests comprehensively cover all error scenarios with descriptive error messages that include the wallet ID for better debugging.


99-249: Well-structured wallet-specific tests

The 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 implementation

The 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 TODO

The 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 getCapabilities

The 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 refactoring

The 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 implementation

The implementation of sendCalls, getCallsStatus, and getCapabilities methods is consistent with other wallet implementations, which is excellent for maintainability.

"thirdweb": patch
---

Improve EIP5792 support
Copy link
Contributor

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.

Suggested change
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.

Comment on lines +280 to +337
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;
}
},
Copy link
Contributor

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.

Comment on lines +77 to +110
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,
};
}
Copy link
Contributor

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.

Suggested change
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.

Comment on lines +71 to +73
return (
typeof chainId === "number" ? capabilities[chainId] : capabilities
) as never;
Copy link
Contributor

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.

Suggested change
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'.

Comment on lines +138 to 140
if (wallet.getChain()?.id !== callChain.id) {
await wallet.switchChain(callChain);
}
Copy link
Contributor

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.

Suggested change
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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 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);
🧹 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 execution

If 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 tests

The 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

📥 Commits

Reviewing files that changed from the base of the PR and between 36ea49c and b87a16c.

📒 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 local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown 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/**: Unified Wallet and Account 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.tsfoo.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
Use FORKED_ETHEREUM_CHAIN for mainnet interactions and ANVIL_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 directly

The 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 function

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 transformations

This 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:

  1. The as never type assertion bypasses TypeScript's type checking (flagged in previous review)
  2. The capability copying logic is unnecessarily complex
  3. 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

📥 Commits

Reviewing files that changed from the base of the PR and between b87a16c and 718941b.

📒 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 local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown 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/**: Unified Wallet and Account 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 and Account 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. The GetCapabilitiesOptions type correctly constrains the wallet ID while allowing flexibility.

@joaquim-verges joaquim-verges merged commit 1cbbbc3 into main Jul 28, 2025
22 of 25 checks passed
@joaquim-verges joaquim-verges deleted the _SDK_Add_EIP-5792_support_to_Coinbase_and_refactor_wallet_capabilities branch July 28, 2025 01:27
@joaquim-verges joaquim-verges mentioned this pull request Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages Playground Changes involving the Playground codebase. SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant