Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Sep 9, 2025


PR-Codex overview

This PR focuses on refactoring the code in the useAbiProcessing.ts and wallet-table-ui.client.tsx files to replace the usage of defineChain from thirdweb/chains with a new custom hook, useGetV5DashboardChain and useV5DashboardChain, improving the chain handling logic.

Detailed summary

  • In useAbiProcessing.ts:

    • Replaced defineChain with getChain from useGetV5DashboardChain.
  • In wallet-table-ui.client.tsx:

    • Removed defineChain usage in favor of useV5DashboardChain.
    • Updated the chain handling logic for wallet balance and server wallet table row components.

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

Summary by CodeRabbit

  • Refactor
    • Unified chain data retrieval across wallet tables and webhook ABI processing using the new dashboard adapter for more consistent behavior.
    • Streamlined balance and smart-account address resolution to reduce redundant computation and potential mismatches.
    • Updated internal hooks and imports; no changes to public interfaces or user workflows.

@linear
Copy link

linear bot commented Sep 9, 2025

@vercel
Copy link

vercel bot commented Sep 9, 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 Sep 9, 2025 7:21pm
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs-v2 Skipped Skipped Sep 9, 2025 7:21pm
nebula Skipped Skipped Sep 9, 2025 7:21pm
thirdweb_playground Skipped Skipped Sep 9, 2025 7:21pm
wallet-ui Skipped Skipped Sep 9, 2025 7:21pm

@vercel vercel bot temporarily deployed to Preview – docs-v2 September 9, 2025 16:54 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula September 9, 2025 16:54 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground September 9, 2025 16:54 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui September 9, 2025 16:54 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Sep 9, 2025

⚠️ No Changeset found

Latest commit: 85d6074

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

@MananTank MananTank marked this pull request as ready for review September 9, 2025 16:54
@MananTank MananTank requested review from a team as code owners September 9, 2025 16:54
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 9, 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

Replaces static chain resolution (defineChain) with v5 dashboard chain adapter hooks in wallet table UI and ABI processing files, updating imports and passing hook-resolved chain objects to balance and contract ABI retrieval logic without changing public APIs or signatures.

Changes

Cohort / File(s) Summary of Changes
Server wallets table: v5 chain hook migration
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
Replaced defineChain with useV5DashboardChain in two places; removed useMemo-based chain derivation; switched ThirdwebClient import to type-only; passed hook-derived chain to useWalletBalance and smart account address logic.
Webhooks ABI processing: v5 chain resolver
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useAbiProcessing.ts
Replaced defineChain with useGetV5DashboardChain and created local getChain instance; use getChain(Number(chainId)) when constructing chain for getContract; removed ESLint suppression; public hook signature unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as ServerWalletTableRow
  participant Hook as useV5DashboardChain
  participant Bal as useWalletBalance
  participant RPC as RPC Provider

  UI->>Hook: resolve chain(chainId)
  Hook-->>UI: chain object
  UI->>Bal: request balance(address, chain)
  Bal->>RPC: fetch balance via chain RPC
  RPC-->>Bal: balance
  Bal-->>UI: balance data
  Note over UI,Hook: Chain resolution moved to v5 adapter hook
Loading
sequenceDiagram
  autonumber
  participant HookFn as useAbiMultiFetch
  participant Get as useGetV5DashboardChain
  participant TW as getContract
  participant RPC as RPC Provider

  HookFn->>Get: resolve chain(Number(chainId))
  Get-->>HookFn: chain object
  HookFn->>TW: getContract(address, chain, client)
  TW->>RPC: fetch ABI/contract data
  RPC-->>TW: ABI/contract instance
  TW-->>HookFn: contract instance/ABI
  Note over HookFn,Get: Chain resolution delegated to v5 adapter
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (2 passed, 3 warnings)

❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The changes in useAbiProcessing.ts replace defineChain usage for webhook ABI processing, which is unrelated to the server wallet balance fetching objective outlined in BLD-277, indicating those modifications are outside the scope of the linked issue. Extract the ABI-processing hook updates into a separate PR and confine this PR to the wallet balance fix to maintain focused scope.
Description Check ⚠️ Warning The current description still contains the commented-out template and lacks the required “Notes for the reviewer” and “How to test” sections, so it does not follow the repository’s PR template or provide necessary reviewer guidance and testing instructions. Please replace the placeholder template comments with actual content by filling in the PR title in the specified format, adding a “Notes for the reviewer” section with relevant context, and providing concrete “How to test” steps.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “[BLD-277] Fix Server Wallets balance fetching for custom chains” directly reflects the primary change of updating chain resolution logic to address balance-fetching for custom chains, making it clear, concise, and fully related to the changes in the PR. It highlights the main issue being fixed without including extraneous details.
Linked Issues Check ✅ Passed The PR updates the wallet-table UI components to use the new useV5DashboardChain hook for chain resolution, directly addressing the BLD-277 issue of fixing server wallet balance fetching for custom chains. All relevant code paths for balance retrieval have been refactored to meet the stated objective.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

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

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • 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 0ba43d8 and 85d6074.

📒 Files selected for processing (2)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx (4 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useAbiProcessing.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useAbiProcessing.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
⏰ 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)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bld-277

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

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Sep 9, 2025
Copy link
Member Author

MananTank commented Sep 9, 2025


How to use the Graphite Merge Queue

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

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

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

// eslint-disable-next-line no-restricted-syntax
return defineChain(chainId);
}, [chainId]);
const chain = useV5DashboardChain(chainId);
Copy link
Contributor

Choose a reason for hiding this comment

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

Potential behavior change with useV5DashboardChain

The switch from defineChain(chainId) to useV5DashboardChain(chainId) may introduce different handling for invalid/unsupported chain IDs:

  • defineChain() would attempt to create a chain object even for unknown chains
  • useV5DashboardChain() might return null or undefined for unsupported chains

This could cause runtime errors in components that expect a valid chain object. Consider:

  1. Adding validation to handle potential null/undefined chain values
  2. Ensuring useV5DashboardChain has equivalent fallback behavior to defineChain
  3. Adding tests for edge cases with unsupported chain IDs

This is particularly important for the wallet balance functionality which depends on a valid chain object.

Suggested change
const chain = useV5DashboardChain(chainId);
const chain = useV5DashboardChain(chainId) ?? defineChain(chainId);

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.62%. Comparing base (2f6f3a0) to head (85d6074).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8026   +/-   ##
=======================================
  Coverage   56.62%   56.62%           
=======================================
  Files         904      904           
  Lines       58677    58677           
  Branches     4161     4161           
=======================================
  Hits        33225    33225           
  Misses      25346    25346           
  Partials      106      106           
Flag Coverage Δ
packages 56.62% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.96 KB (0%) 1.3 s (0%) 354 ms (+67.05% 🔺) 1.7 s
thirdweb (cjs) 356.86 KB (0%) 7.2 s (0%) 1.7 s (+8.05% 🔺) 8.8 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 113 ms (+1017.66% 🔺) 228 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 86 ms (+2223.19% 🔺) 96 ms
thirdweb/react (minimal + tree-shaking) 19.15 KB (0%) 383 ms (0%) 85 ms (+158.92% 🔺) 468 ms

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

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)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx (1)

150-153: Invalidate the full useWalletBalance key including the wallet address
The hook’s internal key is ["walletBalance", chain?.id, address] (see useWalletBalance implementation), so invalidating only ["walletBalance", selectedChainId] won’t match. Update to:

- await queryClient.invalidateQueries({
-   queryKey: ["walletBalance", selectedChainId],
- });
+ await queryClient.invalidateQueries({
+   queryKey: ["walletBalance", selectedChainId, selectedAddress],
+ });

Or, if you need to catch all balance queries regardless of address, use a predicate as originally suggested.

🧹 Nitpick comments (7)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useAbiProcessing.ts (3)

58-63: Consider guarding missing chain data for clearer errors

If a custom chain isn’t loaded yet, defineDashboardChain should still return a chain, but if the adapter ever yields an unexpected value, the error surfaces only from getContract/resolveAbiFromContractApi. A fast-fail improves debuggability.

- const chainObj = getChain(Number(chainId));
+ const chainObj = getChain(Number(chainId));
+ if (!chainObj) {
+   throw new Error(`Unknown chain: ${chainId}`);
+ }

76-93: Key by chain+address to avoid cross-chain collisions

abisByAddress and fetchedAbis are keyed only by address. Same address on different chains will overwrite each other.

- const map: Record<string, { chainId: string; address: string; data?: AbiData["abi"]; error?: unknown; status: "success" | "error"; }> = {};
+ const map: Record<string, { chainId: string; address: string; data?: AbiData["abi"]; error?: unknown; status: "success" | "error"; }> = {};
  for (const item of queryResult.data) {
-   map[item.address] = item;
+   map[`${item.chainId}:${item.address.toLowerCase()}`] = item;
  }

- const abis: Record<string, AbiData> = {};
+ const abis: Record<string, AbiData> = {};
  ...
-   abis[item.address] = {
+   abis[`${item.chainId}:${item.address.toLowerCase()}`] = {
      abi: abi,
      fetchedAt: new Date().toISOString(),
      status: "success",
      ...(type === "event" ? { events: items } : { functions: items }),
    };

Follow-up: If downstream callers expect address-only keys, we can expose both maps or return tuples { key, value }.

Also applies to: 95-121


48-74: Stabilize the queryKey against ordering/whitespace changes

addresses string and chainIds order can produce cache misses. Use pairs (already deduped) and a normalized key.

- queryKey: ["abis", chainIds, addresses, type],
+ queryKey: [
+   "abis",
+   pairs.map((p) => `${p.chainId}:${p.address.toLowerCase()}`),
+   type,
+ ],
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx (4)

281-296: Gate smart account address query until chain is ready

If the adapter hasn’t produced a chain yet (initial render or slow chain data), the query may error unnecessarily. Enable only when chain exists.

- const smartAccountAddressQuery = useQuery({
+ const smartAccountAddressQuery = useQuery({
    queryFn: async () => {
      const smartAccountAddress = await predictSmartAccountAddress({
        adminAddress: wallet.address,
-       chain: chain,
+       chain: chain,
        client: client,
        factoryAddress: DEFAULT_ACCOUNT_FACTORY_V0_7,
      });
      return smartAccountAddress;
    },
-   enabled: showSmartAccount,
+   enabled: showSmartAccount && !!chain,
    queryKey: ["smart-account-address", wallet.address, chainId],
  });

459-464: Handle undefined chain gracefully in balance cell

On first render, the adapter can return undefined. Ensure UI doesn’t flash “N/A” due to a transient undefined chain by treating it as loading.

- const balance = useWalletBalance({
+ const balance = useWalletBalance({
    address: props.address,
-   chain: chain,
+   chain: chain,
    client: props.client,
  });
+ if (!chain) return <Skeleton className="h-5 w-16" />;

Note: The hook still runs; this only improves the rendered state.


57-75: Expose className on the root per dashboard guidelines

Components under apps/dashboard should accept a className and apply it on the root element.

 export function ServerWalletsTableUI({
   wallets,
   project,
   teamSlug,
   managementAccessToken,
   totalRecords,
   currentPage,
   totalPages,
   client,
+  className,
 }: {
   wallets: Wallet[];
   project: Project;
   teamSlug: string;
   managementAccessToken: string | undefined;
   totalRecords: number;
   currentPage: number;
   totalPages: number;
   client: ThirdwebClient;
+  className?: string;
 }) {
@@
-  return (
-    <div>
+  return (
+    <div className={cn(className)}>

Also applies to: 80-82


214-243: Optional: Prefer NavLink for internal navigation

The dashboard guidelines recommend NavLink for active-state handling. Consider swapping for pagination and the “Send test transaction” link in a follow-up.

Also applies to: 246-259, 413-421

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • 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 2f6f3a0 and 0ba43d8.

📒 Files selected for processing (2)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx (4 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useAbiProcessing.ts (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/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useAbiProcessing.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.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)/webhooks/hooks/useAbiProcessing.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.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)/webhooks/hooks/useAbiProcessing.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.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)/webhooks/hooks/useAbiProcessing.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.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)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
🧠 Learnings (6)
📚 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)/webhooks/hooks/useAbiProcessing.ts
  • 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)/webhooks/hooks/useAbiProcessing.ts
📚 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)/webhooks/hooks/useAbiProcessing.ts
  • 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: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} : Wrap client-side data fetching calls in React Query (`tanstack/react-query`)

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useAbiProcessing.ts
📚 Learning: 2025-05-27T19:54:55.885Z
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The `fetchDashboardContractMetadata` function from "3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useAbiProcessing.ts
📚 Learning: 2025-07-07T21:21:47.488Z
Learnt from: saminacodes
PR: thirdweb-dev/js#7543
File: apps/portal/src/app/pay/page.mdx:4-4
Timestamp: 2025-07-07T21:21:47.488Z
Learning: In the thirdweb-dev/js repository, lucide-react icons must be imported with the "Icon" suffix (e.g., ExternalLinkIcon, RocketIcon) as required by the new linting rule, contrary to the typical lucide-react convention of importing without the suffix.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx
🧬 Code graph analysis (2)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useAbiProcessing.ts (1)
apps/dashboard/src/@/hooks/chains/v5-adapter.ts (1)
  • useGetV5DashboardChain (30-39)
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/@/hooks/chains/v5-adapter.ts (1)
  • useV5DashboardChain (14-28)
⏰ 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: Unit Tests
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/hooks/useAbiProcessing.ts (2)

7-7: Good move: switch to v5 dashboard chain adapter

This aligns ABI resolution with custom-chain support across the app.


32-32: Initialize adapter once per render for stable chain resolution

Instantiating getChain via the adapter hook here is correct and keeps the query fn clean.

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

51-51: Right direction: v5 chain adapter for custom-chain compatibility

Using useV5DashboardChain is the correct fix to make balances work on custom chains.

@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 9, 2025

Merge activity

<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on refactoring the code to utilize a new hook, `useGetV5DashboardChain`, which replaces the previous `defineChain` function in multiple files. This change enhances the code's readability and maintainability by standardizing the method of retrieving chain information.

### Detailed summary
- Replaced `defineChain` with `useGetV5DashboardChain` in `useAbiProcessing.ts`.
- Updated the `chain` variable initialization in `ServerWalletTableRow` to use `useV5DashboardChain`.
- Modified the `chain` parameter in `WalletBalanceCell` to utilize `useV5DashboardChain` instead of `defineChain`.

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

<!-- end pr-codex -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Refactor**
  * Unified chain handling across wallet tables and webhook ABI processing using a new dashboard adapter, improving consistency and reliability.
  * Streamlined balance and smart account address resolution to reduce redundant computations and potential mismatches.
  * Internal imports and hooks updated without changing public interfaces or user workflows.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@vercel vercel bot temporarily deployed to Preview – nebula September 9, 2025 19:13 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground September 9, 2025 19:13 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 September 9, 2025 19:13 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui September 9, 2025 19:13 Inactive
@graphite-app graphite-app bot merged commit 85d6074 into main Sep 9, 2025
24 checks passed
@graphite-app graphite-app bot deleted the bld-277 branch September 9, 2025 19:22
@vercel vercel bot temporarily deployed to Production – docs-v2 September 9, 2025 19:23 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground September 9, 2025 19:23 Inactive
@vercel vercel bot temporarily deployed to Production – nebula September 9, 2025 19:23 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui September 9, 2025 19:23 Inactive
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants