Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Oct 20, 2025


PR-Codex overview

This PR focuses on enhancing the TokenIcon component and expanding the API with new payment and wallet functionalities, including support for Solana wallets and improved token handling.

Detailed summary

  • Updated TokenIcon to automatically resolve token icons.
  • Added new API methods for linking and unlinking authentication.
  • Introduced Solana wallet creation and management APIs.
  • Enhanced existing token and payment processing functionalities.
  • Updated documentation for authentication methods and payment requirements.

The following files were skipped due to too many changes: packages/api/src/client/types.gen.ts

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

Summary by CodeRabbit

  • New Features
    • Added authentication linking/unlinking, x402 payment verification & settlement, payable service listing, fiat-to-crypto conversion, bridge chain & route lookups, and Solana wallet/transaction operations.
  • Improvements
    • Token icons now resolve automatically by default (removed hard-coded icon overrides).
  • Updates
    • API package bumped to include the new endpoints and related types.

@vercel
Copy link

vercel bot commented Oct 20, 2025

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

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Oct 20, 2025 1:29am
nebula Ready Ready Preview Comment Oct 20, 2025 1:29am
thirdweb_playground Canceled Canceled Oct 20, 2025 1:29am
thirdweb-www Ready Ready Preview Comment Oct 20, 2025 1:29am
wallet-ui Ready Ready Preview Comment Oct 20, 2025 1:29am

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2025

🦋 Changeset detected

Latest commit: f6916be

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

This PR includes changesets to release 5 packages
Name Type
thirdweb Patch
@thirdweb-dev/api Minor
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch
wagmi-inapp 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

@github-actions github-actions bot added Playground Changes involving the Playground codebase. packages SDK Involves changes to the thirdweb SDK labels Oct 20, 2025
Copy link
Member Author


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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Walkthrough

This PR adds many new API client endpoints (auth linking, x402 payments, bridge, fiat-to-crypto, Solana wallets), adds bridge-token icon resolution in TokenIcon by fetching token data, and removes hard-coded iconResolver props from playground TokenIcon examples. Changesets for patch releases were added.

Changes

Cohort / File(s) Summary
Release metadata
.changeset/sharp-bats-pump.md, .changeset/shy-pillows-turn.md
Added changeset entries indicating patch updates: resolve TokenIcon automatically and API package update.
TokenIcon component automation
packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx
Added a step to fetch token data via getToken() and return iconUri for bridge tokens early in the icon resolution flow; falls back to existing contract metadata lookup if absent.
Playground example cleanup
apps/playground-web/src/components/headless-ui/token-examples.tsx, apps/playground-web/src/components/headless-ui/token-previews.tsx
Removed explicit iconResolver="/usdc.svg" prop usage from TokenIcon instances so they rely on default/automatic icon resolution.
SDK API endpoint expansion
packages/api/src/client/sdk.gen.ts
Added numerous generated SDK methods and types for authentication linking/unlinking, x402 payment endpoints (verify/settle/supported/fetch/list payable services/convert), bridge endpoints (chains/routes/convert), and Solana wallet operations (list/create/sign/send transactions, get transaction), plus related response/error shapes.

Sequence Diagram(s)

sequenceDiagram
    participant UI as TokenIcon component
    participant NativeCheck as Native token check
    participant Bridge as Bridge token resolver (getToken)
    participant Contract as Contract metadata resolver
    participant Output as Icon result

    Note over UI,Output: Token icon resolution (updated)

    UI->>NativeCheck: Is native token?
    alt native
        NativeCheck->>Output: return native icon
    else not native
        UI->>Bridge: fetch token via getToken(address, chainId)
        alt bridge token has iconUri
            Bridge->>Output: return bridge token iconUri (early exit)
        else no bridge icon
            UI->>Contract: query contract metadata for icon
            Contract->>Output: return contract icon or fallback
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description is largely incomplete and does not follow the required template structure. The template specifies several key sections: a Linear issue tag (TEAM-0000 format), "Notes for the reviewer" with important callouts, and "How to test" with testing instructions. The actual description contains only commented-out template text and an auto-generated PR-Codex summary, with none of the required sections filled in. There are no explicit notes for reviewers, no testing instructions provided, and no Linear issue tag included, which are essential information typically expected in pull request descriptions for this repository.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "Resolve TokenIcon automatically when available" is clearly related to a primary change in the changeset. The raw summary confirms that the TokenIcon component was updated to automatically resolve token icons from bridge tokens when available (as evidenced by packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx changes), and this matches the description in the sharp-bats-pump.md changeset. While the PR also includes significant API additions (Solana wallets, x402 payments, authentication linking), the title specifically addresses the documented TokenIcon enhancement, which represents a distinct, well-scoped change. The title is concise, specific, and clearly communicates the primary feature to a teammate reviewing the history.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Resolve_TokenIcon_automatically_when_available

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.89%. Comparing base (8c58c13) to head (f6916be).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8279      +/-   ##
==========================================
- Coverage   55.01%   54.89%   -0.13%     
==========================================
  Files         919      919              
  Lines       60588    60622      +34     
  Branches     4126     4128       +2     
==========================================
- Hits        33334    33276      -58     
- Misses      27150    27246      +96     
+ Partials      104      100       -4     
Flag Coverage Δ
packages 54.89% <ø> (-0.13%) ⬇️
see 15 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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.51 KB (0%) 1.3 s (0%) 236 ms (+206.83% 🔺) 1.6 s
thirdweb (cjs) 365.68 KB (0%) 7.4 s (0%) 831 ms (+11.09% 🔺) 8.2 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 103 ms (+2866.09% 🔺) 217 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 73 ms (+3668.4% 🔺) 84 ms
thirdweb/react (minimal + tree-shaking) 19.13 KB (0%) 383 ms (0%) 86 ms (+2108.02% 🔺) 468 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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1e7df5a and 66b1322.

📒 Files selected for processing (6)
  • .changeset/sharp-bats-pump.md (1 hunks)
  • .changeset/shy-pillows-turn.md (1 hunks)
  • apps/playground-web/src/components/headless-ui/token-examples.tsx (0 hunks)
  • apps/playground-web/src/components/headless-ui/token-previews.tsx (1 hunks)
  • packages/api/src/client/sdk.gen.ts (12 hunks)
  • packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • apps/playground-web/src/components/headless-ui/token-examples.tsx
🧰 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

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx
  • apps/playground-web/src/components/headless-ui/token-previews.tsx
  • packages/api/src/client/sdk.gen.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/react/web/ui/prebuilt/Token/icon.tsx
  • apps/playground-web/src/components/headless-ui/token-previews.tsx
  • packages/api/src/client/sdk.gen.ts
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling @example and a custom tag (@beta, @internal, @experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g., const { jsPDF } = await import("jspdf"))

Files:

  • packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

.changeset/*.md: Each change in packages/* must include a changeset for the appropriate package
Version bump rules: patch for non‑API changes; minor for new/modified public API

Files:

  • .changeset/sharp-bats-pump.md
  • .changeset/shy-pillows-turn.md
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/headless-ui/token-previews.tsx
🧠 Learnings (1)
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to .changeset/*.md : Version bump rules: patch for non‑API changes; minor for new/modified public API

Applied to files:

  • .changeset/shy-pillows-turn.md
🧬 Code graph analysis (3)
packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx (1)
packages/thirdweb/src/pay/convert/get-token.ts (1)
  • getToken (6-37)
apps/playground-web/src/components/headless-ui/token-previews.tsx (1)
packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx (1)
  • TokenIcon (113-193)
packages/api/src/client/sdk.gen.ts (2)
packages/api/src/client/client/types.ts (1)
  • Options (191-199)
packages/api/src/client/types.gen.ts (48)
  • LinkAuthenticationData (343-357)
  • LinkAuthenticationResponses (378-552)
  • LinkAuthenticationErrors (359-376)
  • UnlinkAuthenticationData (557-610)
  • UnlinkAuthenticationResponses (631-805)
  • UnlinkAuthenticationErrors (612-629)
  • VerifyX402PaymentData (4881-4947)
  • VerifyX402PaymentResponses (4964-5011)
  • VerifyX402PaymentErrors (4949-4962)
  • SettleX402PaymentData (5016-5086)
  • SettleX402PaymentResponses (5103-5161)
  • SettleX402PaymentErrors (5088-5101)
  • SupportedX402PaymentsData (5166-5180)
  • SupportedX402PaymentsResponses (5193-5240)
  • SupportedX402PaymentsErrors (5182-5191)
  • FetchWithPaymentData (5245-5287)
  • FetchWithPaymentResponses (5479-5484)
  • FetchWithPaymentErrors (5289-5474)
  • ListPayableServicesData (5486-5502)
  • ListPayableServicesResponses (5515-5563)
  • ListPayableServicesErrors (5504-5513)
  • GetBridgeChainsData (5869-5874)
  • GetBridgeChainsResponses (5887-5927)
  • GetBridgeChainsErrors (5876-5885)
  • GetBridgeSupportedRoutesData (5932-5966)
  • GetBridgeSupportedRoutesResponses (5983-6097)
  • GetBridgeSupportedRoutesErrors (5968-5981)
  • ConvertFiatToCryptoData (6102-6147)
  • ConvertFiatToCryptoResponses (6172-6182)
  • ConvertFiatToCryptoErrors (6149-6170)
  • ListSolanaWalletsData (6453-6467)
  • ListSolanaWalletsResponses (6480-6526)
  • ListSolanaWalletsErrors (6469-6478)
  • CreateSolanaWalletData (6531-6544)
  • CreateSolanaWalletResponses (6557-6610)
  • CreateSolanaWalletErrors (6546-6555)
  • SignSolanaMessageData (6615-6632)
  • SignSolanaMessageResponses (6645-6657)
  • SignSolanaMessageErrors (6634-6643)
  • SendSolanaTokensData (6662-6691)
  • SendSolanaTokensResponses (6704-6727)
  • SendSolanaTokensErrors (6693-6702)
  • SendSolanaTransactionData (6732-6783)
  • SendSolanaTransactionResponses (6796-6819)
  • SendSolanaTransactionErrors (6785-6794)
  • GetSolanaTransactionData (6824-6834)
  • GetSolanaTransactionResponses (6851-6920)
  • GetSolanaTransactionErrors (6836-6849)
⏰ 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). (2)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
🔇 Additional comments (9)
packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx (2)

9-9: LGTM: Import added for enhanced icon resolution.

The import of getToken enables the new bridge token icon resolution feature.


139-145: LGTM: Bridge token icon resolution added with appropriate fallback.

The new resolution flow appropriately attempts to fetch bridge token data before falling back to contract metadata. The error handling with .catch(() => null) is reasonable for this fallback scenario, allowing graceful degradation when bridge token data is unavailable.

Icon resolution order is now:

  1. Explicit iconResolver (string or function)
  2. Native token (chain metadata)
  3. Bridge token (via getToken - new)
  4. Contract metadata (fallback)

This enhancement aligns with the PR objective to resolve TokenIcon automatically when available.

packages/api/src/client/sdk.gen.ts (5)

18-20: LGTM: Type imports added for new API endpoints.

All necessary type imports for the new authentication linking, x402 payment, bridge, fiat-to-crypto, and Solana wallet endpoints are properly included.

Also applies to: 27-29, 39-47, 66-68, 90-92, 96-98, 102-104, 124-129, 136-138, 142-144, 150-152, 154-155, 156-158


290-364: LGTM: Authentication linking endpoints added with comprehensive documentation.

The linkAuthentication and unlinkAuthentication endpoints are well-documented and follow the established patterns in the SDK. Security configuration correctly requires both client authentication and bearer token.


1187-1330: LGTM: X402 payment endpoints added with appropriate security.

The x402 payment flow endpoints (verifyX402Payment, settleX402Payment, supportedX402Payments, fetchWithPayment, listPayableServices) are consistently implemented with:

  • Proper security configurations
  • Comprehensive documentation
  • Appropriate error types
  • Standard request/response patterns

The fetchWithPayment endpoint correctly uses Content-Type: */* to support pass-through of arbitrary content types.


1427-1502: LGTM: Bridge and fiat conversion endpoints added.

The bridge-related endpoints (getBridgeChains, getBridgeSupportedRoutes, convertFiatToCrypto) provide necessary functionality for cross-chain operations with proper authentication and documentation.


1537-1701: LGTM: Solana wallet endpoints added with backend authentication.

All Solana wallet management endpoints (listSolanaWallets, createSolanaWallet, signSolanaMessage, sendSolanaTokens, sendSolanaTransaction, getSolanaTransaction) correctly require x-secret-key authentication, ensuring these backend-only operations remain secure.

.changeset/sharp-bats-pump.md (1)

1-5: LGTM: Appropriate patch version for internal enhancement.

The patch version bump is correct since the TokenIcon enhancement is an internal implementation improvement with no breaking changes to the public API surface.

apps/playground-web/src/components/headless-ui/token-previews.tsx (1)

34-34: LGTM: Relying on automatic icon resolution.

Removing the explicit iconResolver="/usdc.svg" prop demonstrates the improved automatic icon resolution introduced in this PR. The TokenIcon component will now fetch the USDC icon automatically via the bridge token data path.

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

🧹 Nitpick comments (1)
apps/playground-web/src/components/headless-ui/token-previews.tsx (1)

27-37: Consider renaming TokenImageOverridePreview to reflect its actual behavior.

The function name suggests it demonstrates icon override functionality, but it no longer uses the iconResolver prop. Consider renaming to something like TokenImageUsdcPreview or TokenImageErc20Preview to better describe that it demonstrates rendering an ERC-20 token (USDC) rather than the native token.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 66b1322 and f6916be.

📒 Files selected for processing (6)
  • .changeset/sharp-bats-pump.md (1 hunks)
  • .changeset/shy-pillows-turn.md (1 hunks)
  • apps/playground-web/src/components/headless-ui/token-examples.tsx (0 hunks)
  • apps/playground-web/src/components/headless-ui/token-previews.tsx (1 hunks)
  • packages/api/src/client/sdk.gen.ts (12 hunks)
  • packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • apps/playground-web/src/components/headless-ui/token-examples.tsx
✅ Files skipped from review due to trivial changes (1)
  • .changeset/sharp-bats-pump.md
🧰 Additional context used
📓 Path-based instructions (5)
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

.changeset/*.md: Each change in packages/* must include a changeset for the appropriate package
Version bump rules: patch for non‑API changes; minor for new/modified public API

Files:

  • .changeset/shy-pillows-turn.md
**/*.{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

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx
  • packages/api/src/client/sdk.gen.ts
  • apps/playground-web/src/components/headless-ui/token-previews.tsx
**/*.{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/react/web/ui/prebuilt/Token/icon.tsx
  • packages/api/src/client/sdk.gen.ts
  • apps/playground-web/src/components/headless-ui/token-previews.tsx
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling @example and a custom tag (@beta, @internal, @experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g., const { jsPDF } = await import("jspdf"))

Files:

  • packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx
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/headless-ui/token-previews.tsx
🧠 Learnings (1)
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to .changeset/*.md : Version bump rules: patch for non‑API changes; minor for new/modified public API

Applied to files:

  • .changeset/shy-pillows-turn.md
🧬 Code graph analysis (3)
packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx (1)
packages/thirdweb/src/pay/convert/get-token.ts (1)
  • getToken (6-37)
packages/api/src/client/sdk.gen.ts (2)
packages/api/src/client/client/types.ts (1)
  • Options (191-199)
packages/api/src/client/types.gen.ts (48)
  • LinkAuthenticationData (343-357)
  • LinkAuthenticationResponses (378-552)
  • LinkAuthenticationErrors (359-376)
  • UnlinkAuthenticationData (557-610)
  • UnlinkAuthenticationResponses (631-805)
  • UnlinkAuthenticationErrors (612-629)
  • VerifyX402PaymentData (4881-4947)
  • VerifyX402PaymentResponses (4964-5011)
  • VerifyX402PaymentErrors (4949-4962)
  • SettleX402PaymentData (5016-5086)
  • SettleX402PaymentResponses (5103-5161)
  • SettleX402PaymentErrors (5088-5101)
  • SupportedX402PaymentsData (5166-5180)
  • SupportedX402PaymentsResponses (5193-5240)
  • SupportedX402PaymentsErrors (5182-5191)
  • FetchWithPaymentData (5245-5287)
  • FetchWithPaymentResponses (5479-5484)
  • FetchWithPaymentErrors (5289-5474)
  • ListPayableServicesData (5486-5502)
  • ListPayableServicesResponses (5515-5563)
  • ListPayableServicesErrors (5504-5513)
  • GetBridgeChainsData (5869-5874)
  • GetBridgeChainsResponses (5887-5927)
  • GetBridgeChainsErrors (5876-5885)
  • GetBridgeSupportedRoutesData (5932-5966)
  • GetBridgeSupportedRoutesResponses (5983-6097)
  • GetBridgeSupportedRoutesErrors (5968-5981)
  • ConvertFiatToCryptoData (6102-6147)
  • ConvertFiatToCryptoResponses (6172-6182)
  • ConvertFiatToCryptoErrors (6149-6170)
  • ListSolanaWalletsData (6453-6467)
  • ListSolanaWalletsResponses (6480-6526)
  • ListSolanaWalletsErrors (6469-6478)
  • CreateSolanaWalletData (6531-6544)
  • CreateSolanaWalletResponses (6557-6610)
  • CreateSolanaWalletErrors (6546-6555)
  • SignSolanaMessageData (6615-6632)
  • SignSolanaMessageResponses (6645-6657)
  • SignSolanaMessageErrors (6634-6643)
  • SendSolanaTokensData (6662-6691)
  • SendSolanaTokensResponses (6704-6727)
  • SendSolanaTokensErrors (6693-6702)
  • SendSolanaTransactionData (6732-6783)
  • SendSolanaTransactionResponses (6796-6819)
  • SendSolanaTransactionErrors (6785-6794)
  • GetSolanaTransactionData (6824-6834)
  • GetSolanaTransactionResponses (6851-6920)
  • GetSolanaTransactionErrors (6836-6849)
apps/playground-web/src/components/headless-ui/token-previews.tsx (1)
packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx (1)
  • TokenIcon (113-193)
⏰ 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 (3)
.changeset/shy-pillows-turn.md (1)

1-5: ✅ Version bump corrected to "minor".

The changeset now correctly marks the version bump as "minor" for the @thirdweb-dev/api package, which is appropriate given the PR adds multiple new public API endpoints (authentication linking, x402 payments, bridge operations, Solana wallet methods) that expand the public API surface. This aligns with the coding guideline requiring "minor" bumps for new/modified public API.

packages/thirdweb/src/react/web/ui/prebuilt/Token/icon.tsx (2)

9-9: LGTM: Import addition is appropriate.

The getToken import is necessary for the new bridge token resolution feature and correctly placed.


139-145: LGTM: Bridge token resolution enhances icon accuracy.

The implementation correctly adds an optional resolution step for bridge tokens. The error handling with .catch(() => null) is appropriate for this waterfall pattern—if the bridge token is unavailable or unsupported, the code gracefully falls back to the existing contract metadata path. The getToken function includes built-in caching, ensuring reasonable performance.

Comment on lines +1678 to +1701
/**
* Get Solana Transaction
* Retrieve the status and details of a queued Solana transaction using the identifier returned when the transaction was submitted.
*
* **Authentication**: This endpoint requires backend authentication using the x-secret-key header. The secret key should never be exposed publicly.
*/
export const getSolanaTransaction = <ThrowOnError extends boolean = false>(
options: Options<GetSolanaTransactionData, ThrowOnError>,
) => {
return (options.client ?? _heyApiClient).get<
GetSolanaTransactionResponses,
GetSolanaTransactionErrors,
ThrowOnError
>({
security: [
{
name: "x-secret-key",
type: "apiKey",
},
],
url: "/v1/solana/transactions/:transactionId",
...options,
});
};
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix inconsistent path parameter format in URL.

The URL at line 1698 uses :transactionId (colon-prefix) instead of {transactionId} (curly braces), which is inconsistent with all other path parameters in this file.

Compare with similar endpoints:

  • Line 1035: "/v1/transactions/{transactionId}"
  • Line 604: "/v1/wallets/{address}/balance"
  • Line 931: "/v1/contracts/{chainId}/{address}/transactions"

Since this is an auto-generated file, the fix should be applied to the OpenAPI specification or code generator configuration:

-		url: "/v1/solana/transactions/:transactionId",
+		url: "/v1/solana/transactions/{transactionId}",
📝 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
/**
* Get Solana Transaction
* Retrieve the status and details of a queued Solana transaction using the identifier returned when the transaction was submitted.
*
* **Authentication**: This endpoint requires backend authentication using the x-secret-key header. The secret key should never be exposed publicly.
*/
export const getSolanaTransaction = <ThrowOnError extends boolean = false>(
options: Options<GetSolanaTransactionData, ThrowOnError>,
) => {
return (options.client ?? _heyApiClient).get<
GetSolanaTransactionResponses,
GetSolanaTransactionErrors,
ThrowOnError
>({
security: [
{
name: "x-secret-key",
type: "apiKey",
},
],
url: "/v1/solana/transactions/:transactionId",
...options,
});
};
/**
* Get Solana Transaction
* Retrieve the status and details of a queued Solana transaction using the identifier returned when the transaction was submitted.
*
* **Authentication**: This endpoint requires backend authentication using the x-secret-key header. The secret key should never be exposed publicly.
*/
export const getSolanaTransaction = <ThrowOnError extends boolean = false>(
options: Options<GetSolanaTransactionData, ThrowOnError>,
) => {
return (options.client ?? _heyApiClient).get<
GetSolanaTransactionResponses,
GetSolanaTransactionErrors,
ThrowOnError
>({
security: [
{
name: "x-secret-key",
type: "apiKey",
},
],
url: "/v1/solana/transactions/{transactionId}",
...options,
});
};
🤖 Prompt for AI Agents
In packages/api/src/client/sdk.gen.ts around lines 1678 to 1701 the path
parameter is using colon-prefixed syntax
"/v1/solana/transactions/:transactionId" which is inconsistent with the
project's curly-brace style; update the source (OpenAPI spec or codegen
template/config) so the generated URL uses
"/v1/solana/transactions/{transactionId}" and regenerate the client (or change
the generator mapping for path parameter templates) to ensure all endpoints use
the {param} format.

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