-
Notifications
You must be signed in to change notification settings - Fork 563
Update insight, add contract filtering #7710
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: cbb4f04 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 |
WalkthroughThis update introduces contract and token filtering capabilities to the Insight module's NFT and token retrieval functions, allowing queries to be restricted by contract or token address. Several configuration files are updated for linting and formatting, and a new webhook filter validation endpoint is added to the generated client SDK. Numerous files are reformatted for consistent indentation and style. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ThirdwebModule
participant InsightAPI
User->>ThirdwebModule: getOwnedNFTs({ ownerAddress, contractAddress? })
ThirdwebModule->>InsightAPI: GET /nfts?owner_address[]&contract_address[] (if provided)
InsightAPI-->>ThirdwebModule: Filtered NFT list
ThirdwebModule-->>User: Owned NFTs (filtered by contract if specified)
User->>ThirdwebModule: getOwnedTokens({ ownerAddress, tokenAddress? })
ThirdwebModule->>InsightAPI: GET /tokens?owner_address[]&token_address[] (if provided)
InsightAPI-->>ThirdwebModule: Filtered token list
ThirdwebModule-->>User: Owned tokens (filtered by token address if specified)
sequenceDiagram
participant Client
participant SDK
participant InsightAPI
Client->>SDK: postServiceWebhooksFiltersValidate(options)
SDK->>InsightAPI: POST /service/webhooks/filters/validate (with filter data)
InsightAPI-->>SDK: Validation result
SDK-->>Client: Validation response
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (21)
✅ Files skipped from review due to trivial changes (7)
🚧 Files skipped from review as they are similar to previous changes (14)
⏰ 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). (9)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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. |
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: 2
🧹 Nitpick comments (6)
.changeset/cyan-facts-smell.md (1)
1-5
: Expand the changeset summary for clarity“Update to latest API” doesn’t surface the two user-visible improvements (contract & token filtering). Readers of the changelog will miss the breaking/behavioural change unless they open the PR. Please add a short sentence describing the new filters (and whether the change is additive or breaking).
packages/insight/src/client/client/index.ts (1)
11-20
: Consider re-export granularityRe-exporting every type from
./types.js
inflates the public surface and hampers tree-shaking in consumers. If practicable, export a single “client” namespace or the minimal subset actually intended to be public.packages/insight/src/client/core/bodySerializer.ts (2)
38-56
: Duplicate array-handling logic – extract helper
formDataBodySerializer
andurlSearchParamsBodySerializer
repeat the same
array/null checks. A tiny helper removes duplication and future divergence
risk.+const iterateEntries = ( + body: Record<string, unknown> | Array<Record<string, unknown>>, + fn: (key: string, value: unknown) => void, +) => { + Object.entries(body).forEach(([key, value]) => { + if (value === undefined || value === null) return; + Array.isArray(value) ? value.forEach((v) => fn(key, v)) : fn(key, value); + }); +}; ... - Object.entries(body).forEach(([key, value]) => { ... }); + iterateEntries(body, (k, v) => serializeFormDataPair(data, k, v));Same for
urlSearchParamsBodySerializer
.
59-63
: BigInt serialisation is good – consider dates tooNice touch converting
bigint
to string. Dates still serialise to ISO but
developers often prefer epoch or RFC-3339; consider exposing a hook or option
for custom transforms.packages/thirdweb/src/extensions/erc1155/read/getOwnedNFTs.ts (1)
59-59
: Update or remove the outdated TODO comment.The TODO comment states "add support for contract address filters" but this feature is actually being implemented in this PR with the addition of the
contractAddress
parameter on line 65.- // TODO (insight): add support for contract address filters
packages/thirdweb/src/extensions/erc721/read/getOwnedNFTs.ts (1)
75-75
: Update or remove the outdated TODO comment.The TODO comment indicates that contract address filtering support needs to be added, but this feature is being implemented in this PR with the
contractAddress
parameter on line 81.- // TODO (insight): add support for contract address filters
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (21)
.changeset/cyan-facts-smell.md
(1 hunks).changeset/tidy-dogs-try.md
(1 hunks)packages/insight/biome.json
(1 hunks)packages/insight/openapi-ts.config.ts
(1 hunks)packages/insight/package.json
(1 hunks)packages/insight/src/client/client.gen.ts
(2 hunks)packages/insight/src/client/client/client.ts
(1 hunks)packages/insight/src/client/client/index.ts
(1 hunks)packages/insight/src/client/client/types.ts
(2 hunks)packages/insight/src/client/client/utils.ts
(2 hunks)packages/insight/src/client/core/auth.ts
(1 hunks)packages/insight/src/client/core/bodySerializer.ts
(1 hunks)packages/insight/src/client/core/params.ts
(1 hunks)packages/insight/src/client/core/pathSerializer.ts
(2 hunks)packages/insight/src/client/core/types.ts
(1 hunks)packages/insight/src/client/sdk.gen.ts
(4 hunks)packages/insight/src/configure.ts
(1 hunks)packages/thirdweb/src/extensions/erc1155/read/getOwnedNFTs.ts
(1 hunks)packages/thirdweb/src/extensions/erc721/read/getOwnedNFTs.ts
(1 hunks)packages/thirdweb/src/insight/get-nfts.ts
(2 hunks)packages/thirdweb/src/insight/get-tokens.ts
(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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 localtypes.ts
barrels
Prefer type aliases over interface except for nominal shapes
Avoidany
andunknown
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
Files:
packages/insight/src/client/client/index.ts
packages/insight/src/client/core/pathSerializer.ts
packages/insight/src/client/client/client.ts
packages/insight/src/client/core/auth.ts
packages/insight/src/client/core/types.ts
packages/thirdweb/src/extensions/erc1155/read/getOwnedNFTs.ts
packages/insight/openapi-ts.config.ts
packages/insight/src/client/client/utils.ts
packages/insight/src/client/core/bodySerializer.ts
packages/insight/src/client/client.gen.ts
packages/insight/src/client/core/params.ts
packages/insight/src/configure.ts
packages/insight/src/client/client/types.ts
packages/thirdweb/src/extensions/erc721/read/getOwnedNFTs.ts
packages/insight/src/client/sdk.gen.ts
packages/thirdweb/src/insight/get-nfts.ts
packages/thirdweb/src/insight/get-tokens.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/insight/src/client/client/index.ts
packages/insight/src/client/core/pathSerializer.ts
packages/insight/src/client/client/client.ts
packages/insight/src/client/core/auth.ts
packages/insight/src/client/core/types.ts
packages/thirdweb/src/extensions/erc1155/read/getOwnedNFTs.ts
packages/insight/openapi-ts.config.ts
packages/insight/src/client/client/utils.ts
packages/insight/src/client/core/bodySerializer.ts
packages/insight/src/client/client.gen.ts
packages/insight/src/client/core/params.ts
packages/insight/src/configure.ts
packages/insight/src/client/client/types.ts
packages/thirdweb/src/extensions/erc721/read/getOwnedNFTs.ts
packages/insight/src/client/sdk.gen.ts
packages/thirdweb/src/insight/get-nfts.ts
packages/thirdweb/src/insight/get-tokens.ts
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
.changeset/cyan-facts-smell.md (1)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
packages/insight/src/client/client/index.ts (13)
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/**/*.{ts,tsx} : Export default async functions without 'use client';
– they run on the Node edge.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Prefix files with import "server-only";
so they never end up in the client bundle.
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} : Client Components (browser): Begin files with 'use client';
Learnt from: jnsdls
PR: #7363
File: apps/dashboard/src/app/(app)/layout.tsx:63-74
Timestamp: 2025-06-18T02:01:06.006Z
Learning: In Next.js applications, instrumentation files (instrumentation.ts or instrumentation-client.ts) placed in the src/ directory are automatically handled by the framework and included in the client/server bundles without requiring manual imports. The framework injects these files as part of the build process.
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/**/components/*.client.tsx : Client components must start with 'use client';
before imports.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Server Components (Node edge): Start files with import "server-only";
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Limit each file to one stateless, single-responsibility function for clarity
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/exports/react.native.ts : React Native specific exports are in src/exports/react.native.ts
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/exports/** : Export everything via exports/
directory, grouped by feature in the SDK public API
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Write idiomatic TypeScript with explicit function declarations and return types
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Re-use shared types from @/types
or local types.ts
barrels
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Co-locate data helpers under @/api/**
and mark them with "server-only".
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/**/*.{ts,tsx} : Client-side only: never import posthog-js
in server components.
.changeset/tidy-dogs-try.md (2)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:82-90
Timestamp: 2025-06-13T13:03:41.732Z
Learning: The thirdweb contract
object is serializable and can safely be used in contexts (e.g., React-Query keys) that require serializable values.
packages/insight/src/client/core/pathSerializer.ts (2)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Prefix files with import "server-only";
so they never end up in the client bundle.
packages/insight/src/client/client/client.ts (11)
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/**/components/*.client.tsx : Client components must start with 'use client';
before imports.
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/**/*.{ts,tsx} : Export default async functions without 'use client';
– they run on the Node edge.
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} : Client Components (browser): Begin files with 'use client';
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Prefix files with import "server-only";
so they never end up in the client bundle.
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).
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 : Keep queryKey
stable and descriptive for cache hits.
Learnt from: jnsdls
PR: #7363
File: apps/dashboard/src/app/(app)/layout.tsx:63-74
Timestamp: 2025-06-18T02:01:06.006Z
Learning: In Next.js applications, instrumentation files (instrumentation.ts or instrumentation-client.ts) placed in the src/ directory are automatically handled by the framework and included in the client/server bundles without requiring manual imports. The framework injects these files as part of the build process.
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 : Create light wrappers (e.g. fetchJson
) that automatically attach the JWT from cookies/session when calling internal API routes.
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 : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
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.
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.
packages/insight/src/client/core/auth.ts (8)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Always call getAuthToken()
to get the JWT from cookies.
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/**/*.{ts,tsx} : Reading cookies/headers with next/headers
(getAuthToken()
, cookies()
).
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} : Always call getAuthToken()
to retrieve JWT from cookies on server side
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Pass the token in the Authorization: Bearer
header – never embed it in the URL.
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} : Use Authorization: Bearer
header – never embed tokens in URLs
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 : Create light wrappers (e.g. fetchJson
) that automatically attach the JWT from cookies/session when calling internal API routes.
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} : Keep tokens secret via internal API routes or server actions
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 : Prefer API routes or server actions to keep tokens secret; the browser only sees relative paths.
packages/insight/src/client/core/types.ts (14)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Write idiomatic TypeScript with explicit function declarations and return types
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Prefix files with import "server-only";
so they never end up in the client bundle.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Comment only ambiguous logic; avoid restating TypeScript in prose
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/**/*.{ts,tsx} : Export default async functions without 'use client';
– they run on the Node edge.
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} : Client Components (browser): Begin files with 'use client';
Learnt from: jnsdls
PR: #7363
File: apps/dashboard/src/app/(app)/layout.tsx:63-74
Timestamp: 2025-06-18T02:01:06.006Z
Learning: In Next.js applications, instrumentation files (instrumentation.ts or instrumentation-client.ts) placed in the src/ directory are automatically handled by the framework and included in the client/server bundles without requiring manual imports. The framework injects these files as part of the build process.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Prefer type aliases over interface except for nominal shapes
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Re-use shared types from @/types
or local types.ts
barrels
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Co-locate data helpers under @/api/**
and mark them with "server-only".
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Avoid any
and unknown
unless unavoidable; narrow generics when possible
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 : Create light wrappers (e.g. fetchJson
) that automatically attach the JWT from cookies/session when calling internal API routes.
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.
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 : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
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/**/*.{ts,tsx} : Reading cookies/headers with next/headers
(getAuthToken()
, cookies()
).
packages/thirdweb/src/extensions/erc1155/read/getOwnedNFTs.ts (1)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Auto-generated contracts from ABI definitions in extensions
packages/insight/openapi-ts.config.ts (10)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Prefix files with import "server-only";
so they never end up in the client bundle.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Co-locate data helpers under @/api/**
and mark them with "server-only".
Learnt from: jnsdls
PR: #7363
File: apps/dashboard/src/app/(app)/layout.tsx:63-74
Timestamp: 2025-06-18T02:01:06.006Z
Learning: In Next.js applications, instrumentation files (instrumentation.ts or instrumentation-client.ts) placed in the src/ directory are automatically handled by the framework and included in the client/server bundles without requiring manual imports. The framework injects these files as part of the build process.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/exports/** : Export everything via exports/
directory, grouped by feature in the SDK public API
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to biome.json : Biome is the primary linter/formatter; rules are defined in biome.json
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 : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
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/**/*.{ts,tsx} : Export default async functions without 'use client';
– they run on the Node edge.
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} : Client Components (browser): Begin files with 'use client';
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.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/exports/react.native.ts : React Native specific exports are in src/exports/react.native.ts
packages/insight/src/client/client/utils.ts (16)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Prefix files with import "server-only";
so they never end up in the client bundle.
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/**/*.{ts,tsx} : Export default async functions without 'use client';
– they run on the Node edge.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Co-locate data helpers under @/api/**
and mark them with "server-only".
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Limit each file to one stateless, single-responsibility function for clarity
Learnt from: jnsdls
PR: #7363
File: apps/dashboard/src/app/(app)/layout.tsx:63-74
Timestamp: 2025-06-18T02:01:06.006Z
Learning: In Next.js applications, instrumentation files (instrumentation.ts or instrumentation-client.ts) placed in the src/ directory are automatically handled by the framework and included in the client/server bundles without requiring manual imports. The framework injects these files as part of the build process.
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} : Client Components (browser): Begin files with 'use client';
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side-effect free
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 : Keep queryKey
stable and descriptive for cache hits.
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/**/*.{ts,tsx} : Reading cookies/headers with next/headers
(getAuthToken()
, cookies()
).
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Always call getAuthToken()
to get the JWT from cookies.
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
)
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 : Create light wrappers (e.g. fetchJson
) that automatically attach the JWT from cookies/session when calling internal API routes.
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} : Always call getAuthToken()
to retrieve JWT from cookies on server side
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.
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} : Use descriptive, stable queryKeys
for React Query cache hits
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 : Prefer API routes or server actions to keep tokens secret; the browser only sees relative paths.
packages/insight/src/client/core/bodySerializer.ts (4)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Limit each file to one stateless, single-responsibility function for clarity
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Prefix files with import "server-only";
so they never end up in the client bundle.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Co-locate data helpers under @/api/**
and mark them with "server-only".
Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:82-90
Timestamp: 2025-06-13T13:03:41.732Z
Learning: The thirdweb contract
object is serializable and can safely be used in contexts (e.g., React-Query keys) that require serializable values.
packages/insight/src/client/client.gen.ts (7)
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/**/components/*.client.tsx : Client components must start with 'use client';
before imports.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Prefix files with import "server-only";
so they never end up in the client bundle.
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} : Client Components (browser): Begin files with 'use client';
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/**/*.{ts,tsx} : Export default async functions without 'use client';
– they run on the Node edge.
Learnt from: jnsdls
PR: #7363
File: apps/dashboard/src/app/(app)/layout.tsx:63-74
Timestamp: 2025-06-18T02:01:06.006Z
Learning: In Next.js applications, instrumentation files (instrumentation.ts or instrumentation-client.ts) placed in the src/ directory are automatically handled by the framework and included in the client/server bundles without requiring manual imports. The framework injects these files as part of the build process.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Server Components (Node edge): Start files with import "server-only";
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 : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
packages/insight/src/client/core/params.ts (9)
Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/page.tsx:2-10
Timestamp: 2025-05-26T16:28:10.079Z
Learning: In Next.js 14+, the params
object in page components is always a Promise that needs to be awaited, so the correct typing is params: Promise<ParamsType>
rather than params: ParamsType
.
Learnt from: jnsdls
PR: #6929
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/insight/webhooks/page.tsx:14-19
Timestamp: 2025-05-21T05:17:31.283Z
Learning: In Next.js server components, the params
object can sometimes be a Promise that needs to be awaited, despite type annotations suggesting otherwise. In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/insight/webhooks/page.tsx, it's necessary to await the params object before accessing its properties.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Comment only ambiguous logic; avoid restating TypeScript in prose
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Write idiomatic TypeScript with explicit function declarations and return types
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
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 : Keep queryKey
stable and descriptive for cache hits.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Limit each file to one stateless, single-responsibility function for clarity
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Prefix files with import "server-only";
so they never end up in the client bundle.
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/**/*.{ts,tsx} : Export default async functions without 'use client';
– they run on the Node edge.
packages/insight/src/configure.ts (4)
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/**/components/*.client.tsx : Client components must start with 'use client';
before imports.
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/**/*.{ts,tsx} : Export default async functions without 'use client';
– they run on the Node edge.
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 : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
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} : Client Components (browser): Begin files with 'use client';
packages/insight/package.json (7)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Lint all packages using pnpm lint
and auto-fix linting issues with pnpm fix
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Build all packages using pnpm build
and specific packages with dependencies using turbo run build --filter=./packages/*
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Run pnpm biome check --apply
before committing (pre-commit hook)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Use pnpm install
(or pnpm install --ignore-scripts
on Windows) for installing dependencies
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Monorepo is managed with Turborepo and pnpm workspaces
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: De-duplicate dependencies across packages through pnpm workspace hoisting
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side-effect free
packages/insight/src/client/client/types.ts (18)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Write idiomatic TypeScript with explicit function declarations and return types
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Prefix files with import "server-only";
so they never end up in the client bundle.
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} : Client Components (browser): Begin files with 'use client';
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/**/*.{ts,tsx} : Export default async functions without 'use client';
– they run on the Node edge.
Learnt from: jnsdls
PR: #7363
File: apps/dashboard/src/app/(app)/layout.tsx:63-74
Timestamp: 2025-06-18T02:01:06.006Z
Learning: In Next.js applications, instrumentation files (instrumentation.ts or instrumentation-client.ts) placed in the src/ directory are automatically handled by the framework and included in the client/server bundles without requiring manual imports. The framework injects these files as part of the build process.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Re-use shared types from @/types
or local types.ts
barrels
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Return typed results (Project[]
, User[]
, …) – avoid any
.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard//api//*.{ts,tsx} : Co-locate data helpers under @/api/**
and mark them with "server-only".
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Prefer type aliases over interface except for nominal shapes
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Avoid any
and unknown
unless unavoidable; narrow generics when possible
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 : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
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/**/components/*.client.tsx : Client components must start with 'use client';
before imports.
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 : Create light wrappers (e.g. fetchJson
) that automatically attach the JWT from cookies/session when calling internal API routes.
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.
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 : Pages requiring fast transitions where data is prefetched on the client.
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.
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).
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
)
packages/thirdweb/src/extensions/erc721/read/getOwnedNFTs.ts (1)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Auto-generated contracts from ABI definitions in extensions
packages/insight/biome.json (7)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to biome.json : Biome is the primary linter/formatter; rules are defined in biome.json
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Run pnpm biome check --apply
before committing (pre-commit hook)
Learnt from: MananTank
PR: #7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of defineChain
. When it's necessary to use defineChain
directly, it's acceptable to disable the rule with // eslint-disable-next-line no-restricted-syntax
.
Learnt from: saminacodes
PR: #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.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Composable functions with TypeScript safety in extensions
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/extensions/** : Extensions follow modular pattern in src/extensions/
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Server Components (Node edge): Start files with import "server-only";
packages/insight/src/client/sdk.gen.ts (1)
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenPriceData.ts:49-49
Timestamp: 2025-05-27T19:55:25.056Z
Learning: In the ERC20 public pages token price data hook (useTokenPriceData.ts
), direct array access on json.data[0]
without optional chaining is intentionally correct and should not be changed to use safety checks.
packages/thirdweb/src/insight/get-tokens.ts (3)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenPriceData.ts:49-49
Timestamp: 2025-05-27T19:55:25.056Z
Learning: In the ERC20 public pages token price data hook (useTokenPriceData.ts
), direct array access on json.data[0]
without optional chaining is intentionally correct and should not be changed to use safety checks.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Unified Wallet
and Account
interfaces in wallet architecture
⏰ 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, webpack)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Unit Tests
- GitHub Check: Lint Packages
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (22)
packages/insight/src/client/client/index.ts (1)
4-7
: LGTM – formatting only
No functional impact.packages/insight/src/client/core/pathSerializer.ts (1)
1-180
: LGTM! Formatting standardization applied consistently.The indentation changes from spaces to tabs have been applied consistently throughout the file without affecting any functional logic, type definitions, or exported interfaces.
packages/insight/src/client/client/utils.ts (1)
1-418
: LGTM! Consistent formatting applied.The formatting changes maintain code style consistency without altering any utility functions or their behavior. All exports and functionality remain unchanged.
packages/thirdweb/src/extensions/erc1155/read/getOwnedNFTs.ts (1)
65-65
: LGTM! Contract filtering implemented correctly.The addition of
contractAddress: options.contract.address
properly implements contract filtering for the Insight API call, aligning with the PR's objective to add contract filtering capabilities.packages/thirdweb/src/extensions/erc721/read/getOwnedNFTs.ts (1)
81-81
: LGTM! Contract filtering implemented correctly.The addition of
contractAddress: options.contract.address
properly implements contract filtering for ERC721 NFTs, consistent with the ERC1155 implementation.packages/insight/src/client/core/types.ts (1)
1-99
: LGTM! Formatting consistency maintained.The indentation changes maintain code style consistency across the Client and Config interfaces without affecting any type definitions or exported APIs.
.changeset/tidy-dogs-try.md (1)
1-6
: LGTM! Changeset accurately documents the contract filtering feature.The changeset properly describes the patch-level addition of contract filtering capabilities to the Insight module's NFT and token retrieval methods.
packages/insight/package.json (1)
47-47
: LGTM! Improves build process with automatic code fixing.Adding
pnpm fix
to the build generation pipeline ensures that generated code automatically adheres to biome linting rules, maintaining consistency with the project's formatting standards.packages/insight/src/client/client/client.ts (1)
1-189
: LGTM! Formatting standardization aligns with biome adoption.The indentation and whitespace changes improve consistency across the codebase without affecting functionality. These changes support the PR's goal of standardizing formatting with biome.
packages/insight/src/client/client.gen.ts (1)
3-22
: LGTM! Auto-generated formatting aligns with biome standards.The formatting changes in imports and type definitions maintain consistency with the project's biome configuration without affecting the generated client's functionality.
packages/insight/openapi-ts.config.ts (1)
5-5
: LGTM! Biome integration improves generated code consistency.The configuration update ensures that OpenAPI-generated code automatically uses biome for formatting and linting, creating consistency with the rest of the codebase and supporting the PR's standardization goals.
packages/insight/src/client/core/params.ts (1)
1-141
: LGTM! Formatting changes improve code consistency.These are purely formatting changes converting spaces to tabs for consistent indentation. The logic for parameter building, field mapping, and slot handling remains unchanged.
packages/insight/src/client/client/types.ts (1)
1-223
: LGTM! Consistent formatting applied to type definitions.These are purely whitespace and indentation changes converting from spaces to tabs. All type definitions, interfaces, and generic constraints remain functionally identical.
packages/insight/biome.json (1)
3-15
: LGTM! Good addition of import extension enforcement.The new linter rule
useImportExtensions
withforceJsExtensions: true
enforces explicit.js
extensions in import statements, which improves ES module compatibility and follows modern standards. The"fix": "safe"
option allows automatic correction.packages/thirdweb/src/insight/get-nfts.ts (2)
32-39
: LGTM! Contract filtering parameter added correctly.The addition of the optional
contractAddress
parameter enhances the function's filtering capabilities while maintaining backward compatibility.
54-64
: LGTM! Query structure updated to support contract filtering.The changes correctly implement contract filtering by:
- Converting
owner_address
to an array format- Adding conditional
contract_address
array when filtering is needed- Maintaining the existing query structure and options
packages/thirdweb/src/insight/get-tokens.ts (2)
25-34
: LGTM! Token filtering parameter added with consistent signature.The addition of the optional
tokenAddress
parameter follows the same pattern as the NFT filtering implementation, providing consistency across the Insight API.
49-61
: LGTM! Query structure consistently updated for token filtering.The implementation correctly mirrors the NFT filtering approach by:
- Converting
owner_address
to an array format- Adding conditional
token_address
array for filtering- Maintaining consistent API structure across token and NFT retrieval
packages/insight/src/client/sdk.gen.ts (4)
124-126
: LGTM: New webhook filter validation types imported correctly.The import of the new types for the webhook filter validation endpoint (
PostServiceWebhooksFiltersValidateData
,PostServiceWebhooksFiltersValidateErrors
,PostServiceWebhooksFiltersValidateResponses
) follows the established naming convention and is properly integrated with the existing imports.
158-159
: Appropriate deprecation of webhook management functions.The webhook-related functions are correctly marked as deprecated with
@deprecated
JSDoc tags. The deprecation message in thepostV1Webhooks
function (line 181) provides clear context about why webhooks are being deprecated and mentions that a general thirdweb webhook solution will be available instead.Also applies to: 182-183, 210-211, 236-237, 266-267
1189-1216
: New webhook filter validation endpoint implemented correctly.The
postServiceWebhooksFiltersValidate
function is well-implemented with:
- Proper security configuration using
x-client-id
API key- Correct POST method with JSON content type
- Appropriate type annotations for request/response handling
- Optional parameters following the established pattern
- Clear JSDoc documentation explaining the purpose
The endpoint serves as a validation utility for webhook filters, which aligns with the deprecation of the main webhook creation functionality.
1168-1187
: Formatting is consistent across all generated SDK functions.After checking the signatures of every
getV1…
function in packages/insight/src/client/sdk.gen.ts, they all follow the same pattern:export const getV1FooBar = < ThrowOnError extends boolean = false, >( options: Options<GetV1FooBarData, ThrowOnError>, ) => { // … };No formatting drift was found for
getV1WalletsByWalletAddressTransactions
—its closing parenthesis and arrow placement match every other function. You can disregard this comment.Likely an incorrect or invalid review comment.
if (auth.scheme === "bearer") { | ||
return `Bearer ${token}`; | ||
} | ||
|
||
if (auth.scheme === "basic") { | ||
return `Basic ${btoa(token)}`; | ||
} | ||
if (auth.scheme === "basic") { | ||
return `Basic ${btoa(token)}`; | ||
} |
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.
btoa
is browser-only – breaks on Node
btoa
is not available in most supported Node versions. Use a portable helper:
- if (auth.scheme === "basic") {
- return `Basic ${btoa(token)}`;
- }
+ if (auth.scheme === "basic") {
+ const encoded =
+ typeof window === "undefined"
+ ? Buffer.from(token, "utf8").toString("base64")
+ : btoa(token);
+ return `Basic ${encoded}`;
+ }
This prevents runtime ReferenceErrors in server contexts.
📝 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.
if (auth.scheme === "bearer") { | |
return `Bearer ${token}`; | |
} | |
if (auth.scheme === "basic") { | |
return `Basic ${btoa(token)}`; | |
} | |
if (auth.scheme === "basic") { | |
return `Basic ${btoa(token)}`; | |
} | |
if (auth.scheme === "bearer") { | |
return `Bearer ${token}`; | |
} | |
if (auth.scheme === "basic") { | |
const encoded = | |
typeof window === "undefined" | |
? Buffer.from(token, "utf8").toString("base64") | |
: btoa(token); | |
return `Basic ${encoded}`; | |
} |
🤖 Prompt for AI Agents
In packages/insight/src/client/core/auth.ts around lines 31 to 37, the use of
the browser-only function btoa causes runtime errors in Node environments.
Replace btoa with a portable base64 encoding helper that works in both browser
and Node contexts, such as Buffer.from(token).toString('base64') in Node or a
custom utility function that abstracts the environment differences.
client.setConfig({ | ||
headers: { | ||
...(options.clientId && { "x-client-id": options.clientId }), | ||
...(options.secretKey && { "x-secret-key": options.secretKey }), | ||
}, | ||
...(options.override ?? {}), | ||
}); |
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.
Header merge may silently drop auth headers
override.headers
overwrites the headers object you create earlier, so
configure({ clientId:"x", secretKey:"y", override:{ headers:{ "foo":"bar" }}})
results in a request missing x-client-id
& x-secret-key
.
Merge the nested headers
instead of replacing them:
- client.setConfig({
- headers: {
- ...(options.clientId && { "x-client-id": options.clientId }),
- ...(options.secretKey && { "x-secret-key": options.secretKey }),
- },
- ...(options.override ?? {}),
- });
+ const baseHeaders = {
+ ...(options.clientId && { "x-client-id": options.clientId }),
+ ...(options.secretKey && { "x-secret-key": options.secretKey }),
+ };
+
+ client.setConfig({
+ ...options.override,
+ headers: { ...baseHeaders, ...options.override?.headers },
+ });
🤖 Prompt for AI Agents
In packages/insight/src/configure.ts lines 12 to 18, the current code replaces
the entire headers object when options.override.headers is provided, causing the
loss of authentication headers. To fix this, merge the existing headers with
override.headers so that the authentication headers are preserved while allowing
overrides. Specifically, spread the original headers and then spread
override.headers inside the headers object to combine them properly.
a06bbbc
to
cbb4f04
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7710 +/- ##
==========================================
- Coverage 56.24% 56.22% -0.02%
==========================================
Files 905 905
Lines 58876 58880 +4
Branches 4138 4135 -3
==========================================
- Hits 33115 33107 -8
- Misses 25656 25669 +13
+ Partials 105 104 -1
🚀 New features to boost your workflow:
|
PR-Codex overview
This PR focuses on updating the
thirdweb
and@thirdweb-dev/insight
packages, enhancing API functionality, and improving type definitions while adding support for contract filtering in NFT and token queries.Detailed summary
thirdweb
package to support contract filtering inInsight.getOwnedNFTs
andgetOwnedTokens
.openapi-ts.config.ts
to usebiome
format.contractAddress
parameter togetOwnedNFTs
andgetOwnedTokens
functions.Auth
interface and request handling inclient
methods.build:generate
script inpackage.json
to includepnpm fix
.Summary by CodeRabbit
New Features
Improvements
Style