Skip to content

Conversation

@0xFirekeeper
Copy link
Member

@0xFirekeeper 0xFirekeeper commented Oct 7, 2025

Closes BLD-372


PR-Codex overview

This PR introduces enhancements to project wallet management, including the ability to create, manage, and utilize project wallets for transactions. It improves the integration of wallet features across the dashboard, ensuring better access and functionality for users.

Detailed summary

  • Added projectWalletAddress to various components for wallet integration.
  • Implemented getProjectWallet function to retrieve wallet details.
  • Introduced CreateServerWallet and ProjectWalletControls components for wallet management.
  • Enhanced ProjectFTUX to include wallet information.
  • Updated error handling for missing management access tokens.
  • Improved UI elements for wallet interactions, including buttons for using project wallets.
  • Integrated wallet balance display and transaction functionalities.
  • Added a modal for sending funds from project wallets.

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

Summary by CodeRabbit

  • New Features

    • Adds Project Wallet UI and controls (label, address copy, balance, network selector, send/receive, Transactions link) and a Project Wallet section.
    • Stable wallet labeling utility and server wallet listing/lookup.
    • Payment/payout UIs can prefill recipient/payout from the project wallet; Create Payment Link gets “Use Project Wallet”.
    • New server APIs: createProjectServerWallet, getProjectWallet, listProjectServerWallets, sendProjectWalletTokens; set-default wallet action and badge.
  • Bug Fixes

    • Validates presence of management access tokens and surfaces clearer failures.
  • Refactor

    • Wallet creation moved to unified server-side flow; client now delegates to server helpers.

Introduces logic to automatically create a default server wallet when a project is created, using a consistent label. Adds a new utility for generating wallet labels, updates project creation flows to provision the wallet, and enhances the ProjectFTUX component to display wallet details. Refactors server wallet creation logic into a reusable function and updates the server wallet creation UI to use this abstraction.

Closes BLD-372
@0xFirekeeper 0xFirekeeper requested review from a team as code owners October 7, 2025 15:11
@linear
Copy link

linear bot commented Oct 7, 2025

@changeset-bot
Copy link

changeset-bot bot commented Oct 7, 2025

⚠️ No Changeset found

Latest commit: 5d856fd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Oct 7, 2025

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

Project Deployment Preview Comments Updated (UTC)
thirdweb-www Ready Ready Preview Comment Oct 8, 2025 1:45pm
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs-v2 Skipped Skipped Oct 8, 2025 1:45pm
nebula Skipped Skipped Oct 8, 2025 1:45pm
thirdweb_playground Skipped Skipped Oct 8, 2025 1:45pm
wallet-ui Skipped Skipped Oct 8, 2025 1:45pm

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 7, 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.

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Oct 7, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 7, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Project creation now preserves Vault token results and enforces a management access token before creating a default server wallet. New server and server‑side helpers list/create project server wallets. Project wallet address is surfaced to Payments and Settings, client wallet controls/sending are added, default‑wallet management is supported, and service types updated.

Changes

Cohort / File(s) Summary
Project creation flow
apps/dashboard/src/@/components/project/create-project-modal/index.tsx, apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx
Preserve createVaultAccountAndAccessToken return value into vaultTokens, extract/validate managementAccessToken, throw/short‑circuit if missing before proceeding.
Project wallet label util
apps/dashboard/src/@/lib/project-wallet.ts
Add getProjectWalletLabel(projectName?: string) to produce a normalized, length‑capped label with " Wallet" suffix.
Server project‑wallet helper
apps/dashboard/src/@/lib/server/project-wallet.ts
Add ProjectWalletSummary type and getProjectWallet(project) to list EOAs from Vault, filter/select the project server wallet, and return a summary or undefined.
Vault client: server wallet creation & project update
apps/dashboard/src/app/.../transactions/lib/vault.client.ts
Add createProjectServerWallet(...) to create EOAs via Vault (with metadata), add updateDefaultProjectWallet(...) to set projectWalletAddress on the project, and integrate created wallet address into engineCloud service updates.
Create‑server‑wallet client → server refactor
apps/dashboard/src/app/.../transactions/server-wallets/components/create-server-wallet.client.tsx
Replace client Vault SDK EOA creation with server call to createProjectServerWallet; add optional setAsProjectWallet prop and return created wallet.
FTUX & page wiring
apps/dashboard/src/app/.../components/ProjectFTUX/ProjectFTUX.tsx, apps/dashboard/src/app/.../page.tsx
Make ProjectFTUX async, resolve getProjectWallet(project) when needed, add/export ProjectWalletSection, pass wallet and managementAccessToken into FTUX and page render paths.
Project wallet controls (client)
apps/dashboard/src/app/.../components/ProjectFTUX/ProjectWalletControls.client.tsx
Add ProjectWalletControls (balance, network selector, send/receive modals) and SendProjectWalletModal with form validation and server action to send tokens.
Payments: page & components wiring
apps/dashboard/src/app/.../payments/page.tsx, .../payments/components/QuickstartSection.client.tsx, .../payments/links/components/PaymentLinksTable.client.tsx, .../payments/links/components/CreatePaymentLinkButton.client.tsx
Fetch projectWallet via getProjectWallet and pass projectWallet?.address as projectWalletAddress to payment components; add "Use Project Wallet" UI to preset recipient in create‑link dialog.
Settings payments: page & config
apps/dashboard/src/app/.../settings/payments/page.tsx, .../settings/payments/PayConfig.tsx
Resolve project wallet server‑side and pass projectWalletAddress into PayConfig; PayConfig adds a “Use Project Wallet” button to autofill payout address.
Server send action
apps/dashboard/src/@/actions/project-wallet/send-tokens.ts
Add sendProjectWalletTokens(...) server action to proxy token sends (validates secretKey, posts recipients, includes client/team/secret/vault headers) and return transaction IDs or error.
Wallets UI: set default wallet
apps/dashboard/src/app/.../server-wallets/wallet-table/wallet-table-ui.client.tsx
Add mutation to set a wallet as project default, display a "default" Badge for the default wallet, and refresh on success with toasts.
List server wallets action
apps/dashboard/src/@/actions/project-wallet/list-server-wallets.ts
Add listProjectServerWallets to list EOAs via Vault, filter to project server wallets, and return ProjectWalletSummary[].
Service API type update
packages/service-utils/src/core/api.ts
Add optional `projectWalletAddress?: string
Minor lint/no‑op
apps/dashboard/src/@/components/misc/AnnouncementBanner.tsx
Add biome-ignore lint comment; no functional change.
Stories
apps/dashboard/src/app/.../ProjectFTUX.stories.tsx
Update Default story args to include managementAccessToken: undefined.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as Create Project UI (client)
  participant Vault as Vault SDK
  participant Server as createProjectServerWallet
  participant Engine as Engine Proxy

  User->>UI: Submit new project
  UI->>Vault: createVaultAccountAndAccessToken()
  Vault-->>UI: vaultTokens (incl. management token)
  UI->>UI: extract & validate managementAccessToken
  UI->>Server: createProjectServerWallet({ project, label, managementAccessToken })
  Server->>Vault: createEoa({ label, metadata, token })
  Vault-->>Server: EOA (wallet)
  Server->>Engine: cache signer address (best-effort)
  Server-->>UI: created EOA
  UI-->>User: Project created with server wallet
Loading
sequenceDiagram
  autonumber
  participant Page as ProjectFTUX (server)
  participant Vault as getProjectWallet

  Page->>Vault: getProjectWallet(project)
  Vault-->>Page: ProjectWalletSummary | undefined
  Page->>Page: derive label via getProjectWalletLabel
  Page-->>User: render wallet section (address, copy, link) or alert
Loading
sequenceDiagram
  autonumber
  actor User
  participant Modal as CreateServerWallet (client)
  participant Server as createProjectServerWallet
  participant Vault as Vault SDK
  participant Engine as Engine Proxy

  User->>Modal: Confirm create wallet
  Modal->>Server: createProjectServerWallet({ label, project, managementAccessToken })
  Server->>Vault: createEoa(...)
  Vault-->>Server: EOA
  Server->>Engine: cache signer address
  Server-->>Modal: EOA
  Modal-->>User: Close modal, refresh, show wallet
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning While the pull request delivers the MVP functionality of auto-creating a default server wallet, it also introduces extensive features beyond that scope, including token transfer actions, payment link integrations, QuickstartSection enhancements, and comprehensive ProjectWalletControls UI components. These additions, although valuable, exceed the singular objective of BLD-372 which is focused on auto-creation of the project wallet. Consider refactoring or splitting the additional wallet management and payment integration features into separate pull requests or issues to keep this change focused on the auto-creation of the default server wallet as defined in BLD-372.
Description Check ⚠️ Warning The pull request description includes a brief overview and summary but does not follow the repository’s required template, as it omits the header with branch name or issue tag, “Notes for the reviewer” section, and “How to test” instructions. It lacks the structured headings and information expected by the template for consistent documentation. Please update the description to use the provided PR template, including the issue tag or branch name, notes for reviewers, and clear testing instructions under the “How to test” section.
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The title “Project Wallet (Default Server Wallet)” is a brief fragment that references the general feature but lacks a clear, concise description of the primary change and does not adhere to the recommended title format. It does not specify the addition of auto-creation of a default server wallet or the various management and UI enhancements introduced. A teammate scanning history may not fully understand the scope from this title alone. Please update the title to a concise sentence that clearly summarizes the primary change and follows the repository’s naming conventions, for example “[Dashboard] Feature: Add default project server wallet creation and management.”
✅ Passed checks (1 passed)
Check name Status Explanation
Linked Issues Check ✅ Passed The pull request implements the core requirement of BLD-372 by automatically creating a default server wallet named “ Wallet” during project creation and persisting its address in the engineCloud service. It also exposes getProjectWallet for retrieval and integrates the wallet into UI components like ProjectFTUX and ProjectWalletSection, satisfying the issue’s objectives.
✨ 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 firekeeper/project-wallet

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

@codecov
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.02%. Comparing base (f9283f3) to head (5d856fd).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8212      +/-   ##
==========================================
- Coverage   55.03%   55.02%   -0.02%     
==========================================
  Files         919      919              
  Lines       60569    60583      +14     
  Branches     4126     4126              
==========================================
  Hits        33333    33333              
- Misses      27132    27146      +14     
  Partials      104      104              
Flag Coverage Δ
packages 55.02% <ø> (-0.02%) ⬇️
see 2 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

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx (1)

327-327: Fix typo: "Projecct" → "Project".

There's a spelling error in the button text.

Apply this diff:

-            Create Projecct
+            Create Project
🧹 Nitpick comments (3)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (1)

164-177: Consider logging or monitoring cache failures.

The smart account caching call is fire-and-forget with only a console.warn on failure. If caching failures are frequent or impactful, consider adding metrics or structured logging for better observability.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (2)

180-182: Document the pagination API mismatch.

The @ts-expect-error comment mentions snake_case but could be more specific about the SDK's expected format versus what's being passed. Consider filing an issue with the vault-sdk maintainers to align the TypeScript types with the actual API contract.


216-219: Consider surfacing wallet load failures to users.

Currently, wallet fetch failures are silently logged and undefined is returned, causing the UI to show an "unavailable" alert. Consider whether certain error conditions (e.g., authentication failure, network timeout) should be displayed differently or trigger alerts for the development team.

📜 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 f9283f3 and b48949c.

📒 Files selected for processing (6)
  • apps/dashboard/src/@/components/project/create-project-modal/index.tsx (3 hunks)
  • apps/dashboard/src/@/lib/project-wallet.ts (1 hunks)
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (4 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (2 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx (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

**/*.{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:

  • apps/dashboard/src/@/components/project/create-project-modal/index.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx
  • apps/dashboard/src/@/lib/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.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/dashboard/src/@/components/project/create-project-modal/index.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx
  • apps/dashboard/src/@/lib/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.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/dashboard/src/@/components/project/create-project-modal/index.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx
  • apps/dashboard/src/@/lib/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts
apps/{dashboard,playground}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

apps/{dashboard,playground}/**/*.{ts,tsx}: Import UI primitives from @/components/ui/_ (e.g., Button, Input, Tabs, Card)
Use NavLink for internal navigation to get active state handling
Use Tailwind CSS for styling; no inline styles
Merge class names with cn() from @/lib/utils for conditional classes
Stick to design tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components must start with import "server-only"; use next/headers, server‑only env, heavy data fetching, and redirect() where appropriate
Client Components must start with 'use client'; handle interactivity with hooks and browser APIs
Server-side data fetching: call getAuthToken() from cookies, send Authorization: Bearer <token> header, and return typed results (avoid any)
Client-side data fetching: wrap calls in React Query with descriptive, stable queryKeys and set sensible staleTime/cacheTime (≥ 60s default); keep tokens secret via internal routes or server actions
Do not import posthog-js in server components (client-side only)

Files:

  • apps/dashboard/src/@/components/project/create-project-modal/index.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx
  • apps/dashboard/src/@/lib/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts
apps/{dashboard,playground}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Expose a className prop on the root element of every component

Files:

  • apps/dashboard/src/@/components/project/create-project-modal/index.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx
🧠 Learnings (1)
📚 Learning: 2025-07-18T19:20:32.530Z
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).

Applied to files:

  • apps/dashboard/src/@/components/project/create-project-modal/index.tsx
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx
🧬 Code graph analysis (5)
apps/dashboard/src/@/components/project/create-project-modal/index.tsx (2)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (2)
  • createVaultAccountAndAccessToken (81-130)
  • createProjectServerWallet (132-180)
apps/dashboard/src/@/lib/project-wallet.ts (1)
  • getProjectWalletLabel (8-21)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (4)
apps/dashboard/src/@/lib/project-wallet.ts (1)
  • getProjectWalletLabel (8-21)
apps/dashboard/src/@/components/ui/CopyTextButton.tsx (1)
  • CopyTextButton (9-68)
apps/dashboard/src/@/constants/public-envs.ts (1)
  • NEXT_PUBLIC_THIRDWEB_VAULT_URL (4-5)
packages/vault-sdk/src/sdk.ts (2)
  • createVaultClient (111-165)
  • listEoas (326-337)
apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx (2)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (2)
  • createVaultAccountAndAccessToken (81-130)
  • createProjectServerWallet (132-180)
apps/dashboard/src/@/lib/project-wallet.ts (1)
  • getProjectWalletLabel (8-21)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (1)
  • createProjectServerWallet (132-180)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (3)
apps/dashboard/src/@/lib/project-wallet.ts (1)
  • getProjectWalletLabel (8-21)
packages/vault-sdk/src/sdk.ts (1)
  • createEoa (313-324)
apps/dashboard/src/@/actions/proxies.ts (1)
  • engineCloudProxy (87-89)
⏰ 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). (6)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Lint Packages
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx (1)

62-89: LGTM! Proper error handling for wallet provisioning.

The vault token creation and wallet provisioning logic is well-structured with appropriate error handling. The validation for managementAccessToken ensures the wallet creation step won't proceed without the required token.

apps/dashboard/src/@/components/project/create-project-modal/index.tsx (1)

71-95: LGTM! Consistent wallet provisioning pattern.

The wallet creation flow matches the pattern used in the onboarding form, ensuring consistency across different project creation entry points.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx (1)

37-46: LGTM! Clean refactoring to use centralized helper.

The refactoring successfully eliminates duplicate vault client initialization and EOA creation logic by delegating to the createProjectServerWallet helper. This improves maintainability and consistency across the codebase.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (2)

36-61: LGTM! Proper async server component conversion.

The conversion to an async server component is well-executed. The wallet data is fetched server-side before rendering, which improves the user experience by avoiding client-side loading states for initial data.


198-209: Verify the fallback hierarchy logic.

The wallet selection prioritizes:

  1. Wallet with expected label
  2. Any wallet with type "server-wallet"
  3. First wallet in filtered list

Ensure this fallback strategy aligns with the product requirements, especially when multiple server wallets exist for a project.

Comment on lines +8 to +21
export function getProjectWalletLabel(projectName: string | undefined) {
const baseName = projectName?.trim() || "Project";
const maxBaseLength = Math.max(
1,
PROJECT_WALLET_LABEL_MAX_LENGTH - PROJECT_WALLET_LABEL_SUFFIX.length,
);

const normalizedBase =
baseName.length > maxBaseLength
? baseName.slice(0, maxBaseLength).trimEnd()
: baseName;

return `${normalizedBase}${PROJECT_WALLET_LABEL_SUFFIX}`;
}
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 | 🟠 Major

Add explicit return type annotation.

The function lacks an explicit return type. Per coding guidelines, TypeScript functions should have explicit return types.

Apply this diff:

-export function getProjectWalletLabel(projectName: string | undefined) {
+export function getProjectWalletLabel(projectName: string | undefined): string {
   const baseName = projectName?.trim() || "Project";
📝 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 getProjectWalletLabel(projectName: string | undefined) {
const baseName = projectName?.trim() || "Project";
const maxBaseLength = Math.max(
1,
PROJECT_WALLET_LABEL_MAX_LENGTH - PROJECT_WALLET_LABEL_SUFFIX.length,
);
const normalizedBase =
baseName.length > maxBaseLength
? baseName.slice(0, maxBaseLength).trimEnd()
: baseName;
return `${normalizedBase}${PROJECT_WALLET_LABEL_SUFFIX}`;
}
export function getProjectWalletLabel(projectName: string | undefined): string {
const baseName = projectName?.trim() || "Project";
const maxBaseLength = Math.max(
1,
PROJECT_WALLET_LABEL_MAX_LENGTH - PROJECT_WALLET_LABEL_SUFFIX.length,
);
const normalizedBase =
baseName.length > maxBaseLength
? baseName.slice(0, maxBaseLength).trimEnd()
: baseName;
return `${normalizedBase}${PROJECT_WALLET_LABEL_SUFFIX}`;
}
🤖 Prompt for AI Agents
In apps/dashboard/src/@/lib/project-wallet.ts around lines 8 to 21, the function
getProjectWalletLabel is missing an explicit return type; update the function
signature to declare the return type explicitly (e.g., add ": string" after the
parameter list), keep the existing implementation unchanged, and run TypeScript
type-checking to ensure no further signature issues.

Comment on lines 132 to 180
export async function createProjectServerWallet(props: {
project: Project;
managementAccessToken: string;
label?: string;
}) {
const vaultClient = await initVaultClient();

const walletLabel = props.label?.trim()
? props.label.trim()
: getProjectWalletLabel(props.project.name);

const eoa = await createEoa({
client: vaultClient,
request: {
auth: {
accessToken: props.managementAccessToken,
},
options: {
metadata: {
label: walletLabel,
projectId: props.project.id,
teamId: props.project.teamId,
type: "server-wallet",
},
},
},
});

if (!eoa.success) {
throw new Error(eoa.error?.message || "Failed to create server wallet");
}

engineCloudProxy({
body: JSON.stringify({
signerAddress: eoa.data.address,
}),
headers: {
"Content-Type": "application/json",
"x-client-id": props.project.publishableKey,
"x-team-id": props.project.teamId,
},
method: "POST",
pathname: "/cache/smart-account",
}).catch((err) => {
console.warn("failed to cache server wallet", err);
});

return eoa.data;
}
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 | 🟠 Major

Add explicit return type annotation.

The function lacks an explicit return type. Per coding guidelines, TypeScript functions should have explicit return types.

Apply this diff:

 export async function createProjectServerWallet(props: {
   project: Project;
   managementAccessToken: string;
   label?: string;
-}) {
+}): Promise<{ id: string; address: string }> {
   const vaultClient = await initVaultClient();

Note: Adjust the return type based on the actual structure of eoa.data. If it has additional fields, include them in the type annotation.

📝 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 async function createProjectServerWallet(props: {
project: Project;
managementAccessToken: string;
label?: string;
}) {
const vaultClient = await initVaultClient();
const walletLabel = props.label?.trim()
? props.label.trim()
: getProjectWalletLabel(props.project.name);
const eoa = await createEoa({
client: vaultClient,
request: {
auth: {
accessToken: props.managementAccessToken,
},
options: {
metadata: {
label: walletLabel,
projectId: props.project.id,
teamId: props.project.teamId,
type: "server-wallet",
},
},
},
});
if (!eoa.success) {
throw new Error(eoa.error?.message || "Failed to create server wallet");
}
engineCloudProxy({
body: JSON.stringify({
signerAddress: eoa.data.address,
}),
headers: {
"Content-Type": "application/json",
"x-client-id": props.project.publishableKey,
"x-team-id": props.project.teamId,
},
method: "POST",
pathname: "/cache/smart-account",
}).catch((err) => {
console.warn("failed to cache server wallet", err);
});
return eoa.data;
}
export async function createProjectServerWallet(props: {
project: Project;
managementAccessToken: string;
label?: string;
}): Promise<{ id: string; address: string }> {
const vaultClient = await initVaultClient();
const walletLabel = props.label?.trim()
? props.label.trim()
: getProjectWalletLabel(props.project.name);
const eoa = await createEoa({
client: vaultClient,
request: {
auth: {
accessToken: props.managementAccessToken,
},
options: {
metadata: {
label: walletLabel,
projectId: props.project.id,
teamId: props.project.teamId,
type: "server-wallet",
},
},
},
});
if (!eoa.success) {
throw new Error(eoa.error?.message || "Failed to create server wallet");
}
engineCloudProxy({
body: JSON.stringify({
signerAddress: eoa.data.address,
}),
headers: {
"Content-Type": "application/json",
"x-client-id": props.project.publishableKey,
"x-team-id": props.project.teamId,
},
method: "POST",
pathname: "/cache/smart-account",
}).catch((err) => {
console.warn("failed to cache server wallet", err);
});
return eoa.data;
}
🤖 Prompt for AI Agents
In
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts
around lines 132 to 180, the createProjectServerWallet function is missing an
explicit return type; add a precise Promise return type that matches eoa.data
(for example Promise<{ address: string; /* other fields */ }> or the existing
EoaData type if one exists), update the function signature to use that type, and
if necessary import or declare the interface/type so the signature is explicit
and accurate.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.6 KB (0%) 1.3 s (0%) 198 ms (+76.26% 🔺) 1.5 s
thirdweb (cjs) 365.75 KB (0%) 7.4 s (0%) 1.1 s (+0.04% 🔺) 8.4 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 69 ms (+1072.21% 🔺) 184 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 38 ms (+1287.63% 🔺) 48 ms
thirdweb/react (minimal + tree-shaking) 19.13 KB (0%) 383 ms (0%) 43 ms (+392.88% 🔺) 425 ms

Introduces a server utility to fetch the project wallet and propagates the project wallet address to payment-related components. Updates payment link creation and payout address forms to allow users to autofill with the project wallet address, improving usability and consistency across the dashboard.
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 7, 2025 15:29 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula October 7, 2025 15:29 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 7, 2025 15:29 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 7, 2025 15:29 Inactive
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: 2

🧹 Nitpick comments (4)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/PayConfig.tsx (1)

108-138: LGTM!

The "Use Project Wallet" button correctly populates the recipient field with proper form state management (shouldDirty, shouldTouch, shouldValidate).

Optional: The null check on line 117 is redundant since the button only renders when projectWalletAddress is truthy (line 114). However, it's a safe defensive practice.

-                          if (!props.projectWalletAddress) {
-                            return;
-                          }
-
                           form.setValue(
apps/dashboard/src/@/lib/server/project-wallet.ts (1)

62-62: Consider adding runtime validation for type safety.

The type assertion response.data.items as VaultWalletListItem[] assumes the API response matches the expected structure. If the API changes or returns unexpected data, this could cause runtime errors.

Consider adding basic runtime validation:

-    const items = response.data.items as VaultWalletListItem[] | undefined;
+    const items = Array.isArray(response.data.items) 
+      ? (response.data.items as VaultWalletListItem[])
+      : undefined;
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/CreatePaymentLinkButton.client.tsx (1)

191-225: LGTM!

The "Use Project Wallet" button correctly populates the recipient field with proper form state management.

Optional: Similar to PayConfig.tsx, the null check on line 204 is redundant since the button only renders when projectWalletAddress is truthy (line 200).

-                        onClick={() => {
-                          if (!props.projectWalletAddress) {
-                            return;
-                          }
-
                           form.setValue(
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (1)

67-69: Consider extracting address shortening to a utility function.

The address shortening pattern (${addr.slice(0, 6)}...${addr.slice(-4)}) is commonly used and would benefit from a shared utility function for consistency across the codebase.

Example utility in a shared lib file:

export function shortenAddress(address: string, startChars = 6, endChars = 4): string {
  if (address.length <= startChars + endChars) {
    return address;
  }
  return `${address.slice(0, startChars)}...${address.slice(-endChars)}`;
}

Then use it here:

-  const shortenedAddress = walletAddress
-    ? `${walletAddress.slice(0, 6)}...${walletAddress.slice(-4)}`
-    : undefined;
+  const shortenedAddress = walletAddress
+    ? shortenAddress(walletAddress)
+    : undefined;
📜 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 b48949c and 945ac3d.

📒 Files selected for processing (8)
  • apps/dashboard/src/@/lib/server/project-wallet.ts (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/QuickstartSection.client.tsx (2 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/CreatePaymentLinkButton.client.tsx (4 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/PaymentLinksTable.client.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx (4 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/PayConfig.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/page.tsx (3 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

**/*.{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:

  • apps/dashboard/src/@/lib/server/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/QuickstartSection.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/CreatePaymentLinkButton.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/PayConfig.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/PaymentLinksTable.client.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • apps/dashboard/src/@/lib/server/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/QuickstartSection.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/CreatePaymentLinkButton.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/PayConfig.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/PaymentLinksTable.client.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/dashboard/src/@/lib/server/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/QuickstartSection.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/CreatePaymentLinkButton.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/PayConfig.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/PaymentLinksTable.client.tsx
apps/{dashboard,playground}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

apps/{dashboard,playground}/**/*.{ts,tsx}: Import UI primitives from @/components/ui/_ (e.g., Button, Input, Tabs, Card)
Use NavLink for internal navigation to get active state handling
Use Tailwind CSS for styling; no inline styles
Merge class names with cn() from @/lib/utils for conditional classes
Stick to design tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components must start with import "server-only"; use next/headers, server‑only env, heavy data fetching, and redirect() where appropriate
Client Components must start with 'use client'; handle interactivity with hooks and browser APIs
Server-side data fetching: call getAuthToken() from cookies, send Authorization: Bearer <token> header, and return typed results (avoid any)
Client-side data fetching: wrap calls in React Query with descriptive, stable queryKeys and set sensible staleTime/cacheTime (≥ 60s default); keep tokens secret via internal routes or server actions
Do not import posthog-js in server components (client-side only)

Files:

  • apps/dashboard/src/@/lib/server/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/QuickstartSection.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/CreatePaymentLinkButton.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/PayConfig.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/PaymentLinksTable.client.tsx
apps/{dashboard,playground}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Expose a className prop on the root element of every component

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/QuickstartSection.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/CreatePaymentLinkButton.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/PayConfig.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/PaymentLinksTable.client.tsx
🧠 Learnings (2)
📚 Learning: 2025-08-20T10:35:18.543Z
Learnt from: jnsdls
PR: thirdweb-dev/js#7888
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx:77-81
Timestamp: 2025-08-20T10:35:18.543Z
Learning: The webhooks/payments route exists at apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx and was added as part of the unified project layout changes.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/QuickstartSection.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/PayConfig.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/PaymentLinksTable.client.tsx
📚 Learning: 2025-08-20T10:35:18.543Z
Learnt from: jnsdls
PR: thirdweb-dev/js#7888
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx:77-81
Timestamp: 2025-08-20T10:35:18.543Z
Learning: The webhooks/payments route exists at apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx and was added as part of the unified project layout PR #7888.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/PaymentLinksTable.client.tsx
🧬 Code graph analysis (4)
apps/dashboard/src/@/lib/server/project-wallet.ts (3)
apps/dashboard/src/@/constants/public-envs.ts (1)
  • NEXT_PUBLIC_THIRDWEB_VAULT_URL (4-5)
packages/vault-sdk/src/sdk.ts (2)
  • createVaultClient (111-165)
  • listEoas (326-337)
apps/dashboard/src/@/lib/project-wallet.ts (1)
  • getProjectWalletLabel (8-21)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/page.tsx (1)
apps/dashboard/src/@/lib/server/project-wallet.ts (1)
  • getProjectWallet (25-92)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx (2)
apps/dashboard/src/@/lib/server/project-wallet.ts (1)
  • getProjectWallet (25-92)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/QuickstartSection.client.tsx (1)
  • QuickStartSection (13-95)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (3)
apps/dashboard/src/@/lib/server/project-wallet.ts (2)
  • getProjectWallet (25-92)
  • ProjectWalletSummary (8-12)
apps/dashboard/src/@/lib/project-wallet.ts (1)
  • getProjectWalletLabel (8-21)
apps/dashboard/src/@/components/ui/CopyTextButton.tsx (1)
  • CopyTextButton (9-68)
⏰ 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 (8)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/QuickstartSection.client.tsx (1)

18-18: LGTM!

The prop forwarding is straightforward and correctly typed.

Also applies to: 47-47

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/settings/payments/page.tsx (1)

6-6: LGTM!

The server-side wallet retrieval and prop forwarding are correctly implemented with proper optional chaining.

Also applies to: 35-35, 70-70

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/PaymentLinksTable.client.tsx (1)

43-47: LGTM!

The prop threading through PaymentLinksTablePaymentLinksTableInnerCreatePaymentLinkButton is correctly implemented with proper typing.

Also applies to: 56-60, 65-69, 135-135

apps/dashboard/src/@/lib/server/project-wallet.ts (2)

74-77: LGTM! Well-designed fallback logic.

The wallet selection logic with multiple fallback levels (label match → type match → first wallet) provides good resilience. The use of getProjectWalletLabel for consistent labeling is a nice touch.


50-56: Ensure pagination covers all wallets The call to listEoas requests only the first 25 items (page 0, page_size 25), which may omit the default wallet if more exist. Iterate through pages or increase page_size, or document this limitation.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx (1)

9-9: LGTM!

The server-side wallet retrieval and distribution to child components (CreatePaymentLinkButton, PaymentLinksTable, QuickStartSection) is correctly implemented with proper optional chaining.

Also applies to: 33-33, 57-57, 148-148, 155-155

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (2)

1-31: LGTM!

The new imports for wallet functionality are appropriate and properly structured.


92-131: LGTM!

The wallet display logic is well-structured:

  • Properly handles both available and unavailable wallet states
  • Good UX showing shortened address in UI while copying full address
  • Clear user guidance with helpful alert and navigation link

Comment on lines 32 to 36
export async function ProjectFTUX(props: {
project: Project;
teamSlug: string;
}) {
const projectWallet = await getProjectWallet(props.project);
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

Add server component markers and return type.

This component fetches data server-side but is missing the required "server-only" import and explicit return type.

As per coding guidelines:

Apply this diff to add the server-only import at the top of the file:

+import "server-only";
+
 import {
   ArrowLeftRightIcon,

And add the explicit return type:

-export async function ProjectFTUX(props: {
+export async function ProjectFTUX(props: {
   project: Project;
   teamSlug: string;
-}) {
+}): Promise<JSX.Element> {
🤖 Prompt for AI Agents
In
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
around lines 32 to 36, the async server component is missing the required
server-only marker and an explicit return type; add the server-only import
directive (import "server-only") at the top of the file and change the function
signature to include an explicit Promise return type (e.g., export async
function ProjectFTUX(...): Promise<JSX.Element> or Promise<React.ReactNode>) so
the component is clearly marked server-only and its return type is explicit.

Comment on lines 59 to 69
function ProjectWalletSection(props: {
project: Project;
teamSlug: string;
wallet: ProjectWalletSummary | undefined;
}) {
const defaultLabel = getProjectWalletLabel(props.project.name);
const walletAddress = props.wallet?.address;
const label = props.wallet?.label ?? defaultLabel;
const shortenedAddress = walletAddress
? `${walletAddress.slice(0, 6)}...${walletAddress.slice(-4)}`
: undefined;
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 | 🟠 Major

Add className prop to component root.

Per coding guidelines, every component should expose a className prop on the root element for styling flexibility.

Apply this diff:

 function ProjectWalletSection(props: {
   project: Project;
   teamSlug: string;
   wallet: ProjectWalletSummary | undefined;
+  className?: string;
 }) {

And update the root element (line 72):

-  return (
-    <section>
+  return (
+    <section className={props.className}>
📝 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
function ProjectWalletSection(props: {
project: Project;
teamSlug: string;
wallet: ProjectWalletSummary | undefined;
}) {
const defaultLabel = getProjectWalletLabel(props.project.name);
const walletAddress = props.wallet?.address;
const label = props.wallet?.label ?? defaultLabel;
const shortenedAddress = walletAddress
? `${walletAddress.slice(0, 6)}...${walletAddress.slice(-4)}`
: undefined;
function ProjectWalletSection(props: {
project: Project;
teamSlug: string;
wallet: ProjectWalletSummary | undefined;
className?: string;
}) {
const defaultLabel = getProjectWalletLabel(props.project.name);
const walletAddress = props.wallet?.address;
const label = props.wallet?.label ?? defaultLabel;
const shortenedAddress = walletAddress
? `${walletAddress.slice(0, 6)}...${walletAddress.slice(-4)}`
: undefined;
return (
<section className={props.className}>
{/* …existing JSX children… */}
</section>
);
}
🤖 Prompt for AI Agents
In
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
around lines 59–69 and update the root element at line 72: add an optional
className?: string to the ProjectWalletSection props, and pass/merge that
className onto the component's root element on line 72 (use the existing class
string merger approach in the codebase — e.g. clsx or template concatenation —
so external styles can be applied without losing internal classes).

Introduces ProjectWalletControls component to manage project wallet actions, including copying the address, sending, and receiving funds. Adds a modal for sending tokens with form validation and credential caching. Refactors ProjectFTUX to use the new controls and implements the sendProjectWalletTokens server action.
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 7, 2025 18:25 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula October 7, 2025 18:25 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 7, 2025 18:25 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 7, 2025 18:25 Inactive
The amount field in the send form schema no longer enforces a check for values greater than 0, only requiring a non-empty string. Default amount values are also changed from '0.1' to '0'.
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 7, 2025 18:29 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula October 7, 2025 18:29 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 7, 2025 18:29 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 7, 2025 21:00 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 7, 2025 21:00 Inactive
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: 2

♻️ Duplicate comments (3)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx (3)

53-58: Expose className prop on root container.

The root container hardcodes className="space-y-5" with no override mechanism. Dashboard components must accept and forward a className prop per coding guidelines.

Apply this diff:

 type ProjectWalletControlsProps = {
   walletAddress: string;
   label: string;
   project: Pick<Project, "id" | "publishableKey" | "teamId" | "services">;
   defaultChainId?: number;
+  className?: string;
 };

 export function ProjectWalletControls(props: ProjectWalletControlsProps) {
-  const { walletAddress, label, project, defaultChainId } = props;
+  const { walletAddress, label, project, defaultChainId, className } = props;
   ...
   return (
-    <div className="space-y-5">
+    <div className={cn("space-y-5", className)}>

As per coding guidelines
Based on learnings

Also applies to: 95-96


231-231: Validate that amount is a positive number.

The amount field only checks for non-empty string, allowing "0", negative values, or non-numeric input. Since the default is "0" (line 276) and toWei() is called on line 309, users could submit invalid amounts or trigger runtime errors.

Apply this diff:

-    amount: z.string().trim().min(1, "Amount is required"),
+    amount: z
+      .string()
+      .trim()
+      .min(1, "Amount is required")
+      .refine(
+        (val) => {
+          const num = Number(val);
+          return !Number.isNaN(num) && Number.isFinite(num) && num > 0;
+        },
+        { message: "Amount must be a positive number" },
+      ),

294-305: Clear secretKey when modal closes.

The reset preserves secretKey from currentValues (line 300), contradicting the comment about avoiding state leakage. Retaining credentials in component state after modal close poses an exposure risk.

Apply this diff:

   useEffect(() => {
     if (!open) {
       const currentValues = form.getValues();
       form.reset({
         amount: "0",
         chainId,
-        secretKey: currentValues.secretKey ?? "",
+        secretKey: "",
         vaultAccessToken: currentValues.vaultAccessToken ?? "",
         toAddress: "",
       });
     }
   }, [open, chainId, form]);
📜 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 3b32b8a and b8b70c7.

📒 Files selected for processing (1)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx (1 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

**/*.{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:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.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/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
apps/{dashboard,playground}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

apps/{dashboard,playground}/**/*.{ts,tsx}: Import UI primitives from @/components/ui/_ (e.g., Button, Input, Tabs, Card)
Use NavLink for internal navigation to get active state handling
Use Tailwind CSS for styling; no inline styles
Merge class names with cn() from @/lib/utils for conditional classes
Stick to design tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components must start with import "server-only"; use next/headers, server‑only env, heavy data fetching, and redirect() where appropriate
Client Components must start with 'use client'; handle interactivity with hooks and browser APIs
Server-side data fetching: call getAuthToken() from cookies, send Authorization: Bearer <token> header, and return typed results (avoid any)
Client-side data fetching: wrap calls in React Query with descriptive, stable queryKeys and set sensible staleTime/cacheTime (≥ 60s default); keep tokens secret via internal routes or server actions
Do not import posthog-js in server components (client-side only)

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
apps/{dashboard,playground}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Expose a className prop on the root element of every component

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
🧠 Learnings (7)
📚 Learning: 2025-07-18T19:20:32.530Z
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).

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx} : Expose `className` prop on root element of components for overrides

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 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 apps/{dashboard,playground}/**/*.tsx : Expose a `className` prop on the root element of every component

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Add `className` to the root element of every component for external overrides.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Combine class names via `cn`, expose `className` prop if useful.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Use the `container` class with a `max-w-7xl` cap for page width consistency.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Merge class names with `cn` from `@/lib/utils` to keep conditional logic readable.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
🧬 Code graph analysis (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx (4)
apps/dashboard/src/@/hooks/chains/v5-adapter.ts (1)
  • useV5DashboardChain (14-28)
apps/dashboard/src/@/components/blocks/NetworkSelectors.tsx (1)
  • SingleNetworkSelector (152-298)
apps/dashboard/src/@/components/blocks/fund-wallets-modal/index.tsx (1)
  • FundWalletModal (76-93)
apps/dashboard/src/@/actions/project-wallet/send-tokens.ts (1)
  • sendProjectWalletTokens (12-74)
⏰ 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: Analyze (javascript)
🔇 Additional comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx (1)

307-349: LGTM! Well-structured mutation with proper error handling.

The mutation logic correctly converts amount to Wei, passes credentials securely, handles errors with user-friendly toasts, and refreshes balance on success. The transaction ID display in the success toast is good UX.

@vercel vercel bot temporarily deployed to Preview – nebula October 8, 2025 00:34 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 8, 2025 00:34 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 8, 2025 00:34 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 8, 2025 00:34 Inactive
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: 2

♻️ Duplicate comments (5)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx (2)

52-207: Expose a className prop on the root wrapper.

Per dashboard guidelines we need className?: string on component props and merge it onto the root element (e.g. cn("space-y-5", className)) so callers can extend styling. Please add the prop and forward it to the outer <div>.


285-297: Clear the secret key when the modal closes.

form.reset copies currentValues.secretKey, keeping the credential in memory after the modal closes. Reset it to an empty string so the secret key isn’t retained between openings.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (2)

1-39: Add server component markers and explicit return type.

This component fetches data server-side but is missing the required "server-only" import and explicit return type.

As per coding guidelines and learnings:

Apply this diff to add the server-only import at the top of the file:

+import "server-only";
+
 import {
   ArrowLeftRightIcon,

And add the explicit return type:

 export async function ProjectFTUX(props: {
   project: Project;
   teamSlug: string;
   wallet?: ProjectWalletSummary | undefined;
   managementAccessToken: string | undefined;
-}) {
+}): Promise<JSX.Element> {

64-75: Add className prop to component root.

Per coding guidelines and learnings, every component should expose a className prop on the root element for styling flexibility.

Apply this diff:

 export function ProjectWalletSection(props: {
   project: Project;
   teamSlug: string;
   wallet: ProjectWalletSummary | undefined;
   managementAccessToken: string | undefined;
+  className?: string;
 }) {

And update the root element (line 75):

   return (
-    <section>
+    <section className={props.className}>
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (1)

132-188: Add explicit return type annotation.

The function lacks an explicit return type. Per coding guidelines, TypeScript functions should have explicit return types.

Apply this diff:

 export async function createProjectServerWallet(props: {
   project: Project;
   managementAccessToken: string;
   label?: string;
   setAsProjectWallet?: boolean;
-}) {
+}): Promise<{ id: string; address: string }> {
   const vaultClient = await initVaultClient();

Note: Adjust the return type based on the actual structure of eoa.data. If it has additional fields, include them in the type annotation.

📜 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 b8b70c7 and 630f6cf.

📒 Files selected for processing (10)
  • apps/dashboard/src/@/components/project/create-project-modal/index.tsx (2 hunks)
  • apps/dashboard/src/@/lib/server/project-wallet.ts (1 hunks)
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx (2 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx (5 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (5 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx (2 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx (6 hunks)
  • packages/service-utils/src/core/api.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/create-project/_components/create-project-form.tsx
  • apps/dashboard/src/@/lib/server/project-wallet.ts
  • apps/dashboard/src/@/components/project/create-project-modal/index.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/service-utils/src/core/api.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.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/service-utils/src/core/api.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.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/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
apps/{dashboard,playground}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

apps/{dashboard,playground}/**/*.{ts,tsx}: Import UI primitives from @/components/ui/_ (e.g., Button, Input, Tabs, Card)
Use NavLink for internal navigation to get active state handling
Use Tailwind CSS for styling; no inline styles
Merge class names with cn() from @/lib/utils for conditional classes
Stick to design tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components must start with import "server-only"; use next/headers, server‑only env, heavy data fetching, and redirect() where appropriate
Client Components must start with 'use client'; handle interactivity with hooks and browser APIs
Server-side data fetching: call getAuthToken() from cookies, send Authorization: Bearer <token> header, and return typed results (avoid any)
Client-side data fetching: wrap calls in React Query with descriptive, stable queryKeys and set sensible staleTime/cacheTime (≥ 60s default); keep tokens secret via internal routes or server actions
Do not import posthog-js in server components (client-side only)

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
apps/{dashboard,playground}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Expose a className prop on the root element of every component

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
🧠 Learnings (16)
📚 Learning: 2025-08-20T10:35:18.543Z
Learnt from: jnsdls
PR: thirdweb-dev/js#7888
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx:77-81
Timestamp: 2025-08-20T10:35:18.543Z
Learning: The webhooks/payments route exists at apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx and was added as part of the unified project layout changes.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
📚 Learning: 2025-08-20T10:35:18.543Z
Learnt from: jnsdls
PR: thirdweb-dev/js#7888
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx:77-81
Timestamp: 2025-08-20T10:35:18.543Z
Learning: The webhooks/payments route exists at apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/payments/page.tsx and was added as part of the unified project layout PR #7888.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Server Components (Node edge): Start files with `import "server-only";`

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
📚 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 apps/{dashboard,playground}/**/*.{ts,tsx} : Server Components must start with `import "server-only"`; use `next/headers`, server‑only env, heavy data fetching, and `redirect()` where appropriate

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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} : Prefix files with `import "server-only";` so they never end up in the client bundle.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
📚 Learning: 2025-05-21T05:17:31.283Z
Learnt from: jnsdls
PR: thirdweb-dev/js#6929
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/insight/webhooks/page.tsx:14-19
Timestamp: 2025-05-21T05:17:31.283Z
Learning: In Next.js server components, the `params` object can sometimes be a Promise that needs to be awaited, despite type annotations suggesting otherwise. In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/insight/webhooks/page.tsx, it's necessary to await the params object before accessing its properties.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx} : Expose `className` prop on root element of components for overrides

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 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 apps/{dashboard,playground}/**/*.tsx : Expose a `className` prop on the root element of every component

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Add `className` to the root element of every component for external overrides.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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).

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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 : Use React Query (`tanstack/react-query`) for all client data fetching.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Combine class names via `cn`, expose `className` prop if useful.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Use the `container` class with a `max-w-7xl` cap for page width consistency.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Merge class names with `cn` from `@/lib/utils` to keep conditional logic readable.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-09-03T23:35:50.476Z
Learnt from: MananTank
PR: thirdweb-dev/js#7977
File: apps/playground-web/src/app/page.tsx:61-65
Timestamp: 2025-09-03T23:35:50.476Z
Learning: In the thirdweb-dev/js codebase, specifically for React components in **/*.{ts,tsx} files, do not suggest adding explicit return types like `: JSX.Element` or `: React.ReactElement` to function components. The project maintainer MananTank has explicitly declined these suggestions.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
🧬 Code graph analysis (6)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx (2)
apps/dashboard/src/@/lib/server/project-wallet.ts (1)
  • getProjectWallet (25-97)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (2)
  • ProjectWalletSection (64-137)
  • ProjectFTUX (34-62)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (4)
apps/dashboard/src/@/lib/server/project-wallet.ts (2)
  • ProjectWalletSummary (8-12)
  • getProjectWallet (25-97)
apps/dashboard/src/@/lib/project-wallet.ts (1)
  • getProjectWalletLabel (8-21)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx (1)
  • ProjectWalletControls (59-209)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx (1)
  • CreateServerWallet (20-135)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (4)
apps/dashboard/src/@/lib/project-wallet.ts (1)
  • getProjectWalletLabel (8-21)
packages/vault-sdk/src/sdk.ts (1)
  • createEoa (313-324)
apps/dashboard/src/@/actions/proxies.ts (1)
  • engineCloudProxy (87-89)
apps/dashboard/src/@/hooks/useApi.ts (1)
  • updateProjectClient (264-289)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (1)
  • updateDefaultProjectWallet (190-214)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/components/create-server-wallet.client.tsx (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (1)
  • createProjectServerWallet (132-188)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx (4)
apps/dashboard/src/@/hooks/chains/v5-adapter.ts (1)
  • useV5DashboardChain (14-28)
apps/dashboard/src/@/components/blocks/NetworkSelectors.tsx (1)
  • SingleNetworkSelector (152-298)
apps/dashboard/src/@/components/blocks/fund-wallets-modal/index.tsx (1)
  • FundWalletModal (76-93)
apps/dashboard/src/@/actions/project-wallet/send-tokens.ts (1)
  • sendProjectWalletTokens (12-74)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Unit Tests
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (1)

247-252: LGTM!

The integration of default project wallet creation is well-placed. The wallet is created after access tokens are generated, and the address is correctly propagated to both the encrypted and non-encrypted service update paths.

Also applies to: 288-288, 311-311

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 8, 2025 00:42 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 8, 2025 00:42 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula October 8, 2025 00:42 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 8, 2025 00:42 Inactive
Introduces a new action to list project server wallets and updates ProjectWalletControls to allow users to select and change the default server wallet for a project. Updates related types and props, and improves label handling in getProjectWallet. Also updates the ProjectFTUX story to include managementAccessToken.
@vercel vercel bot temporarily deployed to Preview – nebula October 8, 2025 13:37 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 8, 2025 13:37 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 8, 2025 13:37 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 8, 2025 13:37 Inactive
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 (3)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx (3)

71-193: Expose className prop on root container.

Dashboard components must accept and forward a className prop to the root element. The root div at line 193 hardcodes className="space-y-5" with no override mechanism.

Apply this diff to add the prop:

 type ProjectWalletControlsProps = {
   walletAddress: string;
   label: string;
   project: Pick<
     Project,
     "id" | "publishableKey" | "teamId" | "services" | "name"
   >;
   defaultChainId?: number;
+  className?: string;
 };

 export function ProjectWalletControls(props: ProjectWalletControlsProps) {
-  const { walletAddress, label, project, defaultChainId } = props;
+  const { walletAddress, label, project, defaultChainId, className } = props;
   // ... rest of the component
   return (
-    <div className="space-y-5">
+    <div className={cn("space-y-5", className)}>

As per coding guidelines


430-445: Block zero and negative transfer amounts.

The amount field only validates that the string is non-empty (line 442), allowing "0" or negative values. Since the default is "0" (line 487), users can submit zero-value transfers.

Apply this diff to enforce positive amounts:

 const createSendFormSchema = (secretKeyLabel: string) =>
   z.object({
     chainId: z.number({
       required_error: "Select a network",
     }),
     toAddress: z
       .string()
       .trim()
       .min(1, "Destination address is required")
       .refine((value) => Boolean(isAddress(value)), {
         message: "Enter a valid wallet address",
       }),
-    amount: z.string().trim().min(1, "Amount is required"),
+    amount: z
+      .string()
+      .trim()
+      .min(1, "Amount is required")
+      .refine(
+        (val) => {
+          const num = Number(val);
+          return !Number.isNaN(num) && num > 0;
+        },
+        { message: "Amount must be greater than 0" },
+      ),
     secretKey: z.string().trim().min(1, `${secretKeyLabel} is required`),
     vaultAccessToken: z.string().trim(),
   });

505-516: Clear secretKey when modal closes.

The reset logic preserves secretKey in component state when the modal closes (line 511), keeping credentials in memory unnecessarily after the modal is dismissed.

Apply this diff to clear credentials:

   useEffect(() => {
     if (!open) {
       const currentValues = form.getValues();
       form.reset({
         amount: "0",
         chainId,
-        secretKey: currentValues.secretKey ?? "",
+        secretKey: "",
         vaultAccessToken: currentValues.vaultAccessToken ?? "",
         toAddress: "",
       });
     }
   }, [open, chainId, form]);
🧹 Nitpick comments (2)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.stories.tsx (1)

34-35: Avoid explicit undefined in Story args; prefer argTypes (and hide token controls).

Omit this prop from args and, if needed for docs/controls, define argTypes. Also hide this token-like prop by default to prevent accidental entry/exposure in Storybook.

  • Please confirm managementAccessToken is optional in ProjectFTUX and that omitting it won’t break the story.

Apply this diff to remove the arg:

-    managementAccessToken: undefined,

Optionally, add argTypes in meta to control/hide the prop:

// outside selected lines – add to `meta`
const meta = {
  component: ProjectFTUX,
  decorators: [/* ... */],
+ argTypes: {
+   managementAccessToken: {
+     control: "text",
+     table: { disable: true }, // hide by default; avoids accidental token exposure
+     description: "Management access token (server-only; leave empty in stories).",
+   },
+ },
  title: "Project/ProjectFTUX",
} satisfies Meta<typeof ProjectFTUX>;
apps/dashboard/src/@/actions/project-wallet/list-server-wallets.ts (1)

7-16: Consider consolidating VaultWalletListItem type.

The VaultWalletListItem type is defined here (lines 7-16) and also in apps/dashboard/src/@/lib/server/project-wallet.ts (lines 14-23) with slight differences (metadata is | null here but not in the other file). Consolidating to a shared type would improve maintainability.

Consider extracting the type to a shared location:

// In a new file: apps/dashboard/src/@/types/vault.ts
export interface VaultWalletListItem {
  id: string;
  address: string;
  metadata?: {
    label?: string;
    projectId?: string;
    teamId?: string;
    type?: string;
  } | null;
}

Then import it in both files:

import type { VaultWalletListItem } from "@/types/vault";

Also applies to: 52-65

📜 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 5595cd7 and 5d856fd.

📒 Files selected for processing (5)
  • apps/dashboard/src/@/actions/project-wallet/list-server-wallets.ts (1 hunks)
  • apps/dashboard/src/@/lib/server/project-wallet.ts (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.stories.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{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:

  • apps/dashboard/src/@/actions/project-wallet/list-server-wallets.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
  • apps/dashboard/src/@/lib/server/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.stories.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • apps/dashboard/src/@/actions/project-wallet/list-server-wallets.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
  • apps/dashboard/src/@/lib/server/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.stories.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/dashboard/src/@/actions/project-wallet/list-server-wallets.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
  • apps/dashboard/src/@/lib/server/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.stories.tsx
apps/{dashboard,playground}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

apps/{dashboard,playground}/**/*.{ts,tsx}: Import UI primitives from @/components/ui/_ (e.g., Button, Input, Tabs, Card)
Use NavLink for internal navigation to get active state handling
Use Tailwind CSS for styling; no inline styles
Merge class names with cn() from @/lib/utils for conditional classes
Stick to design tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components must start with import "server-only"; use next/headers, server‑only env, heavy data fetching, and redirect() where appropriate
Client Components must start with 'use client'; handle interactivity with hooks and browser APIs
Server-side data fetching: call getAuthToken() from cookies, send Authorization: Bearer <token> header, and return typed results (avoid any)
Client-side data fetching: wrap calls in React Query with descriptive, stable queryKeys and set sensible staleTime/cacheTime (≥ 60s default); keep tokens secret via internal routes or server actions
Do not import posthog-js in server components (client-side only)

Files:

  • apps/dashboard/src/@/actions/project-wallet/list-server-wallets.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
  • apps/dashboard/src/@/lib/server/project-wallet.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.stories.tsx
apps/{dashboard,playground}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Expose a className prop on the root element of every component

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.stories.tsx
**/*.stories.tsx

📄 CodeRabbit inference engine (CLAUDE.md)

For new UI components, add Storybook stories (*.stories.tsx) alongside the code

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.stories.tsx
apps/{dashboard,playground}/**/*.stories.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Add Storybook stories (*.stories.tsx) alongside new UI components

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.stories.tsx
🧠 Learnings (8)
📚 Learning: 2025-07-18T19:20:32.530Z
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).

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx} : Expose `className` prop on root element of components for overrides

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 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 apps/{dashboard,playground}/**/*.tsx : Expose a `className` prop on the root element of every component

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Add `className` to the root element of every component for external overrides.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Combine class names via `cn`, expose `className` prop if useful.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Use the `container` class with a `max-w-7xl` cap for page width consistency.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
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/**/*.{tsx,jsx} : Merge class names with `cn` from `@/lib/utils` to keep conditional logic readable.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
📚 Learning: 2025-09-03T23:35:50.476Z
Learnt from: MananTank
PR: thirdweb-dev/js#7977
File: apps/playground-web/src/app/page.tsx:61-65
Timestamp: 2025-09-03T23:35:50.476Z
Learning: In the thirdweb-dev/js codebase, specifically for React components in **/*.{ts,tsx} files, do not suggest adding explicit return types like `: JSX.Element` or `: React.ReactElement` to function components. The project maintainer MananTank has explicitly declined these suggestions.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx
🧬 Code graph analysis (3)
apps/dashboard/src/@/actions/project-wallet/list-server-wallets.ts (3)
apps/dashboard/src/@/lib/server/project-wallet.ts (1)
  • ProjectWalletSummary (8-12)
apps/dashboard/src/@/constants/public-envs.ts (1)
  • NEXT_PUBLIC_THIRDWEB_VAULT_URL (4-5)
packages/vault-sdk/src/sdk.ts (2)
  • createVaultClient (111-165)
  • listEoas (326-337)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectWalletControls.client.tsx (7)
apps/dashboard/src/@/hooks/chains/v5-adapter.ts (1)
  • useV5DashboardChain (14-28)
apps/dashboard/src/@/lib/server/project-wallet.ts (1)
  • ProjectWalletSummary (8-12)
apps/dashboard/src/@/actions/project-wallet/list-server-wallets.ts (1)
  • listProjectServerWallets (18-70)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/lib/vault.client.ts (1)
  • updateDefaultProjectWallet (190-216)
apps/dashboard/src/@/components/blocks/NetworkSelectors.tsx (1)
  • SingleNetworkSelector (152-298)
apps/dashboard/src/@/components/blocks/fund-wallets-modal/index.tsx (1)
  • FundWalletModal (76-93)
apps/dashboard/src/@/actions/project-wallet/send-tokens.ts (1)
  • sendProjectWalletTokens (12-74)
apps/dashboard/src/@/lib/server/project-wallet.ts (3)
apps/dashboard/src/@/constants/public-envs.ts (1)
  • NEXT_PUBLIC_THIRDWEB_VAULT_URL (4-5)
packages/vault-sdk/src/sdk.ts (2)
  • createVaultClient (111-165)
  • listEoas (326-337)
apps/dashboard/src/@/lib/project-wallet.ts (1)
  • getProjectWalletLabel (8-21)
⏰ 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: Lint Packages
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/dashboard/src/@/actions/project-wallet/list-server-wallets.ts (1)

18-70: LGTM! Well-structured server action.

The function implements proper defensive programming with early returns for missing credentials, appropriate error handling with logging, and consistent return types. The filter logic correctly identifies server wallets by projectId and type, and the pagination handling with the documented ts-expect-error is acceptable.

apps/dashboard/src/@/lib/server/project-wallet.ts (2)

1-12: LGTM! Proper server-side module setup.

The file correctly starts with "server-only" import to prevent client-side usage, and exports a clean ProjectWalletSummary type that's used consistently across the codebase.


25-99: LGTM! Well-implemented wallet lookup with proper safeguards.

The function implements thorough defensive programming with early returns for missing required data (lines 38-44), proper error handling with logging (lines 95-98), and correct filtering logic. The case-insensitive address comparison (line 83) is essential for matching, and the fallback to defaultLabel via getProjectWalletLabel (lines 75, 93) ensures a consistent UX when metadata is missing.

@0xFirekeeper 0xFirekeeper merged commit 163ab8a into main Oct 8, 2025
24 checks passed
@0xFirekeeper 0xFirekeeper deleted the firekeeper/project-wallet branch October 8, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard. packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants