-
Notifications
You must be signed in to change notification settings - Fork 562
[Docs] Update API endpoints and add frontend/backend examples #7692
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
[Docs] Update API endpoints and add frontend/backend examples #7692
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
WalkthroughThe changes update and expand documentation for contracts, transactions, and wallets APIs, introducing new HTTP API usage instructions, updated endpoint URLs, authentication header requirements, and request/response examples. UI components for authentication code snippets were refactored to support HTTP examples, dynamic platform filtering, and multiple code blocks per platform. The payments documentation was simplified by removing a large example response and adding new pages for funding wallets and onchain transactions. New AI-related documentation and layout components were added. No production code was modified. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Frontend
participant Backend
participant API
%% User authentication via HTTP (email/phone)
User->>Frontend: Request login (email/phone)
Frontend->>API: POST /send-code (x-client-id)
API-->>Frontend: Code sent
User->>Frontend: Enter received code
Frontend->>API: POST /verify-code (x-client-id)
API-->>Frontend: Wallet address & JWT
%% Contract write (frontend)
User->>Frontend: Initiate contract write
Frontend->>API: POST /contracts/write (x-client-id + Bearer token)
API-->>Frontend: Transaction result
%% Contract write (backend)
Backend->>API: POST /contracts/write (x-secret-key)
API-->>Backend: Transaction result
%% Server wallet creation
Backend->>API: POST /wallets/server (x-secret-key)
API-->>Backend: Wallet address
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ 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. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7692 +/- ##
==========================================
- Coverage 56.38% 56.36% -0.03%
==========================================
Files 908 908
Lines 58247 58247
Branches 4224 4225 +1
==========================================
- Hits 32844 32829 -15
- Misses 25293 25310 +17
+ Partials 110 108 -2
🚀 New features to boost your workflow:
|
067009e
to
31a136d
Compare
size-limit report 📦
|
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
apps/portal/src/app/contracts/page.mdx
(2 hunks)apps/portal/src/app/payments/page.mdx
(1 hunks)apps/portal/src/app/transactions/page.mdx
(1 hunks)apps/portal/src/app/wallets/page.mdx
(3 hunks)apps/portal/src/app/wallets/server/page.mdx
(1 hunks)apps/portal/src/components/Document/AuthMethodsTabs.tsx
(11 hunks)
✅ Files skipped from review due to trivial changes (1)
- apps/portal/src/app/wallets/server/page.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/portal/src/app/wallets/page.mdx
- apps/portal/src/app/contracts/page.mdx
🧰 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:
apps/portal/src/components/Document/AuthMethodsTabs.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/portal/src/components/Document/AuthMethodsTabs.tsx
🧠 Learnings (4)
📓 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: Keep documentation focused on developer experience and practical usage
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: 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
apps/portal/src/app/payments/page.mdx (10)
Learnt from: gregfromstl
PR: #7450
File: packages/thirdweb/src/bridge/Webhook.ts:57-81
Timestamp: 2025-06-26T19:46:04.024Z
Learning: In the onramp webhook schema (packages/thirdweb/src/bridge/Webhook.ts
), the currencyAmount
field is intentionally typed as z.number()
while other amount fields use z.string()
because currencyAmount
represents fiat currency amounts in decimals (like $10.50), whereas other amount fields represent token amounts in wei (very large integers that benefit from bigint representation). The different naming convention (currencyAmount
vs amount
) reflects this intentional distinction.
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: 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 **/*.{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 packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Learnt from: MananTank
PR: #7081
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/assets/create/create-token-page-impl.tsx:110-118
Timestamp: 2025-05-20T18:54:15.781Z
Learning: In the thirdweb dashboard's token asset creation flow, the transferBatch
function from thirdweb/extensions/erc20
accepts the raw quantity values from the form without requiring explicit conversion to wei using toUnits()
. The function appears to handle this conversion internally or is designed to work with the values in the format they're already provided.
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 packages/thirdweb/src/exports/** : Every public symbol must have comprehensive TSDoc with at least one @example
block that compiles and custom annotation tags (@beta
, @internal
, @experimental
)
Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.
Learnt from: MananTank
PR: #7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:255-277
Timestamp: 2025-06-06T23:47:55.122Z
Learning: The transfer
function from thirdweb/extensions/erc20
accepts human-readable amounts via the amount
property and automatically handles conversion to base units (wei) by fetching the token decimals internally. Manual conversion using toWei()
is not required when using the amount
property.
apps/portal/src/app/transactions/page.mdx (6)
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: 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
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 src/extensions/** : Auto-generated contracts from ABI definitions in extensions
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: 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.
apps/portal/src/components/Document/AuthMethodsTabs.tsx (26)
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: 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/**/*.{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 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: .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 **/*.{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 apps/{dashboard,playground-web}/**/*.{ts,tsx} : Import UI primitives from @/components/ui/*
(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
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/** : Support for in-app wallets (social/email login)
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 test/src/test-wallets.ts : Predefined test accounts are in test/src/test-wallets.ts
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 design system tokens (e.g., bg-card
, border-border
, text-muted-foreground
)
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: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/analytics/shared-analytics-page.tsx:33-39
Timestamp: 2025-05-26T16:30:24.965Z
Learning: In the thirdweb dashboard codebase, redirectToContractLandingPage function already handles execution termination internally (likely using Next.js redirect() which throws an exception), so no explicit return statement is needed after calling it.
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 : Create light wrappers (e.g. fetchJson
) that automatically attach the JWT from cookies/session when calling internal API routes.
Learnt from: MananTank
PR: #7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
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: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
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: MananTank
PR: #7285
File: apps/dashboard/src/app/(app)/(dashboard)/published-contract/components/uri-based-deploy.tsx:57-57
Timestamp: 2025-06-05T13:59:49.886Z
Learning: In the thirdweb dashboard Next.js app, when using loginRedirect() in server components, ensure to add a return statement after the redirect call to prevent further code execution and potential security issues.
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 : 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/**/layout.tsx : Building layout shells (layout.tsx
) and top-level pages that mainly assemble data.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Local state or effects live inside; data fetching happens in 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/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Size
- GitHub Check: Analyze (javascript)
🔇 Additional comments (6)
apps/portal/src/app/transactions/page.mdx (1)
69-153
: Excellent separation of frontend and backend HTTP examples.The nested tab structure clearly distinguishes between frontend (user wallet + client ID) and backend (server wallet + secret key) authentication patterns. The consistent transaction structure across both examples enhances developer understanding.
apps/portal/src/components/Document/AuthMethodsTabs.tsx (4)
72-91
: Well-structured platform filtering logic.The
getPlatformsForAuth
function elegantly handles the conditional display of HTTP platform based on the authentication method. The logic is clear and maintainable.
93-112
: Good abstraction for code snippet generation.The
getCodeSnippet
function properly abstracts the platform-specific code generation and returns arrays to support multiple code blocks per platform, which is essential for the HTTP examples that show both sending and verifying OTP codes.
"from": "0x...", // the user wallet address | ||
"chainId": "1" // the chain id | ||
"transactions": [{ |
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 missing comma in JSON structure.
There's a missing comma after the chainId
field in the frontend HTTP example.
{
"from": "0x...", // the user wallet address
- "chainId": "1" // the chain id
+ "chainId": "1", // the chain id
"transactions": [{
📝 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.
"from": "0x...", // the user wallet address | |
"chainId": "1" // the chain id | |
"transactions": [{ | |
"from": "0x...", // the user wallet address | |
"chainId": "1", // the chain id | |
"transactions": [{ |
🤖 Prompt for AI Agents
In apps/portal/src/app/transactions/page.mdx around lines 94 to 96, there is a
missing comma after the "chainId" field in the JSON example. Add a comma
immediately after the "chainId": "1" line to correct the JSON syntax.
{ | ||
"from": "0x...", // the server wallet address | ||
"chainId": "1" // the chain id | ||
"transactions": [{ | ||
// contract call | ||
"type": "contract-call", | ||
"contractAddress": "0x...", | ||
"method": "function transfer(address to, uint256 amount)", | ||
"params": ["0x...", "1000000000000000000"], | ||
}, { | ||
// encoded transaction | ||
"type": "encoded", | ||
"to": "0x...", | ||
"data": "0x...", | ||
}, { | ||
// native transfer | ||
"type": "native-transfer", | ||
"to": "0x...", | ||
"value": "1000000000000000000", // in wei | ||
}], | ||
} | ||
} |
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 missing comma in JSON structure.
There's a missing comma after the chainId
field in the backend HTTP example.
{
"from": "0x...", // the server wallet address
- "chainId": "1" // the chain id
+ "chainId": "1", // the chain id
"transactions": [{
📝 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.
{ | |
"from": "0x...", // the server wallet address | |
"chainId": "1" // the chain id | |
"transactions": [{ | |
// contract call | |
"type": "contract-call", | |
"contractAddress": "0x...", | |
"method": "function transfer(address to, uint256 amount)", | |
"params": ["0x...", "1000000000000000000"], | |
}, { | |
// encoded transaction | |
"type": "encoded", | |
"to": "0x...", | |
"data": "0x...", | |
}, { | |
// native transfer | |
"type": "native-transfer", | |
"to": "0x...", | |
"value": "1000000000000000000", // in wei | |
}], | |
} | |
} | |
{ | |
"from": "0x...", // the server wallet address | |
"chainId": "1", // the chain id | |
"transactions": [{ | |
// contract call | |
"type": "contract-call", | |
"contractAddress": "0x...", | |
"method": "function transfer(address to, uint256 amount)", | |
"params": ["0x...", "1000000000000000000"], | |
}, { | |
// encoded transaction | |
"type": "encoded", | |
"to": "0x...", | |
"data": "0x...", | |
}, { | |
// native transfer | |
"type": "native-transfer", | |
"to": "0x...", | |
"value": "1000000000000000000", // in wei | |
}], | |
} |
🤖 Prompt for AI Agents
In apps/portal/src/app/transactions/page.mdx between lines 127 and 147, there is
a missing comma after the "chainId" field in the JSON example. Add a comma
immediately after the "chainId": "1" line to correct the JSON syntax and ensure
proper parsing.
31a136d
to
d282388
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
apps/portal/src/app/contracts/page.mdx
(2 hunks)apps/portal/src/app/payments/fund/page.mdx
(1 hunks)apps/portal/src/app/payments/page.mdx
(2 hunks)apps/portal/src/app/payments/sidebar.tsx
(1 hunks)apps/portal/src/app/payments/transactions/page.mdx
(1 hunks)apps/portal/src/app/transactions/page.mdx
(1 hunks)apps/portal/src/app/wallets/page.mdx
(3 hunks)apps/portal/src/app/wallets/server/page.mdx
(1 hunks)apps/portal/src/components/Document/AuthMethodsTabs.tsx
(11 hunks)
✅ Files skipped from review due to trivial changes (1)
- apps/portal/src/app/wallets/server/page.mdx
🚧 Files skipped from review as they are similar to previous changes (3)
- apps/portal/src/app/payments/page.mdx
- apps/portal/src/app/wallets/page.mdx
- apps/portal/src/app/transactions/page.mdx
🧰 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:
apps/portal/src/app/payments/sidebar.tsx
apps/portal/src/components/Document/AuthMethodsTabs.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/portal/src/app/payments/sidebar.tsx
apps/portal/src/components/Document/AuthMethodsTabs.tsx
🧠 Learnings (6)
📓 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: Keep documentation focused on developer experience and practical usage
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: 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
apps/portal/src/app/payments/sidebar.tsx (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/**/*.{tsx,jsx} : Layouts should reuse SidebarLayout
/ FullWidthSidebarLayout
(@/components/blocks/SidebarLayout
).
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 NavLink
for internal navigation with automatic active states in dashboard and playground apps
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: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:155-160
Timestamp: 2025-06-10T00:46:58.580Z
Learning: In the dashboard application, the route structure for team and project navigation is /team/[team_slug]/[project_slug]/...
without a /project/
segment. Contract links should be formatted as /team/${teamSlug}/${projectSlug}/contract/${chainId}/${contractAddress}
.
apps/portal/src/components/Document/AuthMethodsTabs.tsx (26)
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: 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: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Import UI primitives from @/components/ui/*
(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
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 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: .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: .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} : Use design system tokens (e.g., bg-card
, border-border
, text-muted-foreground
)
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 packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to test/src/test-wallets.ts : Predefined test accounts are in test/src/test-wallets.ts
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: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/analytics/shared-analytics-page.tsx:33-39
Timestamp: 2025-05-26T16:30:24.965Z
Learning: In the thirdweb dashboard codebase, redirectToContractLandingPage function already handles execution termination internally (likely using Next.js redirect() which throws an exception), so no explicit return statement is needed after calling it.
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 : Create light wrappers (e.g. fetchJson
) that automatically attach the JWT from cookies/session when calling internal API routes.
Learnt from: MananTank
PR: #7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
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: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
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: MananTank
PR: #7285
File: apps/dashboard/src/app/(app)/(dashboard)/published-contract/components/uri-based-deploy.tsx:57-57
Timestamp: 2025-06-05T13:59:49.886Z
Learning: In the thirdweb dashboard Next.js app, when using loginRedirect() in server components, ensure to add a return statement after the redirect call to prevent further code execution and potential security issues.
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 : 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/**/layout.tsx : Building layout shells (layout.tsx
) and top-level pages that mainly assemble data.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Local state or effects live inside; data fetching happens in 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/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
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.
apps/portal/src/app/contracts/page.mdx (6)
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
Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:155-160
Timestamp: 2025-06-10T00:46:58.580Z
Learning: In the dashboard application, the route structure for team and project navigation is /team/[team_slug]/[project_slug]/...
without a /project/
segment. Contract links should be formatted as /team/${teamSlug}/${projectSlug}/contract/${chainId}/${contractAddress}
.
Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/nfts/page.tsx:20-20
Timestamp: 2025-05-26T16:26:58.068Z
Learning: In team/project contract pages under routes like /team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/*
, users are always logged in by design. The hardcoded isLoggedIn={true}
prop in these pages is intentional and correct, not a bug to be fixed.
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: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
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.
apps/portal/src/app/payments/fund/page.mdx (6)
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: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The projectMeta
prop is not required for the server-rendered ContractTokensPage
component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
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 packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)
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
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to test/src/test-wallets.ts : Predefined test accounts are in test/src/test-wallets.ts
apps/portal/src/app/payments/transactions/page.mdx (4)
Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The projectMeta
prop is not required for the server-rendered ContractTokensPage
component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
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 : Anything that consumes hooks from @tanstack/react-query
or thirdweb SDKs.
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The fetchDashboardContractMetadata
function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
🪛 LanguageTool
apps/portal/src/app/payments/fund/page.mdx
[style] ~36-~36: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...List> ### Fund a wallet with the BuyWidget
```tsx i...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
apps/portal/src/app/payments/transactions/page.mdx
[grammar] ~22-~22: Ensure spelling is correct
Context: ....", }); # Pay for Transactions Pay for onchain transactions using any token or fiat wi...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~34-~34: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...List> ### Pay for a transaction with the `Transaction...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
⏰ 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: Unit Tests
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Build Packages
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (15)
apps/portal/src/components/Document/AuthMethodsTabs.tsx (8)
10-16
: Well-structured platform additions.The addition of the HTTP platform with proper icon imports and type definitions follows established patterns and maintains consistency with existing platform configurations.
Also applies to: 37-44, 72-81
83-91
: Good conditional platform filtering logic.The filtering logic appropriately shows HTTP examples only for email and phone authentication methods, which makes sense given these are the methods that require OTP verification via HTTP API calls.
93-112
: Excellent refactor to support multiple code snippets.Converting the return type to
string[]
elegantly handles cases where multiple code blocks are needed per platform (e.g., send OTP + verify OTP for HTTP authentication).
114-171
: Well-structured HTTP API examples.The HTTP snippets properly demonstrate the two-step OTP flow with correct API endpoints, headers, and request bodies. The examples follow REST API conventions and provide clear documentation for developers.
173-319
: Clean TypeScript snippet implementations.The TypeScript examples are well-structured with reusable base setup, proper imports, and clear implementation details for each authentication method.
384-601
: Comprehensive React examples with good UX patterns.The React snippets effectively demonstrate both custom hook implementations and prebuilt UI components. The specialized handling for email/phone authentication with separate OTP sending functions matches real-world usage patterns.
603-806
: Solid C# implementations for .NET and Unity.The .NET and Unity examples demonstrate proper C# conventions, appropriate async/await patterns, and platform-specific SDK usage. The provider mapping for social authentication methods is clean and maintainable.
814-923
: Well-architected component updates.The component properly integrates platform filtering, handles multiple code snippets per platform, and includes appropriate syntax highlighting logic. The state management and rendering logic are clean and follow React best practices.
apps/portal/src/app/contracts/page.mdx (3)
72-91
: Improved API documentation clarity.The updates provide clearer guidance with full API URLs, simplified request body structure, and explicit authentication header requirements for both frontend and backend usage.
95-150
: Excellent frontend/backend separation with clear security patterns.The tabbed approach clearly distinguishes between frontend (client ID + user auth token) and backend (secret key + server wallet) usage patterns, following security best practices and improving developer understanding.
37-68
: Strategic positioning of HTTP API documentation.Placing the HTTP tab first reflects the increased emphasis on REST API integration, while maintaining comprehensive SDK examples for all supported platforms.
apps/portal/src/app/payments/sidebar.tsx (1)
19-30
: Well-structured sidebar additions.The new payment guide links follow the established pattern and are appropriately positioned at the beginning of the guides section, likely reflecting their importance as primary use cases.
apps/portal/src/app/payments/fund/page.mdx (2)
38-68
: Comprehensive and well-structured BuyWidget example.The React example demonstrates proper thirdweb patterns with appropriate imports, client setup, and comprehensive widget configuration including success handling.
13-20
: Proper page metadata structure.The metadata configuration correctly sets up the page title, description, and icon for the Fund Wallet documentation.
apps/portal/src/app/payments/transactions/page.mdx (1)
11-18
: Appropriate page metadata configuration.The metadata properly configures the page title, description, and payments icon for the transaction documentation.
<TransactionWidget | ||
client={client} | ||
chain={arbitrum} | ||
transaction={prepareContractCall({ | ||
contract, | ||
method: "function paidMint(address to, uint256 amount)", | ||
args: [to, amount], | ||
// if the transaction requires a native token, you can specify the amount with `value` | ||
value: toUnits("100", 18), // the amount of native token required to purchase in wei | ||
// if the transaction requires an erc20 token, you can specify the token and amount with `erc20Value` | ||
erc20value: { | ||
token: USDC_TOKEN_ADDRESS, // the erc20 token required to purchase | ||
amount: toUnits("100", 6), // the amount of erc20 token required to purchase in wei | ||
}, | ||
})} |
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 missing variable definitions in the example.
The TransactionWidget example references several undefined variables that would prevent it from working:
Apply this diff to fix the missing definitions:
import { TransactionWidget } from "thirdweb/react";
-import { createThirdwebClient, prepareContractCall } from "thirdweb";
+import { createThirdwebClient, prepareContractCall, getContract, toUnits } from "thirdweb";
import { arbitrum } from "thirdweb/chains";
const client = createThirdwebClient({
clientId: "YOUR_CLIENT_ID",
});
+const contract = getContract({
+ client,
+ chain: arbitrum,
+ address: "0x...", // Your contract address
+});
+
+const USDC_TOKEN_ADDRESS = "0x..."; // USDC token address on Arbitrum
+const to = "0x..."; // Recipient address
+const amount = 1; // Mint amount
function ProductPage() {
📝 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.
<TransactionWidget | |
client={client} | |
chain={arbitrum} | |
transaction={prepareContractCall({ | |
contract, | |
method: "function paidMint(address to, uint256 amount)", | |
args: [to, amount], | |
// if the transaction requires a native token, you can specify the amount with `value` | |
value: toUnits("100", 18), // the amount of native token required to purchase in wei | |
// if the transaction requires an erc20 token, you can specify the token and amount with `erc20Value` | |
erc20value: { | |
token: USDC_TOKEN_ADDRESS, // the erc20 token required to purchase | |
amount: toUnits("100", 6), // the amount of erc20 token required to purchase in wei | |
}, | |
})} | |
import { TransactionWidget } from "thirdweb/react"; | |
-import { createThirdwebClient, prepareContractCall } from "thirdweb"; | |
+import { createThirdwebClient, prepareContractCall, getContract, toUnits } from "thirdweb"; | |
import { arbitrum } from "thirdweb/chains"; | |
const client = createThirdwebClient({ | |
clientId: "YOUR_CLIENT_ID", | |
}); | |
+// === Added definitions to make the example self-contained === | |
+const contract = getContract({ | |
+ client, | |
+ chain: arbitrum, | |
+ address: "0x...", // Your contract address | |
+}); | |
+ | |
+const USDC_TOKEN_ADDRESS = "0x..."; // USDC token address on Arbitrum | |
+const to = "0x..."; // Recipient address | |
+const amount = 1; // Mint amount | |
+ | |
function ProductPage() { | |
return ( | |
<TransactionWidget | |
client={client} | |
chain={arbitrum} | |
transaction={prepareContractCall({ | |
contract, | |
method: "function paidMint(address to, uint256 amount)", | |
args: [to, amount], | |
// if the transaction requires a native token, you can specify the amount with `value` | |
value: toUnits("100", 18), // the amount of native token required to purchase in wei | |
// if the transaction requires an erc20 token, you can specify the token and amount with `erc20Value` | |
erc20value: { | |
token: USDC_TOKEN_ADDRESS, // the erc20 token required to purchase | |
amount: toUnits("100", 6), // the amount of erc20 token required to purchase in wei | |
}, | |
})} | |
onSuccess={() => { | |
/* ... */ | |
}} | |
/> | |
); | |
} |
🤖 Prompt for AI Agents
In apps/portal/src/app/payments/transactions/page.mdx around lines 51 to 65, the
TransactionWidget example uses variables like client, arbitrum, contract, to,
amount, USDC_TOKEN_ADDRESS, and toUnits without defining them. Define or import
these variables appropriately before using them to ensure the example works
correctly. For instance, import or declare client and contract instances, define
the arbitrum chain object, set values for to and amount, provide the USDC token
address constant, and include the toUnits utility function for unit conversion.
d282388
to
f812564
Compare
a79093c
to
4ab4b8a
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 (2)
apps/portal/src/app/payments/transactions/page.mdx (1)
52-66
: Undefined variables break the example snippet
contract
,to
,amount
,USDC_TOKEN_ADDRESS
, andtoUnits
are referenced but never defined/imported in this snippet. This prevents copy-paste success and confuses readers. Either:
- Inline basic placeholder definitions, or
- Import the helpers from the SDK before usage.
Example quick fix:
-import { createThirdwebClient, prepareContractCall } from "thirdweb"; +import { + createThirdwebClient, + prepareContractCall, + getContract, + toUnits, +} from "thirdweb"; +import { arbitrum } from "thirdweb/chains"; + +// setup +const CONTRACT_ADDRESS = "0x..."; // replace with your contract +const USDC_TOKEN_ADDRESS = "0x..."; // USDC on Arbitrum +const to = "0x..."; // recipient +const amount = 1; + +const contract = getContract({ client, chain: arbitrum, address: CONTRACT_ADDRESS });apps/portal/src/app/payments/fund/page.mdx (1)
13-14
: Remove unusedZapIcon
import
ZapIcon
is imported but never referenced, which will fail the lint step in CI.-import { ZapIcon } from "lucide-react";
🧹 Nitpick comments (7)
apps/portal/src/app/payments/onramp-providers/page.mdx (1)
23-29
: Nit: Harmonize pluralization and punctuation for professionalismMinor copy tweak – add a period after the final sentence to keep punctuation consistent with the rest of the documentation tables.
apps/portal/src/app/contracts/events/page.mdx (3)
17-31
: Add accessible labels to the tab triggers
Screen-reader users will only hear “HTTP”, “TypeScript”, “React”. Addingaria-label
or wrapping the text in a<span className="sr-only">
improves a11y without affecting the visual design.
38-44
: Provide a fully-qualified cURL example for copy-paste friendliness
Using the absolute URL avoids confusion about scheme/host headers and mirrors the pattern used elsewhere in the docs:-GET /v1/contracts/{address}/events?chainId=<chain_id>&decode=true -Host: api.thirdweb.com +curl -X GET "https://api.thirdweb.com/v1/contracts/{address}/events?chainId=<chain_id>&decode=true" \ + -H "x-secret-key: <project-secret-key>"
82-88
: Clarify CLI placeholder to avoid mis-copying
<contractId>/<contractAddress>
mixes two concepts (dashboard ID vs on-chain address). Consider a single placeholder or an explicit comment, e.g.:-npx thirdweb generate <contractId>/<contractAddress> +# For contracts created via the dashboard: +npx thirdweb generate <contractId> +# Or, for any deployed contract: +npx thirdweb generate <chainId>/<contractAddress>apps/portal/src/app/payments/fees/page.mdx (3)
11-12
: Prefer concise wording – “can” instead of “are able to”Minor style nit. Helps brevity and active voice.
-To monetize applications or games, you are able to set a developer fee +To monetize applications or games, you can set a developer fee
32-39
: FormatfeePayer
options and add blank line before list for proper renderingWithout a preceding blank line, Markdown may treat the list as plain text.
Also wrap the option values in back-ticks for clarity.-feePayer=buyer (Default) i.e. the user covers the protocol fee. - -Example: If the source token is 10 USDC, the user pays 10.30 USDC. - -- thirdweb receives: 0.30 USDC -- Receiver receives: 10.00 USDC +`feePayer=buyer` (default) – the user covers the protocol fee. + +Example: If the source token is 10 USDC, the user pays **10.30 USDC**. + + - thirdweb receives: **0.30 USDC** + - Receiver receives: **10.00 USDC**
40-47
: Apply same formatting for thereceiver
case-feePayer=receiver i.e. the receiver covers the protocol fee. - -Example: The user pays 10.00 USDC. - -- thirdweb receives: 0.30 USDC -- Receiver receives: 9.70 USDC +`feePayer=receiver` – the receiver covers the protocol fee. + +Example: The user pays **10.00 USDC**. + + - thirdweb receives: **0.30 USDC** + - Receiver receives: **9.70 USDC**
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
apps/portal/src/app/payments/fees/assets/fee-dash.png
is excluded by!**/*.png
📒 Files selected for processing (30)
apps/portal/redirects.mjs
(1 hunks)apps/portal/src/app/Header.tsx
(2 hunks)apps/portal/src/app/ai/layout.tsx
(1 hunks)apps/portal/src/app/ai/llm-txt/page.mdx
(1 hunks)apps/portal/src/app/ai/mcp/page.mdx
(1 hunks)apps/portal/src/app/contracts/events/page.mdx
(1 hunks)apps/portal/src/app/contracts/extensions/page.tsx
(1 hunks)apps/portal/src/app/contracts/page.mdx
(2 hunks)apps/portal/src/app/contracts/sidebar.tsx
(2 hunks)apps/portal/src/app/page.tsx
(1 hunks)apps/portal/src/app/payments/fees/page.mdx
(1 hunks)apps/portal/src/app/payments/fund/page.mdx
(1 hunks)apps/portal/src/app/payments/onramp-providers/page.mdx
(1 hunks)apps/portal/src/app/payments/page.mdx
(3 hunks)apps/portal/src/app/payments/products/page.mdx
(2 hunks)apps/portal/src/app/payments/sidebar.tsx
(2 hunks)apps/portal/src/app/payments/transactions/page.mdx
(1 hunks)apps/portal/src/app/tokens/page.mdx
(0 hunks)apps/portal/src/app/transactions/distribute-tokens/page.mdx
(1 hunks)apps/portal/src/app/transactions/monitor/page.mdx
(1 hunks)apps/portal/src/app/transactions/page.mdx
(1 hunks)apps/portal/src/app/transactions/session-keys/page.mdx
(0 hunks)apps/portal/src/app/transactions/sidebar.tsx
(2 hunks)apps/portal/src/app/transactions/sponsor/page.mdx
(3 hunks)apps/portal/src/app/wallets/page.mdx
(4 hunks)apps/portal/src/app/wallets/server/page.mdx
(1 hunks)apps/portal/src/app/wallets/sidebar.tsx
(3 hunks)apps/portal/src/components/Document/AuthMethodsTabs.tsx
(6 hunks)apps/portal/src/components/others/Sidebar.tsx
(1 hunks)packages/thirdweb/src/wallets/in-app/web/in-app.ts
(1 hunks)
💤 Files with no reviewable changes (2)
- apps/portal/src/app/tokens/page.mdx
- apps/portal/src/app/transactions/session-keys/page.mdx
✅ Files skipped from review due to trivial changes (5)
- packages/thirdweb/src/wallets/in-app/web/in-app.ts
- apps/portal/src/app/contracts/extensions/page.tsx
- apps/portal/src/app/transactions/sidebar.tsx
- apps/portal/src/app/wallets/server/page.mdx
- apps/portal/src/app/ai/llm-txt/page.mdx
🚧 Files skipped from review as they are similar to previous changes (17)
- apps/portal/src/app/transactions/monitor/page.mdx
- apps/portal/src/components/others/Sidebar.tsx
- apps/portal/src/app/payments/products/page.mdx
- apps/portal/src/app/page.tsx
- apps/portal/src/app/Header.tsx
- apps/portal/src/app/wallets/sidebar.tsx
- apps/portal/src/app/payments/page.mdx
- apps/portal/src/app/contracts/sidebar.tsx
- apps/portal/src/app/transactions/distribute-tokens/page.mdx
- apps/portal/src/app/payments/sidebar.tsx
- apps/portal/src/app/ai/mcp/page.mdx
- apps/portal/src/app/wallets/page.mdx
- apps/portal/src/app/contracts/page.mdx
- apps/portal/src/app/ai/layout.tsx
- apps/portal/src/app/transactions/sponsor/page.mdx
- apps/portal/src/app/transactions/page.mdx
- apps/portal/src/components/Document/AuthMethodsTabs.tsx
🧰 Additional context used
🧠 Learnings (5)
📓 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: Keep documentation focused on developer experience and practical usage
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
apps/portal/redirects.mjs (8)
Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/claim-conditions/shared-claim-conditions-page.tsx:43-49
Timestamp: 2025-05-26T16:31:02.480Z
Learning: In the thirdweb dashboard codebase, when redirectToContractLandingPage()
is called, an explicit return statement is not required afterward because the function internally calls Next.js's redirect()
which throws an error to halt execution.
Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/analytics/shared-analytics-page.tsx:33-39
Timestamp: 2025-05-26T16:30:24.965Z
Learning: In the thirdweb dashboard codebase, redirectToContractLandingPage function already handles execution termination internally (likely using Next.js redirect() which throws an exception), so no explicit return statement is needed after calling it.
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} : Redirect logic using redirect()
from next/navigation
.
Learnt from: jnsdls
PR: #7363
File: apps/wallet-ui/next.config.mjs:58-73
Timestamp: 2025-06-18T02:02:21.427Z
Learning: User jnsdls prefers to explicitly list specific rewrite rules for clarity/documentation purposes, even when they are functionally redundant due to catch-all patterns. In PostHog rewrite configurations, they intentionally keep specific endpoint rules like "/_ph/decide" listed after catch-all rules like "/_ph/:path*" for documentation clarity, accepting the functional redundancy.
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
Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:155-160
Timestamp: 2025-06-10T00:46:58.580Z
Learning: In the dashboard application, the route structure for team and project navigation is /team/[team_slug]/[project_slug]/...
without a /project/
segment. Contract links should be formatted as /team/${teamSlug}/${projectSlug}/contract/${chainId}/${contractAddress}
.
Learnt from: jnsdls
PR: #7363
File: apps/playground-web/next.config.mjs:61-76
Timestamp: 2025-06-18T02:01:37.865Z
Learning: In PostHog migration rewrites, the team prefers to explicitly list the /_ph/decide
rewrite rule even when it may be covered by a catch-all pattern, for configuration clarity and documentation purposes.
Learnt from: MananTank
PR: #7434
File: apps/dashboard/src/app/(app)/team///contract/[chain]/[contractAddress]/components/project-selector.tsx:62-76
Timestamp: 2025-06-24T21:38:03.155Z
Learning: In the project-selector.tsx component for contract imports, the addToProject.mutate() call is intentionally not awaited (fire-and-forget pattern) to allow immediate navigation to the contract page while the import happens in the background. This is a deliberate design choice to prioritize user experience.
apps/portal/src/app/contracts/events/page.mdx (11)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/@/analytics/report.ts : Analytics event name: human-readable <subject> <verb>
(e.g., "contract deployed"); function: report<Subject><Verb>
(PascalCase)
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 : Components that listen to user events, animations or live updates.
Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:170-178
Timestamp: 2025-06-13T13:50:08.622Z
Learning: In event-tracking (useTrack
) calls across the dashboard, the team intentionally keeps contractType
generic as "NFTCollection"
even for ERC-721 drops; contract differentiation is handled via the ercType
field instead.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Event name: human-readable <subject> <verb>
phrase (e.g. "contract deployed").
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
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: MananTank
PR: #7434
File: apps/dashboard/src/app/(app)/team///contract/[chain]/[contractAddress]/components/project-selector.tsx:62-76
Timestamp: 2025-06-24T21:38:03.155Z
Learning: In the project-selector.tsx component for contract imports, the addToProject.mutate() call is intentionally not awaited (fire-and-forget pattern) to allow immediate navigation to the contract page while the import happens in the background. This is a deliberate design choice to prioritize user experience.
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: MananTank
PR: #7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
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.
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The fetchDashboardContractMetadata
function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
apps/portal/src/app/payments/fund/page.mdx (15)
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: 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: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The projectMeta
prop is not required for the server-rendered ContractTokensPage
component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to test/src/test-wallets.ts : Predefined test accounts are in test/src/test-wallets.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/wallets/** : Unified Wallet
and Account
interfaces in wallet architecture
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: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Icons come from lucide-react
or the project-specific …/icons
exports – never embed raw SVG.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Always import from the central UI library under @/components/ui/*
– e.g. import { Button } from "@/components/ui/button"
.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
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} : Import UI primitives from @/components/ui/*
(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: Button
, Input
, Select
, Tabs
, Card
, Sidebar
, Separator
, Badge
.
Learnt from: MananTank
PR: #7434
File: apps/dashboard/src/app/(app)/team///contract/[chain]/[contractAddress]/components/project-selector.tsx:62-76
Timestamp: 2025-06-24T21:38:03.155Z
Learning: In the project-selector.tsx component for contract imports, the addToProject.mutate() call is intentionally not awaited (fire-and-forget pattern) to allow immediate navigation to the contract page while the import happens in the background. This is a deliberate design choice to prioritize user experience.
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/**/*.{tsx,jsx} : For notices & skeletons rely on AnnouncementBanner
, GenericLoadingPage
, EmptyStateCard
.
apps/portal/src/app/payments/transactions/page.mdx (14)
Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The projectMeta
prop is not required for the server-rendered ContractTokensPage
component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
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: MananTank
PR: #7081
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/assets/create/create-token-page-impl.tsx:110-118
Timestamp: 2025-05-20T18:54:15.781Z
Learning: In the thirdweb dashboard's token asset creation flow, the transferBatch
function from thirdweb/extensions/erc20
accepts the raw quantity values from the form without requiring explicit conversion to wei using toUnits()
. The function appears to handle this conversion internally or is designed to work with the values in the format they're already provided.
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: arcoraven
PR: #7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like aria-label
and role
in its TypeScript interface, causing compilation errors when added.
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.
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/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The fetchDashboardContractMetadata
function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
Learnt from: MananTank
PR: #7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:255-277
Timestamp: 2025-06-06T23:47:55.122Z
Learning: The transfer
function from thirdweb/extensions/erc20
accepts human-readable amounts via the amount
property and automatically handles conversion to base units (wei) by fetching the token decimals internally. Manual conversion using toWei()
is not required when using the amount
property.
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenTransfers.ts:41-44
Timestamp: 2025-05-27T19:56:16.920Z
Learning: When reviewing hooks that use environment variables like NEXT_PUBLIC_DASHBOARD_THIRDWEB_CLIENT_ID for API calls, MananTank prefers not to add explicit validation checks for these variables, trusting they will be set in the deployment environment.
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: gregfromstl
PR: #7450
File: packages/thirdweb/src/bridge/Webhook.ts:57-81
Timestamp: 2025-06-26T19:46:04.024Z
Learning: In the onramp webhook schema (packages/thirdweb/src/bridge/Webhook.ts
), the currencyAmount
field is intentionally typed as z.number()
while other amount fields use z.string()
because currencyAmount
represents fiat currency amounts in decimals (like $10.50), whereas other amount fields represent token amounts in wei (very large integers that benefit from bigint representation). The different naming convention (currencyAmount
vs amount
) reflects this intentional distinction.
Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:170-178
Timestamp: 2025-06-13T13:50:08.622Z
Learning: In event-tracking (useTrack
) calls across the dashboard, the team intentionally keeps contractType
generic as "NFTCollection"
even for ERC-721 drops; contract differentiation is handled via the ercType
field instead.
🪛 LanguageTool
apps/portal/src/app/payments/fees/page.mdx
[style] ~11-~11: As a shorter alternative for ‘able to’, consider using “can”.
Context: ... To monetize applications or games, you are able to set a developer fee on each crypto-to-c...
(BE_ABLE_TO)
apps/portal/src/app/payments/fund/page.mdx
[style] ~38-~38: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...List> ### Fund a wallet with the BuyWidget
```tsx i...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
apps/portal/src/app/payments/onramp-providers/page.mdx
[grammar] ~10-~10: Ensure spelling is correct
Context: ...n: "Integrate onramp providers for any onchain transaction and set preferred providers...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
apps/portal/src/app/payments/transactions/page.mdx
[grammar] ~23-~23: Ensure spelling is correct
Context: ....", }); # Pay for Transactions Pay for onchain transactions using any token or fiat wi...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~35-~35: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...List> ### Pay for a transaction with the `Transaction...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🪛 Gitleaks (8.27.2)
apps/portal/src/app/payments/fund/page.mdx
58-58: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🔇 Additional comments (4)
apps/portal/redirects.mjs (1)
344-346
: LGTM! Improved redirect specificity aligns with documentation restructuring.The explicit redirects for
/contracts/deploy/overview
,/contracts/deploy/reference
, and/contracts/deploy/deploy-contract
provide better clarity than a wildcard pattern and support the broader documentation restructuring mentioned in the PR objectives.apps/portal/src/app/contracts/events/page.mdx (1)
1-6
: Verify@doc
alias is recognised by the MDX/Next.js build config
Tabs
,TabsList
, … are usually imported from an explicit path (e.g.@/components/ui/tabs
). If@doc
is not mapped intsconfig.json
/next.config.js
, the page will fail at build-time.apps/portal/src/app/payments/fees/page.mdx (2)
1-2
: Verify alias@doc
and local asset path compile correctlyMDX compilation will fail if the webpack/next-js alias for
@doc
isn’t configured in this folder scope, or if the relative path./assets/fee-dash.png
is not copied during the docs build.
Please double-check:
apps/portal/next.config.*
(or equivalent) contains an alias for@doc
.- The
assets/fee-dash.png
file is co-located with this page or referenced via/public
.
48-48
: Confirm correct reference host (bridge.thirdweb.com
)Other docs in this PR switch from legacy
engine.thirdweb.com
toapi.thirdweb.com
.
Ensurebridge.thirdweb.com
is indeed the canonical endpoint for the transfer API and not an outdated URL.
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 (3)
apps/portal/src/app/payments/transactions/page.mdx (1)
38-66
: Example is still missing required imports & variable definitions
contract
,to
,amount
,USDC_TOKEN_ADDRESS
, and the helpertoUnits
are referenced but never defined or imported, so this snippet will not compile if readers copy-paste it.Suggested minimal fixes:
-import { createThirdwebClient, prepareContractCall } from "thirdweb"; +import { + createThirdwebClient, + prepareContractCall, + getContract, + toUnits, +} from "thirdweb"; + +// Example variables – replace with real values +import { arbitrum } from "thirdweb/chains"; + +const contract = getContract({ + client, + chain: arbitrum, + address: "0xYourContractAddress", +}); + +const to = "0xRecipientAddress"; +const amount = 1; // uint256 +const USDC_TOKEN_ADDRESS = "0x..."; // ERC-20 tokenWithout these additions, readers will face runtime or TS errors.
apps/portal/src/app/payments/fund/page.mdx (1)
13-13
: Remove unusedZapIcon
import
Same issue flagged previously; the symbol is still unused and will fail strict linters/builds.-import { ZapIcon } from "lucide-react";
apps/portal/src/app/contracts/events/page.mdx (1)
141-146
: Same memoisation comment applies to the standard event exampleExtract
transferEvent()
outside the component or wrap withuseMemo
to avoid a new callback per render.
🧹 Nitpick comments (9)
apps/portal/src/app/payments/onramp-providers/page.mdx (1)
9-11
: Clarify description phrasing for concisenessConsider replacing “Integrate onramp providers for any onchain transaction and set preferred providers” with something more concise such as:
- "Integrate onramp providers for any onchain transaction and set preferred providers", + "Integrate on-ramp providers for on-chain transactions and configure your preferred options.",Keeps the description tight and eliminates the duplicate “providers” wording.
apps/portal/src/app/payments/fees/page.mdx (1)
11-12
: Simplify wording“you are able to set a developer fee” → “you can set a developer fee” reads cleaner:
-To monetize applications or games, you are able to set a developer fee on each crypto-to-crypto or swap transaction. +To monetize applications or games, you can set a developer fee on each crypto-to-crypto or swap transaction.apps/portal/src/app/contracts/events/page.mdx (7)
8-11
: Icon semantics – pick a clearer glyph for the HTTP tab
EngineIcon
semantically implies “on-chain engine / server” rather than plain HTTP.
If an explicit HTTP icon (e.g.HttpIcon
) exists alongsideReactIcon
&TypeScriptIcon
, switching will improve visual cognition.
17-31
: Tailwind nested selector&[>p]:mb-0
does nothing inside classNameThe arbitrary variant
&>p:mb-0
is parsed literally because Tailwind treats[
…]:
as a single utility name.
Either remove it or replace with a proper CSS rule inmdx.css
.-<TabsTrigger value="http" className="flex items-center gap-2 [&>p]:mb-0"> +<TabsTrigger value="http" className="flex items-center gap-2">
33-56
: Make the HTTP example copy-pastableThe current snippet omits the protocol and embeds
<chain_id>
in the query string. Including the full URL reduces friction.-GET /v1/contracts/{address}/events?chainId=<chain_id>&decode=true -Host: api.thirdweb.com +GET https://api.thirdweb.com/v1/contracts/{address}/events?chainId=<chain_id>&decode=true + +# Either of the following headers is required: +# x-secret-key: <project-secret-key> # backend +# x-client-id: <client-id> # frontend
58-74
: DefinemyContract
to avoid reader confusionNew users copy examples verbatim. Without an instantiation of
myContract
, TypeScript will error.import { getContract } from "thirdweb"; // add const myContract = await getContract({ // add address: "0x…", chainId: 1, }); // add
90-99
: Clarify<contractId>/<contractAddress>
placeholderMixing two independent identifiers in one placeholder is ambiguous. Spell out each option or show separate commands.
-npx thirdweb generate <contractId>/<contractAddress> +# For contracts published on thirdweb (contractId): +npx thirdweb generate <contractId> + +# For any deployed contract (on-chain address): +npx thirdweb generate <contractAddress>
107-120
: MemoiseprepareEvent
to avoid new event definitions on every renderPlacing
prepareEvent
outside the component or behinduseMemo
prevents unnecessary re-subscriptions.-const myEvent = prepareEvent({ - signature: "event Transfer(address indexed from, address indexed to, uint256 value)", -}); - -function YourComponent() { +const transferEventSig = prepareEvent({ + signature: "event Transfer(address indexed from, address indexed to, uint256 value)", +}); + +function YourComponent() { const { data: contractEvents } = useContractEvents({ contract, - events: [myEvent], + events: [transferEventSig], });
123-156
: Accessibility – surface event data with semantic HTMLLists of dynamic data should use
<ul><li>
for screen-reader friendliness instead of generic<div>
s.-<div> - {contractEvents?.map((event, index) => ( - <div key={index}> - Event: {event.eventName} - </div> - ))} -</div> +<ul className="space-y-1"> + {contractEvents?.map((event, index) => ( + <li key={index} className="text-sm"> + Event: {event.eventName} + </li> + ))} +</ul>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
apps/portal/src/app/payments/fees/assets/fee-dash.png
is excluded by!**/*.png
📒 Files selected for processing (31)
apps/portal/redirects.mjs
(1 hunks)apps/portal/src/app/Header.tsx
(2 hunks)apps/portal/src/app/ai/layout.tsx
(1 hunks)apps/portal/src/app/ai/llm-txt/page.mdx
(1 hunks)apps/portal/src/app/ai/mcp/page.mdx
(1 hunks)apps/portal/src/app/contracts/events/page.mdx
(1 hunks)apps/portal/src/app/contracts/extensions/page.tsx
(1 hunks)apps/portal/src/app/contracts/page.mdx
(2 hunks)apps/portal/src/app/contracts/sidebar.tsx
(3 hunks)apps/portal/src/app/contracts/transactions/page.mdx
(1 hunks)apps/portal/src/app/page.tsx
(1 hunks)apps/portal/src/app/payments/fees/page.mdx
(1 hunks)apps/portal/src/app/payments/fund/page.mdx
(1 hunks)apps/portal/src/app/payments/onramp-providers/page.mdx
(1 hunks)apps/portal/src/app/payments/page.mdx
(3 hunks)apps/portal/src/app/payments/products/page.mdx
(2 hunks)apps/portal/src/app/payments/sidebar.tsx
(2 hunks)apps/portal/src/app/payments/transactions/page.mdx
(1 hunks)apps/portal/src/app/tokens/page.mdx
(0 hunks)apps/portal/src/app/transactions/distribute-tokens/page.mdx
(1 hunks)apps/portal/src/app/transactions/monitor/page.mdx
(1 hunks)apps/portal/src/app/transactions/page.mdx
(1 hunks)apps/portal/src/app/transactions/session-keys/page.mdx
(0 hunks)apps/portal/src/app/transactions/sidebar.tsx
(2 hunks)apps/portal/src/app/transactions/sponsor/page.mdx
(3 hunks)apps/portal/src/app/wallets/page.mdx
(4 hunks)apps/portal/src/app/wallets/server/page.mdx
(1 hunks)apps/portal/src/app/wallets/sidebar.tsx
(3 hunks)apps/portal/src/components/Document/AuthMethodsTabs.tsx
(6 hunks)apps/portal/src/components/others/Sidebar.tsx
(1 hunks)packages/thirdweb/src/wallets/in-app/web/in-app.ts
(1 hunks)
💤 Files with no reviewable changes (2)
- apps/portal/src/app/tokens/page.mdx
- apps/portal/src/app/transactions/session-keys/page.mdx
✅ Files skipped from review due to trivial changes (7)
- apps/portal/src/app/contracts/extensions/page.tsx
- apps/portal/src/app/transactions/sidebar.tsx
- apps/portal/src/app/ai/llm-txt/page.mdx
- apps/portal/src/app/wallets/server/page.mdx
- packages/thirdweb/src/wallets/in-app/web/in-app.ts
- apps/portal/src/app/ai/layout.tsx
- apps/portal/src/app/contracts/transactions/page.mdx
🚧 Files skipped from review as they are similar to previous changes (17)
- apps/portal/src/app/transactions/monitor/page.mdx
- apps/portal/src/components/others/Sidebar.tsx
- apps/portal/redirects.mjs
- apps/portal/src/app/payments/sidebar.tsx
- apps/portal/src/app/contracts/sidebar.tsx
- apps/portal/src/app/payments/products/page.mdx
- apps/portal/src/app/page.tsx
- apps/portal/src/app/wallets/sidebar.tsx
- apps/portal/src/app/transactions/distribute-tokens/page.mdx
- apps/portal/src/app/ai/mcp/page.mdx
- apps/portal/src/app/wallets/page.mdx
- apps/portal/src/app/Header.tsx
- apps/portal/src/app/payments/page.mdx
- apps/portal/src/app/transactions/sponsor/page.mdx
- apps/portal/src/app/transactions/page.mdx
- apps/portal/src/app/contracts/page.mdx
- apps/portal/src/components/Document/AuthMethodsTabs.tsx
🧰 Additional context used
🧠 Learnings (4)
📓 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: Keep documentation focused on developer experience and practical usage
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
apps/portal/src/app/contracts/events/page.mdx (12)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/@/analytics/report.ts : Analytics event name: human-readable <subject> <verb>
(e.g., "contract deployed"); function: report<Subject><Verb>
(PascalCase)
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 : Components that listen to user events, animations or live updates.
Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:170-178
Timestamp: 2025-06-13T13:50:08.622Z
Learning: In event-tracking (useTrack
) calls across the dashboard, the team intentionally keeps contractType
generic as "NFTCollection"
even for ERC-721 drops; contract differentiation is handled via the ercType
field instead.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Event name: human-readable <subject> <verb>
phrase (e.g. "contract deployed").
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
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: MananTank
PR: #7434
File: apps/dashboard/src/app/(app)/team///contract/[chain]/[contractAddress]/components/project-selector.tsx:62-76
Timestamp: 2025-06-24T21:38:03.155Z
Learning: In the project-selector.tsx component for contract imports, the addToProject.mutate() call is intentionally not awaited (fire-and-forget pattern) to allow immediate navigation to the contract page while the import happens in the background. This is a deliberate design choice to prioritize user experience.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Keep documentation focused on developer experience and practical usage
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: 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.
Learnt from: MananTank
PR: #7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The fetchDashboardContractMetadata
function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
apps/portal/src/app/payments/fund/page.mdx (15)
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: 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: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The projectMeta
prop is not required for the server-rendered ContractTokensPage
component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to test/src/test-wallets.ts : Predefined test accounts are in test/src/test-wallets.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/wallets/** : Unified Wallet
and Account
interfaces in wallet architecture
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: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Icons come from lucide-react
or the project-specific …/icons
exports – never embed raw SVG.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Always import from the central UI library under @/components/ui/*
– e.g. import { Button } from "@/components/ui/button"
.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
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} : Import UI primitives from @/components/ui/*
(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: Button
, Input
, Select
, Tabs
, Card
, Sidebar
, Separator
, Badge
.
Learnt from: MananTank
PR: #7434
File: apps/dashboard/src/app/(app)/team///contract/[chain]/[contractAddress]/components/project-selector.tsx:62-76
Timestamp: 2025-06-24T21:38:03.155Z
Learning: In the project-selector.tsx component for contract imports, the addToProject.mutate() call is intentionally not awaited (fire-and-forget pattern) to allow immediate navigation to the contract page while the import happens in the background. This is a deliberate design choice to prioritize user experience.
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/**/*.{tsx,jsx} : For notices & skeletons rely on AnnouncementBanner
, GenericLoadingPage
, EmptyStateCard
.
apps/portal/src/app/payments/transactions/page.mdx (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/**/*client.tsx : Interactive UI that relies on hooks (useState
, useEffect
, React Query, wallet hooks).
Learnt from: MananTank
PR: #7081
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/assets/create/create-token-page-impl.tsx:110-118
Timestamp: 2025-05-20T18:54:15.781Z
Learning: In the thirdweb dashboard's token asset creation flow, the transferBatch
function from thirdweb/extensions/erc20
accepts the raw quantity values from the form without requiring explicit conversion to wei using toUnits()
. The function appears to handle this conversion internally or is designed to work with the values in the format they're already provided.
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: arcoraven
PR: #7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like aria-label
and role
in its TypeScript interface, causing compilation errors when added.
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.
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/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The fetchDashboardContractMetadata
function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
Learnt from: MananTank
PR: #7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:255-277
Timestamp: 2025-06-06T23:47:55.122Z
Learning: The transfer
function from thirdweb/extensions/erc20
accepts human-readable amounts via the amount
property and automatically handles conversion to base units (wei) by fetching the token decimals internally. Manual conversion using toWei()
is not required when using the amount
property.
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_hooks/useTokenTransfers.ts:41-44
Timestamp: 2025-05-27T19:56:16.920Z
Learning: When reviewing hooks that use environment variables like NEXT_PUBLIC_DASHBOARD_THIRDWEB_CLIENT_ID for API calls, MananTank prefers not to add explicit validation checks for these variables, trusting they will be set in the deployment environment.
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: gregfromstl
PR: #7450
File: packages/thirdweb/src/bridge/Webhook.ts:57-81
Timestamp: 2025-06-26T19:46:04.024Z
Learning: In the onramp webhook schema (packages/thirdweb/src/bridge/Webhook.ts
), the currencyAmount
field is intentionally typed as z.number()
while other amount fields use z.string()
because currencyAmount
represents fiat currency amounts in decimals (like $10.50), whereas other amount fields represent token amounts in wei (very large integers that benefit from bigint representation). The different naming convention (currencyAmount
vs amount
) reflects this intentional distinction.
Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:170-178
Timestamp: 2025-06-13T13:50:08.622Z
Learning: In event-tracking (useTrack
) calls across the dashboard, the team intentionally keeps contractType
generic as "NFTCollection"
even for ERC-721 drops; contract differentiation is handled via the ercType
field instead.
🪛 LanguageTool
apps/portal/src/app/payments/fees/page.mdx
[style] ~11-~11: As a shorter alternative for ‘able to’, consider using “can”.
Context: ... To monetize applications or games, you are able to set a developer fee on each crypto-to-c...
(BE_ABLE_TO)
apps/portal/src/app/payments/fund/page.mdx
[style] ~38-~38: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...List> ### Fund a wallet with the BuyWidget
```tsx i...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
apps/portal/src/app/payments/onramp-providers/page.mdx
[grammar] ~10-~10: Ensure spelling is correct
Context: ...n: "Integrate onramp providers for any onchain transaction and set preferred providers...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
apps/portal/src/app/payments/transactions/page.mdx
[grammar] ~23-~23: Ensure spelling is correct
Context: ....", }); # Pay for Transactions Pay for onchain transactions using any token or fiat wi...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~35-~35: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...List> ### Pay for a transaction with the `Transaction...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🪛 Gitleaks (8.27.2)
apps/portal/src/app/payments/fund/page.mdx
58-58: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Size
- GitHub Check: Unit Tests
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/portal/src/app/contracts/events/page.mdx (1)
1-6
: Verify module alias@doc
– likely unresolved in portal packagePrevious portal pages import the same
Tabs
primitives from@/components/ui/tabs
(or a similar relative alias), not@doc
.
Please confirm that@doc
is configured intsconfig.json
/webpack
aliases; otherwise this page will fail to compile in CI.-import { - Tabs, - TabsList, - TabsTrigger, - TabsContent, -} from "@doc"; +import { + Tabs, + TabsList, + TabsTrigger, + TabsContent, +} from "@/components/ui/tabs";
4ab4b8a
to
1813066
Compare
1813066
to
25a3b4e
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 (2)
apps/portal/src/app/payments/transactions/page.mdx (1)
65-72
: Undefined variables still referenced in example
to
,amount
, andUSDC_TOKEN_ADDRESS
are used inargs
anderc20Value
but are never defined, so the snippet will not compile.import { arbitrum } from "thirdweb/chains"; import { toUnits } from "thirdweb/utils"; +// 👉 add the missing definitions +const to = "0x..."; // recipient address +const amount = 1; // mint amount +const USDC_TOKEN_ADDRESS = "0x..."; // USDC on Arbitrum + const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID", });apps/portal/src/app/payments/fund/page.mdx (1)
13-13
: Remove unusedZapIcon
import
ZapIcon
isn’t used anywhere in the page and will trip the unused-import linter.-import { ZapIcon } from "lucide-react";
🧹 Nitpick comments (2)
apps/portal/src/app/payments/fund/page.mdx (1)
1-9
:Callout
imported but not used
Callout
is imported yet never rendered in the MDX; consider dropping the import to keep the bundle lean.-import { - Callout, - createMetadata, - Tabs, +import { + createMetadata, + Tabs,apps/portal/src/app/payments/fees/page.mdx (1)
11-12
: Minor wording tweak for conciseness“you are able to set a developer fee” → “you can set a developer fee”
-To monetize applications or games, you are able to set a developer fee on each +To monetize applications or games, you can set a developer fee on each
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
apps/portal/src/app/payments/fees/assets/fee-dash.png
is excluded by!**/*.png
📒 Files selected for processing (31)
apps/portal/redirects.mjs
(1 hunks)apps/portal/src/app/Header.tsx
(2 hunks)apps/portal/src/app/ai/layout.tsx
(1 hunks)apps/portal/src/app/ai/llm-txt/page.mdx
(1 hunks)apps/portal/src/app/ai/mcp/page.mdx
(1 hunks)apps/portal/src/app/contracts/events/page.mdx
(1 hunks)apps/portal/src/app/contracts/extensions/page.tsx
(1 hunks)apps/portal/src/app/contracts/page.mdx
(2 hunks)apps/portal/src/app/contracts/sidebar.tsx
(3 hunks)apps/portal/src/app/contracts/transactions/page.mdx
(1 hunks)apps/portal/src/app/page.tsx
(1 hunks)apps/portal/src/app/payments/fees/page.mdx
(1 hunks)apps/portal/src/app/payments/fund/page.mdx
(1 hunks)apps/portal/src/app/payments/onramp-providers/page.mdx
(1 hunks)apps/portal/src/app/payments/page.mdx
(3 hunks)apps/portal/src/app/payments/products/page.mdx
(2 hunks)apps/portal/src/app/payments/sidebar.tsx
(2 hunks)apps/portal/src/app/payments/transactions/page.mdx
(1 hunks)apps/portal/src/app/tokens/page.mdx
(0 hunks)apps/portal/src/app/transactions/distribute-tokens/page.mdx
(1 hunks)apps/portal/src/app/transactions/monitor/page.mdx
(1 hunks)apps/portal/src/app/transactions/page.mdx
(1 hunks)apps/portal/src/app/transactions/session-keys/page.mdx
(0 hunks)apps/portal/src/app/transactions/sidebar.tsx
(2 hunks)apps/portal/src/app/transactions/sponsor/page.mdx
(3 hunks)apps/portal/src/app/wallets/page.mdx
(4 hunks)apps/portal/src/app/wallets/server/page.mdx
(1 hunks)apps/portal/src/app/wallets/sidebar.tsx
(3 hunks)apps/portal/src/components/Document/AuthMethodsTabs.tsx
(6 hunks)apps/portal/src/components/others/Sidebar.tsx
(1 hunks)packages/thirdweb/src/wallets/in-app/web/in-app.ts
(1 hunks)
💤 Files with no reviewable changes (2)
- apps/portal/src/app/tokens/page.mdx
- apps/portal/src/app/transactions/session-keys/page.mdx
✅ Files skipped from review due to trivial changes (6)
- apps/portal/src/app/contracts/extensions/page.tsx
- apps/portal/src/app/transactions/sidebar.tsx
- apps/portal/src/app/payments/onramp-providers/page.mdx
- apps/portal/src/app/ai/llm-txt/page.mdx
- packages/thirdweb/src/wallets/in-app/web/in-app.ts
- apps/portal/src/app/ai/layout.tsx
🚧 Files skipped from review as they are similar to previous changes (20)
- apps/portal/src/app/page.tsx
- apps/portal/src/app/payments/products/page.mdx
- apps/portal/src/app/wallets/sidebar.tsx
- apps/portal/src/app/transactions/distribute-tokens/page.mdx
- apps/portal/src/app/contracts/transactions/page.mdx
- apps/portal/src/app/transactions/monitor/page.mdx
- apps/portal/src/app/contracts/sidebar.tsx
- apps/portal/src/app/ai/mcp/page.mdx
- apps/portal/src/app/payments/page.mdx
- apps/portal/src/components/others/Sidebar.tsx
- apps/portal/src/app/wallets/server/page.mdx
- apps/portal/src/app/contracts/page.mdx
- apps/portal/src/app/wallets/page.mdx
- apps/portal/src/app/transactions/sponsor/page.mdx
- apps/portal/redirects.mjs
- apps/portal/src/app/Header.tsx
- apps/portal/src/app/contracts/events/page.mdx
- apps/portal/src/app/payments/sidebar.tsx
- apps/portal/src/app/transactions/page.mdx
- apps/portal/src/components/Document/AuthMethodsTabs.tsx
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Keep documentation focused on developer experience and practical usage
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
apps/portal/src/app/payments/fund/page.mdx (15)
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: 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: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The projectMeta
prop is not required for the server-rendered ContractTokensPage
component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
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/** : Support for in-app wallets (social/email login)
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
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to test/src/test-wallets.ts : Predefined test accounts are in test/src/test-wallets.ts
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: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Icons come from lucide-react
or the project-specific …/icons
exports – never embed raw SVG.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Always import from the central UI library under @/components/ui/*
– e.g. import { Button } from "@/components/ui/button"
.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
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} : Import UI primitives from @/components/ui/*
(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: Button
, Input
, Select
, Tabs
, Card
, Sidebar
, Separator
, Badge
.
Learnt from: MananTank
PR: #7434
File: apps/dashboard/src/app/(app)/team///contract/[chain]/[contractAddress]/components/project-selector.tsx:62-76
Timestamp: 2025-06-24T21:38:03.155Z
Learning: In the project-selector.tsx component for contract imports, the addToProject.mutate() call is intentionally not awaited (fire-and-forget pattern) to allow immediate navigation to the contract page while the import happens in the background. This is a deliberate design choice to prioritize user experience.
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/**/*.{tsx,jsx} : For notices & skeletons rely on AnnouncementBanner
, GenericLoadingPage
, EmptyStateCard
.
apps/portal/src/app/payments/transactions/page.mdx (13)
Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The projectMeta
prop is not required for the server-rendered ContractTokensPage
component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
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: MananTank
PR: #7081
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/assets/create/create-token-page-impl.tsx:110-118
Timestamp: 2025-05-20T18:54:15.781Z
Learning: In the thirdweb dashboard's token asset creation flow, the transferBatch
function from thirdweb/extensions/erc20
accepts the raw quantity values from the form without requiring explicit conversion to wei using toUnits()
. The function appears to handle this conversion internally or is designed to work with the values in the format they're already provided.
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: arcoraven
PR: #7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like aria-label
and role
in its TypeScript interface, causing compilation errors when added.
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.
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/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The fetchDashboardContractMetadata
function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
Learnt from: MananTank
PR: #7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:255-277
Timestamp: 2025-06-06T23:47:55.122Z
Learning: The transfer
function from thirdweb/extensions/erc20
accepts human-readable amounts via the amount
property and automatically handles conversion to base units (wei) by fetching the token decimals internally. Manual conversion using toWei()
is not required when using the amount
property.
Learnt from: gregfromstl
PR: #7450
File: packages/thirdweb/src/bridge/Webhook.ts:57-81
Timestamp: 2025-06-26T19:46:04.024Z
Learning: In the onramp webhook schema (packages/thirdweb/src/bridge/Webhook.ts
), the currencyAmount
field is intentionally typed as z.number()
while other amount fields use z.string()
because currencyAmount
represents fiat currency amounts in decimals (like $10.50), whereas other amount fields represent token amounts in wei (very large integers that benefit from bigint representation). The different naming convention (currencyAmount
vs amount
) reflects this intentional distinction.
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: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:170-178
Timestamp: 2025-06-13T13:50:08.622Z
Learning: In event-tracking (useTrack
) calls across the dashboard, the team intentionally keeps contractType
generic as "NFTCollection"
even for ERC-721 drops; contract differentiation is handled via the ercType
field instead.
🪛 LanguageTool
apps/portal/src/app/payments/fees/page.mdx
[style] ~11-~11: As a shorter alternative for ‘able to’, consider using “can”.
Context: ... To monetize applications or games, you are able to set a developer fee on each crypto-to-c...
(BE_ABLE_TO)
apps/portal/src/app/payments/fund/page.mdx
[style] ~38-~38: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...List> ### Fund a wallet with the BuyWidget
```tsx i...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
apps/portal/src/app/payments/transactions/page.mdx
[grammar] ~23-~23: Ensure spelling is correct
Context: ....", }); # Pay for Transactions Pay for onchain transactions using any token or fiat wi...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~35-~35: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...List> ### Pay for a transaction with the `Transaction...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
⏰ 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). (4)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Build Packages
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/portal/src/app/payments/transactions/page.mdx (1)
69-72
: 👍 Correct casing (erc20Value
)The property name was previously mis-cased; the example now uses the correct
erc20Value
field expected by the SDK.
25a3b4e
to
ba81000
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: 1
♻️ Duplicate comments (2)
apps/portal/src/app/payments/transactions/page.mdx (1)
59-72
: Example breaks:to
,amount
, andUSDC_TOKEN_ADDRESS
are undefinedThe snippet will not compile/run as-is and may confuse readers. Add placeholder definitions right after the
contract
constant (or inline suitable literals) so the widget example is copy-pastable.const contract = getContract({ client, address: "0x...", // the target contract address chain: arbitrum, }); +// --- demo inputs ---------------------------------------------------------- +const to = "0x..."; // recipient address +const amount = 1; // mint amount +const USDC_TOKEN_ADDRESS = "0x..."; // USDC token address on Arbitrum +// -------------------------------------------------------------------------apps/portal/src/app/payments/fund/page.mdx (1)
10-14
: Remove unusedZapIcon
import to avoid MDX build failure
ZapIcon
isn’t referenced anywhere in this file; unused imports typically fail the TS/MDX build & lint.-import { ZapIcon } from "lucide-react";
🧹 Nitpick comments (4)
apps/portal/src/app/payments/fees/page.mdx (1)
11-12
: Nit: streamline wording“you are able to set” → “you can set” for conciseness.
-To monetize applications or games, you are able to set a developer fee +To monetize applications or games, you can set a developer feeapps/portal/src/app/payments/onramp-providers/page.mdx (3)
10-11
: Tighten wording & fix “on-chain” spelling in metadata descriptionUsing the industry-standard hyphenated “on-chain” improves clarity, and re-ordering the sentence reads more naturally.
- "Integrate onramp providers for any onchain transaction and set preferred providers", + "Integrate on-chain onramp providers for any transaction and set preferred providers",
27-29
: Remove stray period from Stripe fees link for URL consistencyThe trailing “.” is outside the Markdown link but inside the table cell, resulting in an inconsistent visual artefact and potential copy-paste confusion.
-| Stripe | [Learn more about Stripe Fees](https://stripe.com/legal/crypto-onramp). | +| Stripe | [Learn more about Stripe Fees](https://stripe.com/legal/crypto-onramp) |
15-20
: Optional: link provider names directly for faster navigationSince the rest of the page already provides external links, hyperlinking the three provider names here would streamline the reader’s flow.
Example:- **Coinbase** + **[Coinbase](https://coinbase.com)**
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
apps/portal/src/app/payments/fees/assets/fee-dash.png
is excluded by!**/*.png
📒 Files selected for processing (32)
apps/portal/redirects.mjs
(1 hunks)apps/portal/src/app/Header.tsx
(4 hunks)apps/portal/src/app/ai/layout.tsx
(1 hunks)apps/portal/src/app/ai/llm-txt/page.mdx
(1 hunks)apps/portal/src/app/ai/mcp/page.mdx
(1 hunks)apps/portal/src/app/contracts/events/page.mdx
(1 hunks)apps/portal/src/app/contracts/extensions/page.tsx
(1 hunks)apps/portal/src/app/contracts/page.mdx
(2 hunks)apps/portal/src/app/contracts/sidebar.tsx
(3 hunks)apps/portal/src/app/contracts/transactions/page.mdx
(1 hunks)apps/portal/src/app/page.tsx
(1 hunks)apps/portal/src/app/payments/fees/page.mdx
(1 hunks)apps/portal/src/app/payments/fund/page.mdx
(1 hunks)apps/portal/src/app/payments/onramp-providers/page.mdx
(1 hunks)apps/portal/src/app/payments/page.mdx
(3 hunks)apps/portal/src/app/payments/products/page.mdx
(2 hunks)apps/portal/src/app/payments/sidebar.tsx
(2 hunks)apps/portal/src/app/payments/transactions/page.mdx
(1 hunks)apps/portal/src/app/tokens/page.mdx
(0 hunks)apps/portal/src/app/transactions/distribute-tokens/page.mdx
(1 hunks)apps/portal/src/app/transactions/monitor/page.mdx
(1 hunks)apps/portal/src/app/transactions/page.mdx
(1 hunks)apps/portal/src/app/transactions/session-keys/page.mdx
(0 hunks)apps/portal/src/app/transactions/sidebar.tsx
(2 hunks)apps/portal/src/app/transactions/sponsor/page.mdx
(3 hunks)apps/portal/src/app/wallets/get-users/page.mdx
(7 hunks)apps/portal/src/app/wallets/page.mdx
(4 hunks)apps/portal/src/app/wallets/server/page.mdx
(1 hunks)apps/portal/src/app/wallets/sidebar.tsx
(3 hunks)apps/portal/src/components/Document/AuthMethodsTabs.tsx
(6 hunks)apps/portal/src/components/others/Sidebar.tsx
(1 hunks)packages/thirdweb/src/wallets/in-app/web/in-app.ts
(1 hunks)
💤 Files with no reviewable changes (2)
- apps/portal/src/app/tokens/page.mdx
- apps/portal/src/app/transactions/session-keys/page.mdx
✅ Files skipped from review due to trivial changes (6)
- apps/portal/src/app/ai/llm-txt/page.mdx
- apps/portal/src/app/transactions/sidebar.tsx
- apps/portal/src/app/contracts/extensions/page.tsx
- apps/portal/src/app/Header.tsx
- packages/thirdweb/src/wallets/in-app/web/in-app.ts
- apps/portal/src/app/ai/mcp/page.mdx
🚧 Files skipped from review as they are similar to previous changes (18)
- apps/portal/src/components/others/Sidebar.tsx
- apps/portal/src/app/payments/products/page.mdx
- apps/portal/src/app/payments/sidebar.tsx
- apps/portal/src/app/page.tsx
- apps/portal/src/app/transactions/distribute-tokens/page.mdx
- apps/portal/src/app/contracts/transactions/page.mdx
- apps/portal/src/app/transactions/monitor/page.mdx
- apps/portal/src/app/wallets/sidebar.tsx
- apps/portal/src/app/payments/page.mdx
- apps/portal/src/app/wallets/server/page.mdx
- apps/portal/src/app/contracts/sidebar.tsx
- apps/portal/redirects.mjs
- apps/portal/src/app/contracts/events/page.mdx
- apps/portal/src/app/ai/layout.tsx
- apps/portal/src/app/transactions/page.mdx
- apps/portal/src/app/wallets/page.mdx
- apps/portal/src/app/transactions/sponsor/page.mdx
- apps/portal/src/app/contracts/page.mdx
🧰 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:
apps/portal/src/components/Document/AuthMethodsTabs.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/portal/src/components/Document/AuthMethodsTabs.tsx
🧠 Learnings (5)
📓 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: Keep documentation focused on developer experience and practical usage
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
apps/portal/src/app/wallets/get-users/page.mdx (16)
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/** : Support for in-app wallets (social/email login)
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
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: 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 test/src/test-wallets.ts : Predefined test accounts are in test/src/test-wallets.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/wallets/** : Smart wallets with account abstraction
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Icons come from lucide-react
or the project-specific …/icons
exports – never embed raw SVG.
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The fetchDashboardContractMetadata
function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
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} : Use design system tokens (e.g., bg-card
, border-border
, text-muted-foreground
)
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: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The projectMeta
prop is not required for the server-rendered ContractTokensPage
component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
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: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{ts,tsx} : Heavy data fetching that should not ship to the client (e.g. analytics, billing).
Learnt from: arcoraven
PR: #7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like aria-label
and role
in its TypeScript interface, causing compilation errors when added.
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
.
apps/portal/src/components/Document/AuthMethodsTabs.tsx (21)
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: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Import UI primitives from @/components/ui/*
(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
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 design system tokens (e.g., bg-card
, border-border
, text-muted-foreground
)
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: .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} : 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/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: Button
, Input
, Select
, Tabs
, Card
, Sidebar
, Separator
, Badge
.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Icons come from lucide-react
or the project-specific …/icons
exports – never embed raw SVG.
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: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Always import from the central UI library under @/components/ui/*
– e.g. import { Button } from "@/components/ui/button"
.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Use NavLink
(@/components/ui/NavLink
) for internal navigation so active states are handled automatically.
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 NavLink
for internal navigation with automatic active states in dashboard and playground apps
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : For notices & skeletons rely on AnnouncementBanner
, GenericLoadingPage
, EmptyStateCard
.
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: .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} : Use cn()
from @/lib/utils
for conditional class logic
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx} : Expose className
prop on root element of components for overrides
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} : Client Components (browser): Begin files with 'use client';
apps/portal/src/app/payments/fund/page.mdx (15)
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: 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: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The projectMeta
prop is not required for the server-rendered ContractTokensPage
component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
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/** : Support for in-app wallets (social/email login)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to test/src/test-wallets.ts : Predefined test accounts are in test/src/test-wallets.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/wallets/** : Unified Wallet
and Account
interfaces in wallet architecture
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: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Icons come from lucide-react
or the project-specific …/icons
exports – never embed raw SVG.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Always import from the central UI library under @/components/ui/*
– e.g. import { Button } from "@/components/ui/button"
.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
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} : Import UI primitives from @/components/ui/*
(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: Button
, Input
, Select
, Tabs
, Card
, Sidebar
, Separator
, Badge
.
Learnt from: MananTank
PR: #7434
File: apps/dashboard/src/app/(app)/team///contract/[chain]/[contractAddress]/components/project-selector.tsx:62-76
Timestamp: 2025-06-24T21:38:03.155Z
Learning: In the project-selector.tsx component for contract imports, the addToProject.mutate() call is intentionally not awaited (fire-and-forget pattern) to allow immediate navigation to the contract page while the import happens in the background. This is a deliberate design choice to prioritize user experience.
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/**/*.{tsx,jsx} : For notices & skeletons rely on AnnouncementBanner
, GenericLoadingPage
, EmptyStateCard
.
apps/portal/src/app/payments/transactions/page.mdx (13)
Learnt from: MananTank
PR: #7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The projectMeta
prop is not required for the server-rendered ContractTokensPage
component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
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: MananTank
PR: #7081
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/assets/create/create-token-page-impl.tsx:110-118
Timestamp: 2025-05-20T18:54:15.781Z
Learning: In the thirdweb dashboard's token asset creation flow, the transferBatch
function from thirdweb/extensions/erc20
accepts the raw quantity values from the form without requiring explicit conversion to wei using toUnits()
. The function appears to handle this conversion internally or is designed to work with the values in the format they're already provided.
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: arcoraven
PR: #7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like aria-label
and role
in its TypeScript interface, causing compilation errors when added.
Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">
, they inherit the client prop without needing to add it explicitly.
Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.
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: #7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:255-277
Timestamp: 2025-06-06T23:47:55.122Z
Learning: The transfer
function from thirdweb/extensions/erc20
accepts human-readable amounts via the amount
property and automatically handles conversion to base units (wei) by fetching the token decimals internally. Manual conversion using toWei()
is not required when using the amount
property.
Learnt from: MananTank
PR: #7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The fetchDashboardContractMetadata
function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
Learnt from: gregfromstl
PR: #7450
File: packages/thirdweb/src/bridge/Webhook.ts:57-81
Timestamp: 2025-06-26T19:46:04.024Z
Learning: In the onramp webhook schema (packages/thirdweb/src/bridge/Webhook.ts
), the currencyAmount
field is intentionally typed as z.number()
while other amount fields use z.string()
because currencyAmount
represents fiat currency amounts in decimals (like $10.50), whereas other amount fields represent token amounts in wei (very large integers that benefit from bigint representation). The different naming convention (currencyAmount
vs amount
) reflects this intentional distinction.
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: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:170-178
Timestamp: 2025-06-13T13:50:08.622Z
Learning: In event-tracking (useTrack
) calls across the dashboard, the team intentionally keeps contractType
generic as "NFTCollection"
even for ERC-721 drops; contract differentiation is handled via the ercType
field instead.
🪛 LanguageTool
apps/portal/src/app/payments/fees/page.mdx
[style] ~11-~11: As a shorter alternative for ‘able to’, consider using “can”.
Context: ... To monetize applications or games, you are able to set a developer fee on each crypto-to-c...
(BE_ABLE_TO)
apps/portal/src/app/payments/fund/page.mdx
[style] ~38-~38: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...List> ### Fund a wallet with the BuyWidget
```tsx i...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
apps/portal/src/app/payments/onramp-providers/page.mdx
[grammar] ~10-~10: Ensure spelling is correct
Context: ...n: "Integrate onramp providers for any onchain transaction and set preferred providers...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
apps/portal/src/app/payments/transactions/page.mdx
[grammar] ~23-~23: Ensure spelling is correct
Context: ....", }); # Pay for Transactions Pay for onchain transactions using any token or fiat wi...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~35-~35: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...List> ### Pay for a transaction with the `Transaction...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Size
- GitHub Check: Build Packages
- GitHub Check: Unit Tests
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (20)
apps/portal/src/app/payments/onramp-providers/page.mdx (1)
1-40
: Overall content LGTMNo functional issues detected; tables render correctly and metadata matches other payments pages. Nice addition!
apps/portal/src/components/Document/AuthMethodsTabs.tsx (10)
11-11
: LGTM: Icon import follows established patterns.The EngineIcon import is appropriate for representing HTTP/API functionality and follows the project's icon importing conventions.
38-38
: LGTM: Platform type extension is correct.Adding "http" to the Platform union type properly enables HTTP platform support.
72-84
: LGTM: Well-structured platform configuration.The refactoring from static platform list to a centralized
allPlatforms
array improves maintainability and follows TypeScript best practices with explicit typing.
86-94
: LGTM: Clear and logical platform filtering.The function properly implements the business rule that HTTP examples are only relevant for email/phone authentication methods that require OTP verification flows.
96-118
: LGTM: Well-implemented support for multiple code snippets.The refactoring to return
string[]
enables multiple code blocks per platform, which is essential for HTTP authentication flows that require separate "send code" and "verify code" examples. The implementation correctly wraps existing single snippets in arrays for consistency.
822-822
: LGTM: Proper integration of dynamic platform filtering.Using the filtered platform list ensures only relevant platforms are shown for each authentication method.
861-861
: LGTM: Robust default value selection.The defaultValue logic properly handles the dynamic platform list with a sensible fallback to "typescript" if no platforms are available.
894-913
: LGTM: Proper handling of multiple code snippets.The implementation correctly maps over multiple code snippets and dynamically determines the appropriate syntax highlighting language. The biome-ignore for array index key is acceptable since the snippets array is stable within each render cycle.
828-828
: LGTM: Improved styling and visual consistency.The styling updates enhance visual consistency by:
- Using
text-foreground
classes for proper theme contrast- Implementing violet brand colors for active states
- Improving button structure and typography
These changes follow the design system patterns and improve the overall user experience.
Also applies to: 838-842, 850-850, 858-860
120-177
: Documentation snippets validatedThe
/v1/wallets/user/code
and/v1/wallets/user/code/verify
URLs match the in-app OTP implementation (see packages/thirdweb/src/wallets/in-app/web/lib/auth/otp.ts), thex-client-id
header is the correct front-end authentication method, and the two-step flow (send code → verify code → receive JWT) aligns with the current API behavior. No updates needed.apps/portal/src/app/wallets/get-users/page.mdx (9)
7-12
: LGTM: Appropriate metadata configuration.The metadata updates follow standard patterns and properly describe the page's purpose with appropriate icon and description.
39-45
: LGTM: Improved API parameter structure.The simplification from
queryBy
to direct parameters (address, email, phone) makes the API more intuitive and user-friendly. The parameter renaming fromwalletAddress
toaddress
is also cleaner.
61-61
: LGTM: Consistent curl command updates.The curl commands properly demonstrate usage of the new
api.thirdweb.com
endpoints and maintain consistency with the API changes.Also applies to: 69-69, 76-76
119-119
: LGTM: Updated API reference link.The reference link update to the new API domain maintains consistency with the endpoint changes.
126-131
: LGTM: Updated SDK reference configuration.The article card configuration properly reflects the updated documentation structure and maintains proper linking.
143-146
: LGTM: Consistent multi-user endpoint update.The multi-user endpoint follows the same patterns as the single user endpoint with proper Host header usage and improved pagination parameters (page/limit vs offset/limit).
Also applies to: 150-151
171-171
: LGTM: Consistent curl command for multi-user endpoint.The curl command properly demonstrates the new endpoint usage with updated pagination parameters.
181-204
: LGTM: Consistent response format documentation.The multi-user response format properly matches the single user format with the same nested structure and pagination metadata.
31-35
: Confirm API endpoint & authentication detailsBased on a quick scan of our docs:
- The
x-secret-key
header is indeed referenced in packages/api/README.md for server-side calls.- Our SDK was autogenerated from the OpenAPI spec at https://api.thirdweb.com/reference.
- I didn’t find any other HTTP examples in the codebase that include a
Host
header—please verify this format is supported by the API.- Double-check that
GET /v1/wallets/user?email=…
is the exact path (and thatPlease confirm these details against the official API reference.
{ | ||
"result": { | ||
"pagination": { | ||
"hasMore": false, | ||
"limit": 50, | ||
"page": 1 | ||
}, | ||
"wallets": [ | ||
{ | ||
"address": "0x3aA70e68BBA8BC922a75d07388e368892c15c9Da", | ||
"createdAt": "2025-07-21T22:58:12.834Z", | ||
"profiles": [ | ||
{ | ||
"id": "107302390467834615186", | ||
"name": "Richard Hendricks", | ||
"type": "google", | ||
"email": "richard@piedpiper.com", | ||
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKC1D6ezzzaZxxUk4qtK_HCwVwpNamVopazXwklGBwuuHeSf_c=s96-c", | ||
"givenName": "Richard", | ||
"emailVerified": true | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
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.
💡 Verification agent
❓ Verification inconclusive
Breaking API change requires migration guidance.
The response format has been completely restructured from a simple array to a nested object with pagination metadata and detailed profile information. While this provides much richer data and better scalability, it's a significant breaking change.
Consider adding:
- A migration guide or changelog reference
- Version information indicating when this change was introduced
- Backward compatibility notes if applicable
Based on retrieved learnings about surfacing breaking changes prominently, this should be clearly documented as a breaking change in the PR description or changelog.
Document Breaking API Change in PR & Changelog
The updated example response in apps/portal/src/app/wallets/get-users/page.mdx (lines 91–116) now returns a nested result
object with pagination metadata and rich profiles
instead of a flat wallets array. This is a breaking change and must be surfaced clearly:
• Update the PR description to call out this breaking change.
• Add or update your CHANGELOG.md (or migration guide) with version information and step-by-step migration instructions.
• Include backward compatibility notes or fallback guidance if you plan to support existing clients.
🤖 Prompt for AI Agents
In apps/portal/src/app/wallets/get-users/page.mdx around lines 91 to 116, the
example API response structure has changed to include a nested `result` object
with pagination and detailed `profiles`, which is a breaking change. Update the
PR description to explicitly mention this breaking change, add or update the
CHANGELOG.md with version details and migration steps, and provide notes on
backward compatibility or fallback options for existing clients.
PR-Codex overview
This PR primarily focuses on enhancing the documentation and functionality of the
thirdweb
platform, particularly around payments, transactions, and wallet interactions. It includes updates to API references, new features, and improved code snippets for better usability.Detailed summary
https://engine.thirdweb.com
tohttps://api.thirdweb.com
.BuyWidget
,TransactionWidget
, andCheckoutWidget
.Onramp Providers
andFund Wallet
pages.Summary by CodeRabbit