From ec75d9502c308c87fdf620769b66e1c87679c7ab Mon Sep 17 00:00:00 2001 From: Yash094 <67926590+Yash094@users.noreply.github.com> Date: Wed, 2 Jul 2025 11:03:10 +0000 Subject: [PATCH] feat(chains): add Core testnet and mainnet chains (#7486) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR introduces two new chain definitions for `Core` and `Core Testnet` to the `thirdweb` package, enhancing its blockchain support. ### Detailed summary - Added `coreMainnet` definition in `core-mainnet.ts` with block explorer and native currency details. - Added `coreTestnet` definition in `core-testnet.ts` with block explorer, native currency details, and testnet flag. - Exported both `coreMainnet` and `coreTestnet` in `chains.ts`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` ## Summary by CodeRabbit * **New Features** * Added support for the Core mainnet and Core testnet blockchain networks. * Users can now interact with these new chains, including viewing block explorer links and using native currency details. --- .changeset/afraid-rats-open.md | 5 +++++ .../chains/chain-definitions/core-mainnet.ts | 20 ++++++++++++++++++ .../chains/chain-definitions/core-testnet.ts | 21 +++++++++++++++++++ packages/thirdweb/src/exports/chains.ts | 2 ++ 4 files changed, 48 insertions(+) create mode 100644 .changeset/afraid-rats-open.md create mode 100644 packages/thirdweb/src/chains/chain-definitions/core-mainnet.ts create mode 100644 packages/thirdweb/src/chains/chain-definitions/core-testnet.ts diff --git a/.changeset/afraid-rats-open.md b/.changeset/afraid-rats-open.md new file mode 100644 index 00000000000..af5aaba61df --- /dev/null +++ b/.changeset/afraid-rats-open.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +add core chains diff --git a/packages/thirdweb/src/chains/chain-definitions/core-mainnet.ts b/packages/thirdweb/src/chains/chain-definitions/core-mainnet.ts new file mode 100644 index 00000000000..c4a06c58ddb --- /dev/null +++ b/packages/thirdweb/src/chains/chain-definitions/core-mainnet.ts @@ -0,0 +1,20 @@ +import { defineChain } from "../utils.js"; + +/** + * @chain + */ +export const coreMainnet = /* @__PURE__ */ defineChain({ + blockExplorers: [ + { + name: "Core Scan", + url: "https://scan.coredao.org/", + }, + ], + id: 1116, + name: "Core", + nativeCurrency: { + decimals: 18, + name: "Ether", + symbol: "ETH", + }, +}); diff --git a/packages/thirdweb/src/chains/chain-definitions/core-testnet.ts b/packages/thirdweb/src/chains/chain-definitions/core-testnet.ts new file mode 100644 index 00000000000..4fda5e1d671 --- /dev/null +++ b/packages/thirdweb/src/chains/chain-definitions/core-testnet.ts @@ -0,0 +1,21 @@ +import { defineChain } from "../utils.js"; + +/** + * @chain + */ +export const coreTestnet = /* @__PURE__ */ defineChain({ + blockExplorers: [ + { + name: "Core Testnet Scan", + url: "https://scan.test2.btcs.network/", + }, + ], + id: 1114, + name: "Core Testnet", + nativeCurrency: { + decimals: 18, + name: "Ether", + symbol: "ETH", + }, + testnet: true, +}); diff --git a/packages/thirdweb/src/exports/chains.ts b/packages/thirdweb/src/exports/chains.ts index 4ff5fcb0ea2..c6f80aeb863 100644 --- a/packages/thirdweb/src/exports/chains.ts +++ b/packages/thirdweb/src/exports/chains.ts @@ -24,6 +24,8 @@ export { bsc } from "../chains/chain-definitions/bsc.js"; export { bscTestnet } from "../chains/chain-definitions/bsc-testnet.js"; export { celo } from "../chains/chain-definitions/celo.js"; export { celoAlfajoresTestnet } from "../chains/chain-definitions/celo-alfajores-testnet.js"; +export { coreMainnet } from "../chains/chain-definitions/core-mainnet.js"; +export { coreTestnet } from "../chains/chain-definitions/core-testnet.js"; export { cronos } from "../chains/chain-definitions/cronos.js"; export { degen } from "../chains/chain-definitions/degen.js"; // mainnet = alias for ethereum