-
Notifications
You must be signed in to change notification settings - Fork 624
[SDK] Add Monad chain definition #8465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: c720f7f The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughAdds a Monad chain definition and export, introduces two changesets, preserves wallet context during 402 retry, makes the sign-in-required modal customizable via new options/props, and allows useInvalidateBalances' returned callback to be called without arguments by adding a default parameter. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App
participant Hook as useFetchWithPayment
participant Core as useFetchWithPaymentCore
participant Modal as SignInRequiredModal
participant Wallet as ConnectWallet
participant Server
Note over Hook,Core: Fetch with payment flow
App->>Hook: trigger fetchWithPayment(...)
Hook->>Core: executeFetch(...)
Core->>Server: request
alt payment required (402)
Server-->>Core: 402 PaymentRequired
Core->>Hook: onPaymentRequired
Hook->>Modal: show SignInRequiredModal (title/desc/buttonLabel)
Modal-->>Hook: onSignIn
Hook->>Wallet: open ConnectWallet
Wallet-->>Hook: walletSelected
Hook->>Core: executeFetch(currentWallet) %% preserve wallet across retry %%
Core->>Server: request (with wallet)
Server-->>Core: 200 OK
Core-->>Hook: result
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/thirdweb/src/chains/chain-definitions/monad.ts (1)
19-19: Optional: Align native currency name with chain/token brandingRight now the native currency is
{ decimals: 18, name: "Mon", symbol: "MON" }. For consistency and clearer UX, you might consider naming it"Monad"to match the symbol and chain name:- nativeCurrency: { decimals: 18, name: "Mon", symbol: "MON" }, + nativeCurrency: { decimals: 18, name: "Monad", symbol: "MON" },Purely cosmetic; feel free to keep as-is if "Mon" is the preferred label.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.changeset/moody-camels-hear.md(1 hunks)packages/thirdweb/src/chains/chain-definitions/monad.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each TypeScript file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes in TypeScript
Avoidanyandunknownin TypeScript unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.) in TypeScript
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity and testability
Re-use shared types from @/types or local types.ts barrel exports
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics whenever possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic in TypeScript files; avoid restating TypeScript types and signatures in prose
Files:
packages/thirdweb/src/chains/chain-definitions/monad.ts
packages/thirdweb/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
packages/thirdweb/src/**/*.{ts,tsx}: Comment only ambiguous logic in SDK code; avoid restating TypeScript in prose
Load heavy dependencies inside async paths to keep initial bundle lean (e.g.const { jsPDF } = await import("jspdf");)Lazy-load heavy dependencies inside async paths to keep the initial bundle lean (e.g., const { jsPDF } = await import('jspdf');)
Files:
packages/thirdweb/src/chains/chain-definitions/monad.ts
**/*.{js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (AGENTS.md)
Biome governs formatting and linting; its rules live in biome.json. Run
pnpm fix&pnpm lintbefore committing, ensure there are no linting errors
Files:
packages/thirdweb/src/chains/chain-definitions/monad.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Lazy-import optional features; avoid top-level side-effects
Files:
packages/thirdweb/src/chains/chain-definitions/monad.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: MananTank
Repo: thirdweb-dev/js PR: 7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of `defineChain`. When it's necessary to use `defineChain` directly, it's acceptable to disable the rule with `// eslint-disable-next-line no-restricted-syntax`.
📚 Learning: 2025-06-06T23:46:08.795Z
Learnt from: MananTank
Repo: thirdweb-dev/js PR: 7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of `defineChain`. When it's necessary to use `defineChain` directly, it's acceptable to disable the rule with `// eslint-disable-next-line no-restricted-syntax`.
Applied to files:
packages/thirdweb/src/chains/chain-definitions/monad.ts.changeset/moody-camels-hear.md
📚 Learning: 2025-11-24T22:45:01.202Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:45:01.202Z
Learning: Applies to packages/**/.changeset/*.md : Each change in packages/* should contain a changeset for the appropriate package with the appropriate version bump: patch for changes that don't impact the public API, minor for any new/modified public API
Applied to files:
.changeset/moody-camels-hear.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Vercel Agent Review
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: E2E Tests (pnpm, webpack)
- 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 (2)
packages/thirdweb/src/chains/chain-definitions/monad.ts (2)
6-20: Monad chain definition looks good and matches the PR scopeThe chain object is a pure
defineChainconfig with id, name, native currency, and the two explorers expected for Monad. No runtime logic, and the definition is self-contained and consistent with how other chains are typically modeled.
6-6: Check ESLint rule around directdefineChainusageThere is an ESLint rule in this repo that can restrict direct
defineChainusage. If that rule is active for this SDK path, you may need to locally disable it for this declaration, e.g.:- export const monad = /*@__PURE__*/ defineChain({ + // eslint-disable-next-line no-restricted-syntax + export const monad = /*@__PURE__*/ defineChain({If the rule is already scoped away from
packages/thirdweb/src/chains, no change is needed.Based on learnings, please ensure
pnpm lintpasses without flagging thisdefineChaincall.
| --- | ||
| "thirdweb": patch | ||
| --- | ||
|
|
||
| Add monad chain definition |
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.
🧩 Analysis chain
Script executed:
#!/bin/bash
# First, let's find the changeset file and understand its structure
echo "=== Changeset file content ==="
find . -name "moody-camels-hear.md" -type f | head -5 | xargs cat
echo -e "\n=== Looking for monad chain definition in the PR ==="
# Search for monad chain definition
rg -i "monad" --type ts --type js -B2 -A2 | head -40
echo -e "\n=== Looking for chain definitions pattern ==="
# Find where chains are defined and exported
rg "chain" --type ts --type js -i "export.*chain" -B1 -A1 | head -50Repository: thirdweb-dev/js
<shell_result>
Repository: thirdweb-dev/js
Exit code: 0
stdout:
=== Changeset file content ===
---
"thirdweb": patch
---
Add monad chain definition
=== Looking for monad chain definition in the PR ===
packages/thirdweb/src/exports/chains.ts-export { mode } from "../chains/chain-definitions/mode.js";
packages/thirdweb/src/exports/chains.ts-export { modeTestnet } from "../chains/chain-definitions/mode-testnet.js";
packages/thirdweb/src/exports/chains.ts:export { monadTestnet } from "../chains/chain-definitions/monad-testnet.js";
packages/thirdweb/src/exports/chains.ts-export { moonbeam } from "../chains/chain-definitions/moonbeam.js";
packages/thirdweb/src/exports/chains.ts-export { optimism } from "../chains/chain-definitions/optimism.js";
--
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts- * @chain
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts- */
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts:export const monadTestnet = /*@__PURE__*/ defineChain({
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts- blockExplorers: [
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts- {
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts: name: "Monad Explorer",
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts: url: "https://testnet.monadexplorer.com/",
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts- },
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts- ],
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts- id: 10143,
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts: name: "Monad Testnet",
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts- nativeCurrency: { decimals: 18, name: "Mon", symbol: "MON" },
packages/thirdweb/src/chains/chain-definitions/monad-testnet.ts- testnet: true,
--
packages/thirdweb/src/chains/chain-definitions/monad.ts- * @chain
packages/thirdweb/src/chains/chain-definitions/monad.ts- */
packages/thirdweb/src/chains/chain-definitions/monad.ts:export const monad = /*@__PURE__*/ defineChain({
packages/thirdweb/src/chains/chain-definitions/monad.ts- blockExplorers: [
packages/thirdweb/src/chains/chain-definitions/monad.ts- {
packages/thirdweb/src/chains/chain-definitions/monad.ts: name: "Monad Vision",
packages/thirdweb/src/chains/chain-definitions/monad.ts: url: "https://monadvision.com/",
packages/thirdweb/src/chains/chain-definitions/monad.ts- },
packages/thirdweb/src/chains/chain-definitions/monad.ts- {
packages/thirdweb/src/chains/chain-definitions/monad.ts: name: "Monad Scan",
packages/thirdweb/src/chains/chain-definitions/monad.ts: url: "https://monadscan.com/",
packages/thirdweb/src/chains/chain-definitions/monad.ts- },
packages/thirdweb/src/chains/chain-definitions/monad.ts- ],
packages/thirdweb/src/chains/chain-definitions/monad.ts- id: 143,
packages/thirdweb/src/chains/chain-definitions/monad.ts: name: "Monad",
packages/thirdweb/src/chains/chain-definitions/monad.ts- nativeCurrency: { decimals: 18, name: "Mon", symbol: "MON" },
packages/thirdweb/src/chains/chain-definitions/monad.ts-});
=== Looking for chain definitions pattern ===
stderr:
export.*chain: No such file or directory (os error 2)
</shell_result>
Script executed:
#!/bin/bash
echo "=== Confirm monad is exported from chains.ts ==="
rg "export.*monad" packages/thirdweb/src/exports/chains.ts
echo -e "\n=== Check package.json exports or public API definition ==="
fd "package.json" -path "*/packages/thirdweb/*" --type f | head -1 | xargs head -50
echo -e "\n=== Look at recent changesets for chain additions ==="
fd "\.md" -path "*/.changeset/*" --type f | head -20 | xargs grep -l "chain" | head -5 | xargs cat
echo -e "\n=== Check if chains.ts is in the public exports ==="
cat packages/thirdweb/src/exports/chains.ts | head -20Repository: thirdweb-dev/js
<shell_result>
Repository: thirdweb-dev/js
Exit code: 0
stdout:
=== Confirm monad is exported from chains.ts ===
export { monadTestnet } from "../chains/chain-definitions/monad-testnet.js";
=== Check package.json exports or public API definition ===
=== Look at recent changesets for chain additions ===
=== Check if chains.ts is in the public exports ===
// chain types
export { abstract } from "../chains/chain-definitions/abstract.js";
export { abstractTestnet } from "../chains/chain-definitions/abstract-testnet.js";
/**
* PRE_DEFINED CHAINS
*/
export { anvil } from "../chains/chain-definitions/anvil.js";
export { arbitrum } from "../chains/chain-definitions/arbitrum.js";
export { arbitrumNova } from "../chains/chain-definitions/arbitrum-nova.js";
export { arbitrumSepolia } from "../chains/chain-definitions/arbitrum-sepolia.js";
export { arcTestnet } from "../chains/chain-definitions/arc-testnet.js";
export { assetChainTestnet } from "../chains/chain-definitions/assetchain-testnet.js";
export { astriaEvmDusknet } from "../chains/chain-definitions/astria-evm-dusknet.js";
export { avalanche } from "../chains/chain-definitions/avalanche.js";
export { avalancheFuji } from "../chains/chain-definitions/avalanche-fuji.js";
export { base } from "../chains/chain-definitions/base.js";
export { baseSepolia } from "../chains/chain-definitions/base-sepolia.js";
export { berachain } from "../chains/chain-definitions/berachain.js";
stderr:
error: 'h' isn't a valid value for '--type <filetype>'
[possible values: file, directory, symlink, executable, empty, socket, pipe]
For more information try '--help'
error: 'h' isn't a valid value for '--type <filetype>'
[possible values: file, directory, symlink, executable, empty, socket, pipe]
For more information try '--help'
</shell_result>
Script executed:
#!/bin/bash
echo "=== Search for all monad exports (not just monadTestnet) ==="
rg "export.*monad" packages/thirdweb/src/exports/chains.ts -A1 -B1
echo -e "\n=== List changesets directory ==="
ls -la .changeset/ | grep -v "^d" | head -20
echo -e "\n=== Check a few recent changesets for context ==="
find .changeset -name "*.md" -type f ! -name "README.md" ! -name "config.json" | head -10 | xargs catRepository: thirdweb-dev/js
<shell_result>
Repository: thirdweb-dev/js
Exit code: 0
stdout:
=== Search for all monad exports (not just monadTestnet) ===
export { modeTestnet } from "../chains/chain-definitions/mode-testnet.js";
export { monadTestnet } from "../chains/chain-definitions/monad-testnet.js";
export { moonbeam } from "../chains/chain-definitions/moonbeam.js";
=== List changesets directory ===
total 12
-rw-r--r-- 1 jailuser jailuser 510 Nov 26 20:57 README.md
-rw-r--r-- 1 jailuser jailuser 627 Nov 26 20:57 config.json
-rw-r--r-- 1 jailuser jailuser 54 Nov 26 20:57 moody-camels-hear.md
=== Check a few recent changesets for context ===
---
"thirdweb": patch
---
Add monad chain definition
</shell_result>
Script executed:
#!/bin/bash
echo "=== Full search for monad in chains.ts ==="
rg "monad" packages/thirdweb/src/exports/chains.ts
echo -e "\n=== Count total lines in chains.ts to understand scope ==="
wc -l packages/thirdweb/src/exports/chains.ts
echo -e "\n=== Check if monad appears elsewhere in exports ==="
rg "export.*monad" packages/thirdweb/src/exports/
echo -e "\n=== Look at the actual monad.ts file to confirm it's a real chain definition ==="
head -30 packages/thirdweb/src/chains/chain-definitions/monad.ts
echo -e "\n=== Verify this is a public API entry point ==="
rg "from.*exports/chains" --type ts --type js | head -10Repository: thirdweb-dev/js
<shell_result>
Repository: thirdweb-dev/js
Exit code: 0
stdout:
=== Full search for monad in chains.ts ===
export { monadTestnet } from "../chains/chain-definitions/monad-testnet.js";
=== Count total lines in chains.ts to understand scope ===
95 packages/thirdweb/src/exports/chains.ts
=== Check if monad appears elsewhere in exports ===
packages/thirdweb/src/exports/chains.ts:export { monadTestnet } from "../chains/chain-definitions/monad-testnet.js";
=== Look at the actual monad.ts file to confirm it's a real chain definition ===
import { defineChain } from "../utils.js";
/**
* @chain
*/
export const monad = /*@__PURE__*/ defineChain({
blockExplorers: [
{
name: "Monad Vision",
url: "https://monadvision.com/",
},
{
name: "Monad Scan",
url: "https://monadscan.com/",
},
],
id: 143,
name: "Monad",
nativeCurrency: { decimals: 18, name: "Mon", symbol: "MON" },
});
=== Verify this is a public API entry point ===
packages/thirdweb/src/wallets/smart/smart-wallet-integration.test.ts:import { baseSepolia } from "../../exports/chains.js";
packages/thirdweb/src/wallets/eip5792/send-calls.test.ts:import { sepolia } from "../../exports/chains.js";
packages/thirdweb/src/transaction/actions/gasless/providers/engine.test.ts:import { polygon } from "../../../../exports/chains.js";
</shell_result>
Script executed:
#!/bin/bash
echo "=== Check if monad export was added in this PR by looking at git diff ==="
git diff HEAD -- packages/thirdweb/src/exports/chains.ts | head -40
echo -e "\n=== Verify the learning applies to this repository ==="
cat AGENTS.md 2>/dev/null | grep -A5 -B5 "changeset" | head -30Repository: thirdweb-dev/js
<shell_result>
Repository: thirdweb-dev/js
Exit code: 0
stdout:
=== Check if monad export was added in this PR by looking at git diff ===
=== Verify the learning applies to this repository ===
⸻
8. Documentation & Developer Experience
- Each change in packages/\* should contain a changeset for the appropriate package, with the appropriate version bump
- patch for changes that don't impact the public API
- minor for any new/modified public API
- Surface breaking changes prominently in PR descriptions.
</shell_result>
Based on my verification:
-
Chain definitions are public API: The file
packages/thirdweb/src/exports/chains.tsis the central export point for chain definitions, and test files across the codebase import chains from this public API entry point. -
New chain is being added: The PR adds a new
monadchain definition (filepackages/thirdweb/src/chains/chain-definitions/monad.tsexists and is ready for export). -
Project policy confirmed: The
AGENTS.mdfile explicitly states: "minor for any new/modified public API" and "patch for changes that don't impact the public API." -
This is a public API addition: Adding a new exportable chain constant is a new public API surface that consumers can import and use.
Update changeset to use minor version bump for new public chain export.
The PR adds a new chain definition (monad) to the thirdweb package's public API. Per project guidance in AGENTS.md, new/modified public APIs require a minor version bump, not patch.
---
-"thirdweb": patch
+"thirdweb": minor
---📝 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.
| --- | |
| "thirdweb": patch | |
| --- | |
| Add monad chain definition | |
| --- | |
| "thirdweb": minor | |
| --- | |
| Add monad chain definition |
🤖 Prompt for AI Agents
In .changeset/moody-camels-hear.md around lines 1 to 5, the changeset currently
lists "thirdweb": patch but this PR adds a new public chain export (monad) so
the version bump must be minor; update the frontmatter to "thirdweb": minor (and
keep the description), save the file so the package receives a minor version
bump per AGENTS.md guidance.
size-limit report 📦
|
894db17 to
17cced3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/thirdweb/src/chains/chain-definitions/monad.ts (1)
3-5: Minimal TSDoc for chain definition.The
@chainannotation is present, but coding guidelines suggest comprehensive TSDoc with at least one@exampleblock for public exports. However, chain definitions are largely self-documenting data structures, so this minimal documentation may be acceptable per project conventions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (7)
.changeset/angry-monkeys-dress.md(1 hunks).changeset/moody-camels-hear.md(1 hunks)packages/thirdweb/src/chains/chain-definitions/monad.ts(1 hunks)packages/thirdweb/src/exports/chains.ts(1 hunks)packages/thirdweb/src/react/core/hooks/x402/useFetchWithPaymentCore.ts(1 hunks)packages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx(4 hunks)packages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsx(3 hunks)
✅ Files skipped from review due to trivial changes (1)
- .changeset/moody-camels-hear.md
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each TypeScript file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes in TypeScript
Avoidanyandunknownin TypeScript unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.) in TypeScript
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity and testability
Re-use shared types from @/types or local types.ts barrel exports
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics whenever possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic in TypeScript files; avoid restating TypeScript types and signatures in prose
Files:
packages/thirdweb/src/chains/chain-definitions/monad.tspackages/thirdweb/src/react/core/hooks/x402/useFetchWithPaymentCore.tspackages/thirdweb/src/exports/chains.tspackages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsxpackages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx
packages/thirdweb/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
packages/thirdweb/src/**/*.{ts,tsx}: Comment only ambiguous logic in SDK code; avoid restating TypeScript in prose
Load heavy dependencies inside async paths to keep initial bundle lean (e.g.const { jsPDF } = await import("jspdf");)Lazy-load heavy dependencies inside async paths to keep the initial bundle lean (e.g., const { jsPDF } = await import('jspdf');)
Files:
packages/thirdweb/src/chains/chain-definitions/monad.tspackages/thirdweb/src/react/core/hooks/x402/useFetchWithPaymentCore.tspackages/thirdweb/src/exports/chains.tspackages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsxpackages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx
**/*.{js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (AGENTS.md)
Biome governs formatting and linting; its rules live in biome.json. Run
pnpm fix&pnpm lintbefore committing, ensure there are no linting errors
Files:
packages/thirdweb/src/chains/chain-definitions/monad.tspackages/thirdweb/src/react/core/hooks/x402/useFetchWithPaymentCore.tspackages/thirdweb/src/exports/chains.tspackages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsxpackages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Lazy-import optional features; avoid top-level side-effects
Files:
packages/thirdweb/src/chains/chain-definitions/monad.tspackages/thirdweb/src/react/core/hooks/x402/useFetchWithPaymentCore.tspackages/thirdweb/src/exports/chains.tspackages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsxpackages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx
packages/thirdweb/src/exports/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
packages/thirdweb/src/exports/**/*.{ts,tsx}: Export everything viaexports/directory, grouped by feature in SDK development
Every public symbol must have comprehensive TSDoc with at least one@exampleblock that compiles and custom annotation tags (@beta,@internal,@experimental)Export everything in packages/thirdweb via the exports/ directory, grouped by feature. Every public symbol must have comprehensive TSDoc including at least one @example block that compiles and one custom annotation (@beta, @internal, @experimental, etc.)
Files:
packages/thirdweb/src/exports/chains.ts
🧠 Learnings (11)
📚 Learning: 2025-11-24T22:45:01.202Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:45:01.202Z
Learning: Applies to packages/**/.changeset/*.md : Each change in packages/* should contain a changeset for the appropriate package with the appropriate version bump: patch for changes that don't impact the public API, minor for any new/modified public API
Applied to files:
.changeset/angry-monkeys-dress.md
📚 Learning: 2025-11-24T22:43:43.644Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:43:43.644Z
Learning: Use `patch` version bump for changes that don't impact the public API
Applied to files:
.changeset/angry-monkeys-dress.md
📚 Learning: 2025-06-06T23:46:08.795Z
Learnt from: MananTank
Repo: thirdweb-dev/js PR: 7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of `defineChain`. When it's necessary to use `defineChain` directly, it's acceptable to disable the rule with `// eslint-disable-next-line no-restricted-syntax`.
Applied to files:
packages/thirdweb/src/chains/chain-definitions/monad.ts
📚 Learning: 2025-11-24T22:43:43.644Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:43:43.644Z
Learning: Applies to apps/dashboard/src/**/*.{ts,tsx} : Handle interactive UI with React hooks (`useState`, `useEffect`, React Query, wallet hooks) in client components
Applied to files:
packages/thirdweb/src/react/core/hooks/x402/useFetchWithPaymentCore.tspackages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx
📚 Learning: 2025-11-24T22:44:20.977Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-11-24T22:44:20.977Z
Learning: Applies to apps/dashboard/**/*fetch*.{ts,tsx} : Create light wrapper functions (e.g., `fetchJson`) that automatically attach the JWT from cookies/session when calling internal API routes
Applied to files:
packages/thirdweb/src/react/core/hooks/x402/useFetchWithPaymentCore.ts
📚 Learning: 2025-05-27T19:54:55.885Z
Learnt from: MananTank
Repo: thirdweb-dev/js 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.
Applied to files:
packages/thirdweb/src/react/core/hooks/x402/useFetchWithPaymentCore.ts
📚 Learning: 2025-11-24T22:45:01.202Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:45:01.202Z
Learning: Applies to packages/thirdweb/src/exports/**/*.{ts,tsx} : Export everything in packages/thirdweb via the exports/ directory, grouped by feature. Every public symbol must have comprehensive TSDoc including at least one example block that compiles and one custom annotation (beta, internal, experimental, etc.)
Applied to files:
packages/thirdweb/src/exports/chains.ts
📚 Learning: 2025-11-24T22:43:43.644Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:43:43.644Z
Learning: Applies to packages/thirdweb/src/exports/**/*.{ts,tsx} : Export everything via `exports/` directory, grouped by feature in SDK development
Applied to files:
packages/thirdweb/src/exports/chains.ts
📚 Learning: 2025-11-24T22:43:43.644Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:43:43.644Z
Learning: Applies to **/*.test.{ts,tsx} : Use `FORKED_ETHEREUM_CHAIN` for mainnet interactions and `ANVIL_CHAIN` for isolated tests
Applied to files:
packages/thirdweb/src/exports/chains.ts
📚 Learning: 2025-11-24T22:44:20.977Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-11-24T22:44:20.977Z
Learning: Use interactive client components for UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks)
Applied to files:
packages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx
📚 Learning: 2025-11-24T22:45:01.202Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:45:01.202Z
Learning: Applies to apps/{dashboard,playground}/**/*.{tsx,ts} : Client Components: Begin files with 'use client'; before imports, handle interactive UI relying on React hooks (useState, useEffect, React Query, wallet hooks), access browser APIs (localStorage, window, IntersectionObserver, etc.), and support fast transitions with client-side data prefetching
Applied to files:
packages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx
🧬 Code graph analysis (2)
packages/thirdweb/src/chains/chain-definitions/monad.ts (1)
packages/thirdweb/src/exports/chains.ts (2)
monad(55-55)defineChain(93-93)
packages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsx (1)
packages/thirdweb/src/react/web/ui/components/basic.tsx (3)
Container(80-193)ModalHeader(36-68)ScreenBottomContainer(14-23)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Unit Tests
- GitHub Check: Size
- GitHub Check: Build Packages
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
- GitHub Check: Vercel Agent Review
🔇 Additional comments (9)
packages/thirdweb/src/react/core/hooks/x402/useFetchWithPaymentCore.ts (1)
102-104: LGTM! Preserves wallet context across retries.The change correctly passes
currentWalletto the recursiveexecuteFetchcall during retry, preventing the use of a stale wallet reference from the outer closure. The comment clearly explains the intent..changeset/angry-monkeys-dress.md (1)
1-5: LGTM! Accurate changeset description.The patch-level version bump is appropriate for adding optional customization options without breaking the public API. The description accurately reflects the sign-in modal enhancements.
packages/thirdweb/src/exports/chains.ts (1)
55-55: LGTM! Follows the established export pattern.The export is correctly placed alphabetically and follows the convention of exporting both mainnet and testnet chain definitions.
packages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx (3)
49-59: LGTM! Well-structured optional configuration.The new
signInRequiredModaloption is properly typed with clear property names and maintains backward compatibility through optional fields.
161-170: LGTM! Clear and helpful documentation.The TSDoc example demonstrates the customization API clearly and follows the project's documentation standards with compilable code.
227-229: LGTM! Props correctly wired to modal component.The configuration options are properly passed through to the
SignInRequiredModal, with prop names matching the component's interface.packages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsx (2)
18-20: LGTM! Well-designed optional props.The new props enable customization while maintaining a clean interface with clear names:
title,description, andbuttonLabel.
27-34: LGTM! Clean refactor with proper defaults.The implementation correctly uses the new props with sensible defaults that preserve the original hardcoded behavior. The destructuring pattern with default values ensures backward compatibility.
Also applies to: 48-48, 51-51, 68-68, 76-76
packages/thirdweb/src/chains/chain-definitions/monad.ts (1)
1-20: <function_calls>
"Monad" blockchain "chain ID" 143 mainnet
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8465 +/- ##
==========================================
+ Coverage 54.82% 54.84% +0.02%
==========================================
Files 919 920 +1
Lines 60875 60891 +16
Branches 4141 4141
==========================================
+ Hits 33374 33395 +21
+ Misses 27399 27394 -5
Partials 102 102
🚀 New features to boost your workflow:
|
17cced3 to
c720f7f
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 (1)
.changeset/moody-camels-hear.md (1)
1-5: Update changeset to use minor version bump.A previous review comment has already identified that this changeset should use
minorinstead ofpatchbecause adding a new public chain export (monad) is a new public API addition. Based on learnings, new/modified public APIs require a minor version bump.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (8)
.changeset/angry-monkeys-dress.md(1 hunks).changeset/moody-camels-hear.md(1 hunks)packages/thirdweb/src/chains/chain-definitions/monad.ts(1 hunks)packages/thirdweb/src/exports/chains.ts(1 hunks)packages/thirdweb/src/react/core/hooks/others/useInvalidateBalances.ts(1 hunks)packages/thirdweb/src/react/core/hooks/x402/useFetchWithPaymentCore.ts(1 hunks)packages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx(4 hunks)packages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsx(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- .changeset/angry-monkeys-dress.md
- packages/thirdweb/src/react/core/hooks/x402/useFetchWithPaymentCore.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each TypeScript file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes in TypeScript
Avoidanyandunknownin TypeScript unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.) in TypeScript
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity and testability
Re-use shared types from @/types or local types.ts barrel exports
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics whenever possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic in TypeScript files; avoid restating TypeScript types and signatures in prose
Files:
packages/thirdweb/src/chains/chain-definitions/monad.tspackages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsxpackages/thirdweb/src/exports/chains.tspackages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsxpackages/thirdweb/src/react/core/hooks/others/useInvalidateBalances.ts
packages/thirdweb/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
packages/thirdweb/src/**/*.{ts,tsx}: Comment only ambiguous logic in SDK code; avoid restating TypeScript in prose
Load heavy dependencies inside async paths to keep initial bundle lean (e.g.const { jsPDF } = await import("jspdf");)Lazy-load heavy dependencies inside async paths to keep the initial bundle lean (e.g., const { jsPDF } = await import('jspdf');)
Files:
packages/thirdweb/src/chains/chain-definitions/monad.tspackages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsxpackages/thirdweb/src/exports/chains.tspackages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsxpackages/thirdweb/src/react/core/hooks/others/useInvalidateBalances.ts
**/*.{js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (AGENTS.md)
Biome governs formatting and linting; its rules live in biome.json. Run
pnpm fix&pnpm lintbefore committing, ensure there are no linting errors
Files:
packages/thirdweb/src/chains/chain-definitions/monad.tspackages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsxpackages/thirdweb/src/exports/chains.tspackages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsxpackages/thirdweb/src/react/core/hooks/others/useInvalidateBalances.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Lazy-import optional features; avoid top-level side-effects
Files:
packages/thirdweb/src/chains/chain-definitions/monad.tspackages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsxpackages/thirdweb/src/exports/chains.tspackages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsxpackages/thirdweb/src/react/core/hooks/others/useInvalidateBalances.ts
packages/thirdweb/src/exports/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
packages/thirdweb/src/exports/**/*.{ts,tsx}: Export everything viaexports/directory, grouped by feature in SDK development
Every public symbol must have comprehensive TSDoc with at least one@exampleblock that compiles and custom annotation tags (@beta,@internal,@experimental)Export everything in packages/thirdweb via the exports/ directory, grouped by feature. Every public symbol must have comprehensive TSDoc including at least one @example block that compiles and one custom annotation (@beta, @internal, @experimental, etc.)
Files:
packages/thirdweb/src/exports/chains.ts
🧠 Learnings (12)
📚 Learning: 2025-06-06T23:46:08.795Z
Learnt from: MananTank
Repo: thirdweb-dev/js PR: 7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of `defineChain`. When it's necessary to use `defineChain` directly, it's acceptable to disable the rule with `// eslint-disable-next-line no-restricted-syntax`.
Applied to files:
packages/thirdweb/src/chains/chain-definitions/monad.ts.changeset/moody-camels-hear.md
📚 Learning: 2025-11-24T22:43:43.644Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:43:43.644Z
Learning: Applies to apps/dashboard/src/**/*.{ts,tsx} : Handle interactive UI with React hooks (`useState`, `useEffect`, React Query, wallet hooks) in client components
Applied to files:
packages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsxpackages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx
📚 Learning: 2025-05-30T17:14:25.332Z
Learnt from: MananTank
Repo: thirdweb-dev/js 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.
Applied to files:
packages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsx
📚 Learning: 2025-11-24T22:45:01.202Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:45:01.202Z
Learning: Applies to packages/thirdweb/src/exports/**/*.{ts,tsx} : Export everything in packages/thirdweb via the exports/ directory, grouped by feature. Every public symbol must have comprehensive TSDoc including at least one example block that compiles and one custom annotation (beta, internal, experimental, etc.)
Applied to files:
packages/thirdweb/src/exports/chains.ts
📚 Learning: 2025-11-24T22:43:43.644Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:43:43.644Z
Learning: Applies to packages/thirdweb/src/exports/**/*.{ts,tsx} : Export everything via `exports/` directory, grouped by feature in SDK development
Applied to files:
packages/thirdweb/src/exports/chains.ts
📚 Learning: 2025-11-24T22:43:43.644Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:43:43.644Z
Learning: Applies to **/*.test.{ts,tsx} : Use `FORKED_ETHEREUM_CHAIN` for mainnet interactions and `ANVIL_CHAIN` for isolated tests
Applied to files:
packages/thirdweb/src/exports/chains.ts
📚 Learning: 2025-11-24T22:44:20.977Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-11-24T22:44:20.977Z
Learning: Use interactive client components for UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks)
Applied to files:
packages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx
📚 Learning: 2025-11-24T22:45:01.202Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:45:01.202Z
Learning: Applies to apps/{dashboard,playground}/**/*.{tsx,ts} : Client Components: Begin files with 'use client'; before imports, handle interactive UI relying on React hooks (useState, useEffect, React Query, wallet hooks), access browser APIs (localStorage, window, IntersectionObserver, etc.), and support fast transitions with client-side data prefetching
Applied to files:
packages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx
📚 Learning: 2025-11-24T22:45:01.202Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:45:01.202Z
Learning: Applies to packages/**/.changeset/*.md : Each change in packages/* should contain a changeset for the appropriate package with the appropriate version bump: patch for changes that don't impact the public API, minor for any new/modified public API
Applied to files:
.changeset/moody-camels-hear.md
📚 Learning: 2025-11-24T22:43:43.644Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:43:43.644Z
Learning: Surface breaking changes prominently in PR descriptions
Applied to files:
.changeset/moody-camels-hear.md
📚 Learning: 2025-11-24T22:43:43.644Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:43:43.644Z
Learning: Use `minor` version bump for any new/modified public API
Applied to files:
.changeset/moody-camels-hear.md
📚 Learning: 2025-11-24T22:43:43.644Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:43:43.644Z
Learning: Use `major` version bump for breaking changes and surface prominently in PR descriptions
Applied to files:
.changeset/moody-camels-hear.md
🧬 Code graph analysis (2)
packages/thirdweb/src/chains/chain-definitions/monad.ts (1)
packages/thirdweb/src/exports/chains.ts (2)
monad(55-55)defineChain(93-93)
packages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsx (2)
packages/thirdweb/src/react/web/ui/components/basic.tsx (3)
Container(80-193)ModalHeader(36-68)ScreenBottomContainer(14-23)packages/thirdweb/src/react/web/ui/components/text.tsx (1)
Text(18-34)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Unit Tests
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Build Packages
- GitHub Check: Lint Packages
- GitHub Check: Vercel Agent Review
- GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
packages/thirdweb/src/react/web/ui/x402/SignInRequiredModal.tsx (1)
18-20: LGTM! Clean implementation of customizable modal props.The addition of optional
title,description, andbuttonLabelprops with sensible defaults enhances the modal's flexibility while maintaining backward compatibility. The implementation correctly applies these props throughout the component.Also applies to: 27-34, 48-76
packages/thirdweb/src/react/core/hooks/others/useInvalidateBalances.ts (1)
15-15: LGTM! Aligns implementation with documented API.Adding the default parameter allows calling
invalidateBalances()without arguments as shown in the docstring example, improving developer experience.packages/thirdweb/src/react/web/hooks/x402/useFetchWithPayment.tsx (1)
49-59: LGTM! Well-documented customization option.The new
signInRequiredModaloption follows the established pattern of other customization options in this hook. The type definition is clear, JSDoc is comprehensive with examples, and the implementation correctly passes the props to the SignInRequiredModal component.Also applies to: 87-87, 161-170, 227-229
packages/thirdweb/src/exports/chains.ts (1)
55-55: LGTM! Export follows established pattern.The
monadchain export is correctly positioned alphabetically and follows the same pattern as other chain definitions in the file.packages/thirdweb/src/chains/chain-definitions/monad.ts (1)
6-20: Chain metadata is accurate and verified.Both block explorer URLs are accessible (HTTP 200), and the chain details match official specifications:
- Chain ID 143 ✓
- Native currency: Mon (MON, 18 decimals) ✓
- Block explorers: Monad Vision and Monad Scan both reachable ✓
| /** | ||
| * @chain | ||
| */ |
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.
🛠️ Refactor suggestion | 🟠 Major
Add comprehensive TSDoc for the public chain export.
Per coding guidelines, every public symbol exported via exports/ must have comprehensive TSDoc including:
- A description of the chain
- At least one
@exampleblock showing usage - A custom annotation tag (
@beta,@internal, or@experimental)
Currently, the TSDoc only contains @chain.
Apply this diff to add complete documentation:
/**
+ * The Monad mainnet chain.
+ *
+ * @example
+ * ```ts
+ * import { monad } from "thirdweb/chains";
+ * import { createThirdwebClient } from "thirdweb";
+ *
+ * const client = createThirdwebClient({ clientId: "..." });
+ * const contract = getContract({ client, chain: monad, address: "0x..." });
+ * ```
+ *
* @chain
+ * @beta
*/Based on coding guidelines.
🤖 Prompt for AI Agents
In packages/thirdweb/src/chains/chain-definitions/monad.ts around lines 3 to 5,
the public export has only the `@chain` tag; update the TSDoc block to include a
short description of the Monad chain, an @example showing import and basic usage
(import { monad } from "thirdweb/chains"; createThirdwebClient(...);
getContract({ client, chain: monad, address: "0x..." });), and add a custom
annotation tag such as `@beta`; replace the minimal `@chain` comment with a full
JSDoc block that contains description, the example code block, `@chain`, and
`@beta`.

PR-Codex overview
This PR focuses on enhancing the
SignInRequiredModalin thethirdweblibrary by adding customization options and introducing a new blockchain definition formonad. It also updates theuseFetchWithPaymenthook to support these new features.Detailed summary
monadchain definition with explorers and native currency.title,description,buttonLabel) forSignInRequiredModal.useFetchWithPaymentto accept customization options for the modal.SignInRequiredModalto utilize new props for dynamic content.Summary by CodeRabbit
New Features
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.