-
Notifications
You must be signed in to change notification settings - Fork 613
add arc testnet to chains package #8325
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
🦋 Changeset detectedLatest commit: 7459e35 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
WalkthroughThis PR adds a new Arc Testnet chain definition to the thirdweb chains package. A changeset documents the patch release, a new chain definition file defines the Arc Testnet configuration with chain ID 5042002, and the chain is exported through the chains module. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
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
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 (3)
.changeset/hip-spoons-go.md(1 hunks)packages/thirdweb/src/chains/chain-definitions/arc-testnet.ts(1 hunks)packages/thirdweb/src/exports/chains.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from@/typeswhere applicable
Prefertypealiases overinterfaceexcept for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size
Files:
packages/thirdweb/src/chains/chain-definitions/arc-testnet.tspackages/thirdweb/src/exports/chains.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
packages/thirdweb/src/chains/chain-definitions/arc-testnet.tspackages/thirdweb/src/exports/chains.ts
packages/thirdweb/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling@exampleand a custom tag (@beta,@internal,@experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g.,const { jsPDF } = await import("jspdf"))
Files:
packages/thirdweb/src/chains/chain-definitions/arc-testnet.tspackages/thirdweb/src/exports/chains.ts
.changeset/*.md
📄 CodeRabbit inference engine (AGENTS.md)
.changeset/*.md: Each change inpackages/*must include a changeset for the appropriate package
Version bump rules: patch for non‑API changes; minor for new/modified public API
Files:
.changeset/hip-spoons-go.md
packages/thirdweb/src/exports/**
📄 CodeRabbit inference engine (CLAUDE.md)
packages/thirdweb/src/exports/**: Export everything viaexports/directory, grouped by feature in the SDK public API
Every public symbol must have comprehensive TSDoc with at least one@exampleblock that compiles and custom annotation tags (@beta,@internal,@experimental)
Files:
packages/thirdweb/src/exports/chains.ts
🧠 Learnings (1)
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to .changeset/*.md : Version bump rules: patch for non‑API changes; minor for new/modified public API
Applied to files:
.changeset/hip-spoons-go.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). (8)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Lint Packages
- GitHub Check: Unit Tests
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
packages/thirdweb/src/exports/chains.ts (1)
13-13: LGTM: export wired and alphabetically placed.The arcTestnet re-export follows existing ESM path style (.js) and ordering.
packages/thirdweb/src/chains/chain-definitions/arc-testnet.ts (3)
15-16: Configuration is correct; no changes needed.Arc Testnet confirms testnet USDC as the native gas token with 6 decimals. The current configuration matches Arc's specification. While using USDC as a gas token is unusual compared to other EVM chains, it is the correct and documented behavior for Arc Testnet.
7-12: Revert to standard array shape; optionally add apiUrl if available.The blockExplorers field uses array format consistently across all 60+ chain definitions in the codebase (ethereum, arbitrum, base, polygon, zksync, optimism, etc.)—not an object with a default key. Your current code already follows this convention correctly.
If ArcScan exposes an API endpoint, add it as an optional property within the existing array element:
blockExplorers: [ { name: "Arc Testnet Explorer", url: "https://testnet.arcscan.app", + apiUrl: "https://testnet.arcscan.app/api", }, ],Verify that the apiUrl endpoint exists and is documented before adding it.
Likely an incorrect or invalid review comment.
6-17: Verify RPC aggregator coverage for chain ID 5042002.The review comment raises a valid concern: if thirdweb's RPC aggregator doesn't support chain 5042002, consumers will encounter runtime failures when calling getRpcUrlForChain(). While RPC endpoints are optional in defineChain, explicit RPC entries should be added if the chain isn't in thirdweb's supported chains list.
Confirm on thirdweb's Chainlist whether chain 5042002 is covered by their default RPC aggregator. If not covered, add explicit RPC endpoint(s) to prevent runtime errors.
| "thirdweb": patch | ||
| --- | ||
|
|
||
| Add Arc testnet to chains package |
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.
Bump version to minor (new public export).
This adds a new public export (arcTestnet) to packages/thirdweb, which is a public API change. Per policy: patch for non-API changes; minor for new/modified public API.
Apply:
----
-"thirdweb": patch
+---
+"thirdweb": minor
---
Add Arc testnet to chains packageBased on learnings.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
.changeset/hip-spoons-go.md lines 2-5: The changeset currently sets "thirdweb":
patch despite adding a new public export (arcTestnet), which requires a minor
bump; update the changeset to use "minor" instead of "patch" for the thirdweb
package and keep the release notes describing the new public export so the
package versioning correctly reflects the public API change.
| /** | ||
| * @chain | ||
| */ | ||
| export const arcTestnet = /* @__PURE__ */ defineChain({ |
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 full TSDoc with compiling example and custom tag.
Public symbols in packages/thirdweb must include TSDoc with an @example and a custom tag. Please replace the brief comment with a complete block.
Apply:
-/**
- * @chain
- */
+/**
+ * Arc Testnet predefined chain.
+ *
+ * @chain
+ * @beta
+ * @example
+ * import { createThirdwebClient } from "thirdweb";
+ * import { arcTestnet, getRpcUrlForChain } from "thirdweb/chains";
+ *
+ * const client = createThirdwebClient({ clientId: process.env.TW_CLIENT_ID! });
+ * const rpcUrl = getRpcUrlForChain(arcTestnet, client);
+ * // use rpcUrl with your provider or SDK calls
+ */As per coding guidelines.
🤖 Prompt for AI Agents
packages/thirdweb/src/chains/chain-definitions/arc-testnet.ts lines 3-6: the
brief comment must be replaced with a complete TSDoc block for the exported
public symbol; add a descriptive one-line summary, an optional short remarks
section, the required custom tag (e.g. @chain) and a compiling @example that
shows importing defineChain and using arcTestnet (a minimal, executable snippet
that TypeScript can compile), and ensure the block sits immediately above the
export so the doc is attached to export const arcTestnet.
size-limit report 📦
|
PR-Codex overview
This PR introduces the
arcTestnetchain to thethirdwebpackage, adding details about its properties and exporting it for use in other parts of the application.Detailed summary
arc-testnet.tsdefining thearcTestnetchain with properties such asid,name,nativeCurrency, andblockExplorers.arcTestnetfromchains.tsto make it available for use in the application.Summary by CodeRabbit