Skip to content

Commit ec75d95

Browse files
committed
feat(chains): add Core testnet and mainnet chains (#7486)
<!-- ## 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 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}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 85c4ef1 commit ec75d95

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

.changeset/afraid-rats-open.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
add core chains
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { defineChain } from "../utils.js";
2+
3+
/**
4+
* @chain
5+
*/
6+
export const coreMainnet = /* @__PURE__ */ defineChain({
7+
blockExplorers: [
8+
{
9+
name: "Core Scan",
10+
url: "https://scan.coredao.org/",
11+
},
12+
],
13+
id: 1116,
14+
name: "Core",
15+
nativeCurrency: {
16+
decimals: 18,
17+
name: "Ether",
18+
symbol: "ETH",
19+
},
20+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { defineChain } from "../utils.js";
2+
3+
/**
4+
* @chain
5+
*/
6+
export const coreTestnet = /* @__PURE__ */ defineChain({
7+
blockExplorers: [
8+
{
9+
name: "Core Testnet Scan",
10+
url: "https://scan.test2.btcs.network/",
11+
},
12+
],
13+
id: 1114,
14+
name: "Core Testnet",
15+
nativeCurrency: {
16+
decimals: 18,
17+
name: "Ether",
18+
symbol: "ETH",
19+
},
20+
testnet: true,
21+
});

packages/thirdweb/src/exports/chains.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export { bsc } from "../chains/chain-definitions/bsc.js";
2424
export { bscTestnet } from "../chains/chain-definitions/bsc-testnet.js";
2525
export { celo } from "../chains/chain-definitions/celo.js";
2626
export { celoAlfajoresTestnet } from "../chains/chain-definitions/celo-alfajores-testnet.js";
27+
export { coreMainnet } from "../chains/chain-definitions/core-mainnet.js";
28+
export { coreTestnet } from "../chains/chain-definitions/core-testnet.js";
2729
export { cronos } from "../chains/chain-definitions/cronos.js";
2830
export { degen } from "../chains/chain-definitions/degen.js";
2931
// mainnet = alias for ethereum

0 commit comments

Comments
 (0)