From 787118d36765b9f57113cb62c606e494e715be04 Mon Sep 17 00:00:00 2001 From: Yash094 <67926590+Yash094@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:03:17 +0000 Subject: [PATCH] feat: add berachain and berachain-bepolia chains (#7343) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## 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}` ## 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. --- .changeset/spicy-cooks-smoke.md | 5 +++++ .../chain-definitions/berachain-bepolia.ts | 17 +++++++++++++++++ .../src/chains/chain-definitions/berachain.ts | 17 +++++++++++++++++ packages/thirdweb/src/exports/chains.ts | 2 ++ 4 files changed, 41 insertions(+) create mode 100644 .changeset/spicy-cooks-smoke.md create mode 100644 packages/thirdweb/src/chains/chain-definitions/berachain-bepolia.ts create mode 100644 packages/thirdweb/src/chains/chain-definitions/berachain.ts diff --git a/.changeset/spicy-cooks-smoke.md b/.changeset/spicy-cooks-smoke.md new file mode 100644 index 00000000000..ad324897643 --- /dev/null +++ b/.changeset/spicy-cooks-smoke.md @@ -0,0 +1,5 @@ +--- +"thirdweb": minor +--- + +add berachain and berachain testnet in chains package diff --git a/packages/thirdweb/src/chains/chain-definitions/berachain-bepolia.ts b/packages/thirdweb/src/chains/chain-definitions/berachain-bepolia.ts new file mode 100644 index 00000000000..5d6a8fd83ef --- /dev/null +++ b/packages/thirdweb/src/chains/chain-definitions/berachain-bepolia.ts @@ -0,0 +1,17 @@ +import { defineChain } from "../utils.js"; + +/** + * @chain + */ +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, +}); diff --git a/packages/thirdweb/src/chains/chain-definitions/berachain.ts b/packages/thirdweb/src/chains/chain-definitions/berachain.ts new file mode 100644 index 00000000000..b86af27b83f --- /dev/null +++ b/packages/thirdweb/src/chains/chain-definitions/berachain.ts @@ -0,0 +1,17 @@ +import { defineChain } from "../utils.js"; + +/** + * @chain + */ +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", + }, + ], +}); diff --git a/packages/thirdweb/src/exports/chains.ts b/packages/thirdweb/src/exports/chains.ts index f1ea4357358..8c4271be4c4 100644 --- a/packages/thirdweb/src/exports/chains.ts +++ b/packages/thirdweb/src/exports/chains.ts @@ -83,3 +83,5 @@ export { soneiumMinato } from "../chains/chain-definitions/soneium-minato.js"; export { treasure } from "../chains/chain-definitions/treasure.js"; export { treasureTopaz } from "../chains/chain-definitions/treasureTopaz.js"; export { monadTestnet } from "../chains/chain-definitions/monad-testnet.js"; +export { berachain } from "../chains/chain-definitions/berachain.js"; +export { berachainBepolia } from "../chains/chain-definitions/berachain-bepolia.js";