Skip to content

Conversation

@joaquim-verges
Copy link
Member

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


PR-Codex overview

This PR focuses on improving the transaction list in the connect modal and fixing query caching for block explorers in raw chains.

Detailed summary

  • Added decode option to getPastTransactions query.
  • Fixed transaction status logic in getPastTransactions.
  • Updated TransactionButton to display transaction name if available.
  • Refactored chain query hooks to streamline query options and remove stale time.
  • Added contract_address and detailed descriptions for NFTs in tests.

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

Summary by CodeRabbit

  • New Features

    • Transaction history now shows human‑readable action names when available by exposing decoded transaction info.
  • Bug Fixes

    • Corrected success/failed status display for past transactions.
    • Fixed block explorer details loading for custom/raw chains, improving link accuracy.
  • Improvements

    • More consistent chain metadata and query handling for more reliable chain-related views and performance.
  • Chores

    • Added a patch changeset entry documenting these updates.

@changeset-bot
Copy link

changeset-bot bot commented Oct 15, 2025

🦋 Changeset detected

Latest commit: b955cf2

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

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

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link

vercel bot commented Oct 15, 2025

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

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Oct 15, 2025 0:07am
nebula Ready Ready Preview Comment Oct 15, 2025 0:07am
thirdweb_playground Ready Ready Preview Comment Oct 15, 2025 0:07am
thirdweb-www Error Error Oct 15, 2025 0:07am
wallet-ui Ready Ready Preview Comment Oct 15, 2025 0:07am

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Oct 15, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

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

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

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

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

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

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 15, 2025

Walkthrough

Refactors chain-related React queries to use a shared getQueryOptions; refines explorers derivation; updates transaction store to request and expose decoded transaction data and fixes status mapping; updates wallet transaction history UI to prefer decoded names; adds a changeset entry.

Changes

Cohort / File(s) Summary of changes
Release metadata
.changeset/eight-zoos-invent.md
Adds a patch changeset noting a transaction list improvement in the connect modal and a fix for query cache of block explorers for raw chains.
Chain query hooks refactor
packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts
Centralizes query options via getQueryOptions(chain) (enabled, queryKey, staleTime). Replaces per-hook explicit queryKey/staleTime/enabled flags, adjusts queryFn return types, adds toChain transformation cache, and updates explorers fallback to prefer chain.blockExplorers over transformed data.
Transaction store decoding and status mapping
packages/thirdweb/src/transaction/transaction-store.ts
Adds optional decoded field to StoredTransaction, requests past transactions with decode: true, propagates tx.decoded into stored results, and inverts receipt status mapping to tx.status === 0 ? "failed" : "success".
Connect modal transaction list UI
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
Removes ChainName usage; reads local decoded from props.tx.decoded; displays decoded.name as primary title when present (fallback "Transaction Sent"); secondary line shows shortened receipt.to or shortened transactionHash.
Tests — ERC721 snapshots
packages/thirdweb/src/extensions/erc721/read/getNFTs.test.ts
Adds contract_address field with value 0x8a90cab2b38dba80c64b7734e58ee1db38b8992e into multiple inline snapshots' metadata expectations.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as WalletTransactionHistory (UI)
  participant Store as transaction-store
  participant RPC as RPC/Indexer
  participant Hooks as useChainQuery

  User->>UI: Open Connect modal (Transactions)
  UI->>Store: getPastTransactions({ decode: true })
  Store->>RPC: Fetch past transactions (include decode)
  RPC-->>Store: Transactions (status, decoded, receipt)
  Store-->>UI: StoredTransaction[] (decoded?, receipt.status)
  UI->>UI: title = decoded.name || "Transaction Sent"
  UI->>UI: subtext = shorten(receipt.to || tx.hash)

  Note over Hooks,Store: useChainQuery hooks now use getQueryOptions(chain)\nfor enabled/queryKey/staleTime and prefer chain.blockExplorers
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description retains the template comments and provides a PR-Codex overview but omits the required filled sections such as the formatted title field, reviewer notes, and testing instructions specified in the repository’s description template. Please replace the template comments with the actual PR title in the required format, add a “Notes for the reviewer” section with any important context, and include a “How to test” section detailing unit tests or steps to verify the changes.
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.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title “[SDK] Fix query cache for block explorers for raw chains” concisely and specifically highlights a core change by identifying the SDK area and the fix applied to query caching for block explorers on raw chains, aligning with the repository’s title format and clearly reflecting a significant aspect of the PR.
✨ 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 Fix_query_cache_for_block_explorers_for_raw_chains

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

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

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.54 KB (+0.06% 🔺) 1.3 s (+0.06% 🔺) 149 ms (+176.85% 🔺) 1.5 s
thirdweb (cjs) 365.68 KB (-0.1% 🔽) 7.4 s (-0.1% 🔽) 583 ms (+17.83% 🔺) 7.9 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 79 ms (+3024.02% 🔺) 194 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 67 ms (+4860.7% 🔺) 77 ms
thirdweb/react (minimal + tree-shaking) 19.13 KB (0%) 383 ms (0%) 68 ms (+2450.63% 🔺) 451 ms

