-
Notifications
You must be signed in to change notification settings - Fork 619
[SDK] Fix query cache for block explorers for raw chains #8257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDK] Fix query cache for block explorers for raw chains #8257
Conversation
🦋 Changeset detectedLatest commit: b955cf2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
WalkthroughRefactors 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
size-limit report 📦
|
b6d685f to
01c79b7
Compare
01c79b7 to
019d74c
Compare
There was a problem hiding this 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 > 0is redundant sincechain?.blockExplorersalready 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.
📒 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@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless 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@/typeswhere applicable
Prefertypealiases overinterfaceexcept for nominal shapes
Avoidanyandunknownunless 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.tspackages/thirdweb/src/transaction/transaction-store.tspackages/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.tspackages/thirdweb/src/transaction/transaction-store.tspackages/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@exampleand 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.tspackages/thirdweb/src/transaction/transaction-store.tspackages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx
.changeset/*.md
📄 CodeRabbit inference engine (AGENTS.md)
.changeset/*.md: Each change inpackages/*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 theenabledoverride 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
decodedfield withname,signature, andinputsprovides 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: trueflag 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
shortenHexmaintains readability within the limited UI space.
There was a problem hiding this 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.decodedcan exist without aname, which would renderundefinedin the UI. Fall back to"Transaction Sent"whendecoded?.nameis 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.
📒 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 inpackages/*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@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless 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@/typeswhere applicable
Prefertypealiases overinterfaceexcept for nominal shapes
Avoidanyandunknownunless 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.tspackages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsxpackages/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.tspackages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsxpackages/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@exampleand 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.tspackages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsxpackages/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)
| status: tx.status === 0 ? "failed" : "success", | ||
| to: tx.to_address, | ||
| }, | ||
| transactionHash: tx.hash as Hex, | ||
| decoded: tx.decoded, | ||
| })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
019d74c to
f7bc9fa
Compare
There was a problem hiding this 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.
📒 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@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless 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@/typeswhere applicable
Prefertypealiases overinterfaceexcept for nominal shapes
Avoidanyandunknownunless 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@exampleand 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 inpackages/*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.
f7bc9fa to
b955cf2
Compare
There was a problem hiding this 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 whentx.statusis a string"0", string"1", orundefined. The comparison should normalizetx.statusto 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.
📒 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@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless 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@/typeswhere applicable
Prefertypealiases overinterfaceexcept for nominal shapes
Avoidanyandunknownunless 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.tspackages/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.tspackages/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@exampleand 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.tspackages/thirdweb/src/extensions/erc721/read/getNFTs.test.ts
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.test.{ts,tsx}: Place tests alongside code:foo.ts↔foo.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
UseFORKED_ETHEREUM_CHAINfor mainnet interactions andANVIL_CHAINfor isolated tests
**/*.test.{ts,tsx}: Co‑locate tests asfoo.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 inpackages/*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_addressfield 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
decodedfield properly captures transaction decoding information with appropriate typing for name, signature, and inputs.
91-91: LGTM! Decoding support correctly wired.The
decode: trueoption and subsequentdecoded: tx.decodedassignment properly enable and expose decoded transaction data.Also applies to: 105-105

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
decodeoption togetPastTransactionsquery.getPastTransactions.TransactionButtonto display transaction name if available.contract_addressand detailed descriptions for NFTs in tests.Summary by CodeRabbit
New Features
Bug Fixes
Improvements
Chores