-
Notifications
You must be signed in to change notification settings - Fork 557
feat: add berachain and berachain-bepolia chains #7343
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: 787118d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 Git ↗︎
|
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. |
WalkthroughTwo new blockchain network definitions, "Berachain" and "Berachain Bepolia," were added using the Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant ChainsModule
participant ChainDefinition
App->>ChainsModule: Import { berachain, berachainBepolia }
ChainsModule->>ChainDefinition: Retrieve chain details (ID, name, currency, explorer)
ChainsModule-->>App: Provide chain definitions for use
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (8)
🪧 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 (
|
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: 3
🧹 Nitpick comments (1)
packages/thirdweb/src/chains/chain-definitions/berachain.ts (1)
3-5
: Consider enriching JSDoc comment
A brief description (e.g., “Mainnet chain configuration for Berachain”) would improve clarity and aid downstream tooling that picks up the@chain
tag.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/thirdweb/src/chains/chain-definitions/berachain-bepolia.ts
(1 hunks)packages/thirdweb/src/chains/chain-definitions/berachain.ts
(1 hunks)packages/thirdweb/src/exports/chains.ts
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
packages/thirdweb/src/chains/chain-definitions/berachain-bepolia.ts (1)
packages/thirdweb/src/exports/chains.ts (2)
berachainBepolia
(87-87)defineChain
(5-5)
packages/thirdweb/src/chains/chain-definitions/berachain.ts (1)
packages/thirdweb/src/exports/chains.ts (2)
berachain
(86-86)defineChain
(5-5)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Build Packages
- GitHub Check: Size
- GitHub Check: Unit Tests
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
packages/thirdweb/src/chains/chain-definitions/berachain.ts (1)
1-2
: Skip import reviewpackages/thirdweb/src/chains/chain-definitions/berachain-bepolia.ts (2)
1-2
: Skip import review
3-5
: Skip JSDoc review
export const berachain = /* @__PURE__ */ defineChain({ | ||
id: 80094, | ||
name: "Berachain", | ||
nativeCurrency: { name: "BERA", symbol: "BERA", decimals: 18 }, | ||
blockExplorers: [ | ||
{ | ||
name: "berascan", | ||
url: "https://berascan.com/", | ||
apiUrl: "https://api.berascan.com/api", | ||
}, | ||
], | ||
}); |
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.
Add required rpcUrls
for connectivity
This definition currently lacks any RPC endpoints, so clients can’t connect to Berachain. Please include at least one RPC URL under rpcUrls
(for example:
rpcUrls: {
default: { http: ["https://rpc.berachain.com"] },
public: { http: ["https://rpc.berachain.com"] },
},
using the official RPC endpoints.
🤖 Prompt for AI Agents
In packages/thirdweb/src/chains/chain-definitions/berachain.ts between lines 6
and 17, the chain definition is missing the required rpcUrls property, which is
necessary for clients to connect to Berachain. Add an rpcUrls field with at
least one official RPC endpoint, for example, include rpcUrls: { default: {
http: ["https://rpc.berachain.com"] }, public: { http:
["https://rpc.berachain.com"] } } inside the defineChain object.
export const berachainBepolia = /* @__PURE__ */ defineChain({ | ||
id: 80069, | ||
name: "Berachain Bepolia", | ||
nativeCurrency: { name: "BERA", symbol: "BERA", decimals: 18 }, | ||
blockExplorers: [ | ||
{ | ||
name: "beratrail", | ||
url: "https://bepolia.beratrail.io/", | ||
}, | ||
], | ||
testnet: 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.
Add required rpcUrls
and ensure explorer consistency
- Include
rpcUrls
so that testnet clients can connect (e.g.,rpcUrls: { default: { http: ["https://rpc.bepolia.berachain.com"] } }
). - For consistency, verify if the BeraTrail explorer supports an API endpoint and, if so, add
apiUrl
to the block explorer entry.
🤖 Prompt for AI Agents
In packages/thirdweb/src/chains/chain-definitions/berachain-bepolia.ts between
lines 6 and 17, the chain definition is missing the required rpcUrls field
needed for testnet client connections. Add an rpcUrls property with the default
HTTP endpoint "https://rpc.bepolia.berachain.com". Also, check if the BeraTrail
block explorer supports an API endpoint; if it does, add an apiUrl field to the
blockExplorers entry to maintain consistency.
export { berachain } from "../chains/chain-definitions/berachain.js"; | ||
export { berachainBepolia } from "../chains/chain-definitions/berachain-bepolia.js"; |
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
Group exports by network type
berachain
is a mainnet and should be placed in the mainnet section with other primary chains. berachainBepolia
belongs in the testnet section. Please relocate these export lines to their respective groups to maintain logical ordering.
🤖 Prompt for AI Agents
In packages/thirdweb/src/exports/chains.ts around lines 86 to 87, the exports
for berachain and berachainBepolia are not grouped by network type. Move the
export of berachain to the mainnet section where other primary chains are
exported, and move the export of berachainBepolia to the testnet section to
maintain logical ordering by network type.
size-limit report 📦
|
Merge activity
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7343 +/- ##
==========================================
+ Coverage 52.42% 52.44% +0.01%
==========================================
Files 939 941 +2
Lines 63173 63199 +26
Branches 4223 4226 +3
==========================================
+ Hits 33116 33142 +26
Misses 29950 29950
Partials 107 107
🚀 New features to boost your workflow:
|
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces the `berachain` and `berachainBepolia` blockchain definitions to the `thirdweb` package, enhancing its chain support. It also updates the `chains` export file to include these new chains. ### Detailed summary - Added `berachain` and `berachainBepolia` definitions in their respective files. - Updated `packages/thirdweb/src/exports/chains.ts` to export `berachain` and `berachainBepolia`. - Defined `berachain` with an ID of 80094 and a native currency of `BERA`. - Defined `berachainBepolia` with an ID of 80069, marked as a testnet. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for the Berachain mainnet and Berachain Bepolia testnet networks, including native currency details and integrated block explorers for enhanced network visibility. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
9bce565
to
787118d
Compare
PR-Codex overview
This PR introduces new blockchain definitions for
berachain
andberachainBepolia
, enhancing thethirdweb
package with support for these chains.Detailed summary
.changeset/spicy-cooks-smoke.md
to indicate a minor version change forthirdweb
.berachain
andberachainBepolia
exports inpackages/thirdweb/src/exports/chains.ts
.berachain
inpackages/thirdweb/src/chains/chain-definitions/berachain.ts
with specific properties.berachainBepolia
inpackages/thirdweb/src/chains/chain-definitions/berachain-bepolia.ts
with testnet properties.Summary by CodeRabbit