@joaquim-verges joaquim-verges force-pushed the Fix_query_cache_for_block_explorers_for_raw_chains branch from b6d685f to 01c79b7 Compare October 15, 2025 09:38
@joaquim-verges joaquim-verges changed the title Fix query cache for block explorers for raw chains [SDK] Fix query cache for block explorers for raw chains Oct 15, 2025
@joaquim-verges joaquim-verges marked this pull request as ready for review October 15, 2025 09:38
@joaquim-verges joaquim-verges requested review from a team as code owners October 15, 2025 09:38
@joaquim-verges joaquim-verges force-pushed the Fix_query_cache_for_block_explorers_for_raw_chains branch from 01c79b7 to 019d74c Compare October 15, 2025 09:39
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

🧹 Nitpick comments (2)
packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts (1)

120-120: Simplify redundant conditional logic.

The condition chain?.blockExplorers && chain?.blockExplorers?.length > 0 is redundant since chain?.blockExplorers already checks for existence, and an empty array would be falsy in boolean context only if explicitly checking length.

Consider this more concise alternative:

-    explorers: chain?.blockExplorers && chain?.blockExplorers?.length > 0 ? chain?.blockExplorers : toChain?.blockExplorers ?? [],
+    explorers: chain?.blockExplorers?.length ? chain.blockExplorers : toChain?.blockExplorers ?? [],
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx (1)

143-143: Use optional chaining for more idiomatic TypeScript.

The decoded data extraction and conditional rendering work correctly, but optional chaining would be more concise and idiomatic.

Apply this diff:

   const receipt = props.tx.receipt ?? fetchedReceipt;
   const decoded = props.tx.decoded;
+
+  // ... in the JSX
-              {decoded ? decoded.name : `Transaction Sent`}
+              {decoded?.name ?? "Transaction Sent"}

Also applies to: 184-184

📜 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 47354d5 and 019d74c.

📒 Files selected for processing (4)
  • .changeset/eight-zoos-invent.md (1 hunks)
  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts (5 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx (3 hunks)
  • packages/thirdweb/src/transaction/transaction-store.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

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

Files:

  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts
  • packages/thirdweb/src/transaction/transaction-store.ts
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts
  • packages/thirdweb/src/transaction/transaction-store.ts
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts
  • packages/thirdweb/src/transaction/transaction-store.ts
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • .changeset/eight-zoos-invent.md
🧬 Code graph analysis (2)
packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts (1)
packages/thirdweb/src/chains/utils.ts (1)
  • convertApiChainToChain (350-367)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx (2)
packages/thirdweb/src/react/web/ui/components/text.tsx (1)
  • Text (18-34)
packages/thirdweb/src/exports/utils.ts (1)
  • shortenHex (150-150)
🔇 Additional comments (5)
packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts (2)

24-25: Consistent query options pattern applied correctly.

The spread of getQueryOptions(chain) followed by the enabled override creates a consistent caching strategy across all chain metadata hooks. The pattern correctly maintains the conditional fetch logic (e.g., isEnabled = !!chain && !chain.name) while centralizing the query key and stale time configuration.

Also applies to: 46-47, 72-73, 92-93, 114-115


118-118: Critical: Fix syntax error.

Missing space between ? and function name will cause a compilation error.

Apply this diff:

-  const toChain = chainQuery.data ?convertApiChainToChain(chainQuery.data) : undefined;
+  const toChain = chainQuery.data ? convertApiChainToChain(chainQuery.data) : undefined;

Likely an incorrect or invalid review comment.

packages/thirdweb/src/transaction/transaction-store.ts (2)

14-20: Well-structured decoded transaction field.

The optional decoded field with name, signature, and inputs provides essential information for displaying meaningful transaction details in the UI.


91-91: Transaction decoding and status mapping improvements.

The changes correctly enable transaction decoding and normalize the receipt status to a clear binary state:

  • decode: true flag ensures transaction data includes decoded information
  • Status mapping (tx.status === 0 ? "failed" : "success") correctly reflects Ethereum receipt status semantics
  • The decoded field is properly propagated to the returned StoredTransaction

Also applies to: 101-101, 105-105

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx (1)

199-201: Improved transaction detail display.

Replacing the chain name with the recipient address or transaction hash provides more actionable information for users to identify their transactions. The use of shortenHex maintains readability within the limited UI space.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx (1)

184-201: Handle missing decoded name gracefully.

tx.decoded can exist without a name, which would render undefined in the UI. Fall back to "Transaction Sent" when decoded?.name is empty.

-            <Text color="primaryText" size="sm">
-              {decoded ? decoded.name : `Transaction Sent`}
-            </Text>
+            <Text color="primaryText" size="sm">
+              {decoded?.name ?? "Transaction Sent"}
+            </Text>
📜 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 47354d5 and 019d74c.

📒 Files selected for processing (4)
  • .changeset/eight-zoos-invent.md (1 hunks)
  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts (5 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx (3 hunks)
  • packages/thirdweb/src/transaction/transaction-store.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • .changeset/eight-zoos-invent.md
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

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

Files:

  • packages/thirdweb/src/transaction/transaction-store.ts
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • packages/thirdweb/src/transaction/transaction-store.ts
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/thirdweb/src/transaction/transaction-store.ts
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts
🧬 Code graph analysis (3)
packages/thirdweb/src/transaction/transaction-store.ts (1)
packages/thirdweb/src/exports/thirdweb.ts (1)
  • Hex (230-230)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx (2)
packages/thirdweb/src/react/web/ui/components/text.tsx (1)
  • Text (18-34)
packages/thirdweb/src/exports/utils.ts (1)
  • shortenHex (150-150)
packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts (1)
packages/thirdweb/src/chains/utils.ts (1)
  • convertApiChainToChain (350-367)
🪛 LanguageTool
.changeset/eight-zoos-invent.md

[grammar] ~5-~5: There might be a mistake here.
Context: ...": patch --- Improve Transactions list in connect modal Fix query cache for block...

(QB_NEW_EN)

⏰ 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: E2E Tests (pnpm, esbuild)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript)

Comment on lines +101 to 106
status: tx.status === 0 ? "failed" : "success",
to: tx.to_address,
},
transactionHash: tx.hash as Hex,
decoded: tx.decoded,
}));
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 | 🔴 Critical

Fix transaction status regression.

tx.status === 0 ? "failed" : "success" marks failures as success whenever the API returns "0" (string) or leaves the field undefined for pending receipts. Normalize the value before comparing.

-    receipt: {
-      status: tx.status === 0 ? "failed" : "success",
+    receipt: {
+      status:
+        (typeof tx.status === "string" ? Number(tx.status) : tx.status) === 1
+          ? "success"
+          : "failed",
📝 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
status: tx.status === 0 ? "failed" : "success",
to: tx.to_address,
},
transactionHash: tx.hash as Hex,
decoded: tx.decoded,
}));
receipt: {
status:
(typeof tx.status === "string" ? Number(tx.status) : tx.status) === 1
? "success"
: "failed",
to: tx.to_address,
},
transactionHash: tx.hash as Hex,
decoded: tx.decoded,
}));
🤖 Prompt for AI Agents
In packages/thirdweb/src/transaction/transaction-store.ts around lines 101 to
106, the status mapping uses strict numeric comparison (tx.status === 0) which
fails when the API returns string "0" or undefined; normalize tx.status to a
number first (e.g., const s = Number(tx.status)) and then set status to "failed"
if s === 0, "success" if s === 1, and "pending" (or an appropriate default) if s
is NaN/undefined so pending receipts aren't marked as success.

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

🧹 Nitpick comments (1)
.changeset/eight-zoos-invent.md (1)

5-6: Consider formatting as a bulleted list for clarity.

The changeset describes two distinct improvements. Formatting them as a bulleted list would improve readability.

Apply this diff to format as a list:

 ---
 
-Improve Transactions list in connect modal
-Fix query cache for block explorers for raw chains
+- Improve Transactions list in connect modal
+- Fix query cache for block explorers for raw chains
📜 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 019d74c and f7bc9fa.

📒 Files selected for processing (4)
  • .changeset/eight-zoos-invent.md (1 hunks)
  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts (5 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx (3 hunks)
  • packages/thirdweb/src/transaction/transaction-store.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/thirdweb/src/transaction/transaction-store.ts
  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

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

Files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • .changeset/eight-zoos-invent.md
🧬 Code graph analysis (1)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx (2)
packages/thirdweb/src/react/web/ui/components/text.tsx (1)
  • Text (18-34)
packages/thirdweb/src/exports/utils.ts (1)
  • shortenHex (150-150)
🪛 LanguageTool
.changeset/eight-zoos-invent.md

[grammar] ~5-~5: There might be a mistake here.
Context: ...": patch --- Improve Transactions list in connect modal Fix query cache for block...

(QB_NEW_EN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Unit Tests
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx (3)

143-143: LGTM!

The decoded variable extraction is straightforward and type-safe.


184-184: LGTM!

The conditional rendering correctly prioritizes the decoded transaction name with an appropriate fallback.


199-203: LGTM!

The fallback logic correctly displays the recipient address when available, or the transaction hash otherwise, with appropriate shortening for UI display.

@joaquim-verges joaquim-verges force-pushed the Fix_query_cache_for_block_explorers_for_raw_chains branch from f7bc9fa to b955cf2 Compare October 15, 2025 11:48
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 (1)
packages/thirdweb/src/transaction/transaction-store.ts (1)

101-101: Status mapping regression flagged in previous review.

A past review identified that this status comparison (tx.status === 0 ? "failed" : "success") fails when tx.status is a string "0", string "1", or undefined. The comparison should normalize tx.status to a number first before comparing.

For reference, the suggested fix from the previous review:

-    receipt: {
-      status: tx.status === 0 ? "failed" : "success",
+    receipt: {
+      status:
+        (typeof tx.status === "string" ? Number(tx.status) : tx.status) === 1
+          ? "success"
+          : "failed",
🧹 Nitpick comments (1)
.changeset/eight-zoos-invent.md (1)

5-6: Consider adding article for clarity (optional).

The static analysis tool suggests that "Improve Transactions list in connect modal" might read more naturally as "Improve the transactions list in connect modal" or "Improve transaction list in connect modal" (singular).

📜 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 f7bc9fa and b955cf2.

📒 Files selected for processing (5)
  • .changeset/eight-zoos-invent.md (1 hunks)
  • packages/thirdweb/src/extensions/erc721/read/getNFTs.test.ts (5 hunks)
  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts (5 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx (3 hunks)
  • packages/thirdweb/src/transaction/transaction-store.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
  • packages/thirdweb/src/react/core/hooks/others/useChainQuery.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

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

Files:

  • packages/thirdweb/src/transaction/transaction-store.ts
  • packages/thirdweb/src/extensions/erc721/read/getNFTs.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • packages/thirdweb/src/transaction/transaction-store.ts
  • packages/thirdweb/src/extensions/erc721/read/getNFTs.test.ts
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/thirdweb/src/transaction/transaction-store.ts
  • packages/thirdweb/src/extensions/erc721/read/getNFTs.test.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.test.{ts,tsx}: Place tests alongside code: foo.tsfoo.test.ts
Use real function invocations with stub data in tests; avoid brittle mocks
Use Mock Service Worker (MSW) for fetch/HTTP call interception in tests
Keep tests deterministic and side-effect free
Use FORKED_ETHEREUM_CHAIN for mainnet interactions and ANVIL_CHAIN for isolated tests

**/*.test.{ts,tsx}: Co‑locate tests as foo.test.ts(x) next to the implementation
Use real function invocations with stub data; avoid brittle mocks
Use MSW to intercept HTTP calls for network interactions; mock only hard‑to‑reproduce scenarios
Keep tests deterministic and side‑effect free; use Vitest

Files:

  • packages/thirdweb/src/extensions/erc721/read/getNFTs.test.ts
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • .changeset/eight-zoos-invent.md
🪛 LanguageTool
.changeset/eight-zoos-invent.md

[grammar] ~5-~5: There might be a mistake here.
Context: ...": patch --- Improve Transactions list in connect modal Fix query cache for block...

(QB_NEW_EN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Size
  • GitHub Check: Lint Packages
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
packages/thirdweb/src/extensions/erc721/read/getNFTs.test.ts (1)

44-44: LGTM! Snapshot updates reflect indexer API enrichment.

The contract_address field has been consistently added to all NFT metadata snapshots when using the indexer. The value matches the contract's token address, indicating that the indexer now enriches metadata with this information. Note that the RPC-based test (lines 220-407) does not include this field, confirming it's an indexer-specific enhancement.

Also applies to: 82-82, 120-120, 158-158, 196-196

packages/thirdweb/src/transaction/transaction-store.ts (2)

14-20: LGTM! Well-structured decoded transaction metadata type.

The optional decoded field properly captures transaction decoding information with appropriate typing for name, signature, and inputs.


91-91: LGTM! Decoding support correctly wired.

The decode: true option and subsequent decoded: tx.decoded assignment properly enable and expose decoded transaction data.

Also applies to: 105-105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants