Skip to content

Add etherlink chain #7634

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

Merged
merged 1 commit into from
Jul 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/early-shoes-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

feat(chains): add Etherlink mainnet and testnet chains
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineChain } from "../utils.js";

/**
* @chain
*/
export const etherlinkTestnet = /* @__PURE__ */ defineChain({
blockExplorers: [
{
name: "Etherlink Testnet Explorer",
url: "https://testnet.explorer.etherlink.com/",
},
],
id: 128123,
name: "Etherlink Testnet",
nativeCurrency: {
decimals: 18,
name: "Etherlink",
symbol: "XTZ",
},
testnet: true,
});
20 changes: 20 additions & 0 deletions packages/thirdweb/src/chains/chain-definitions/etherlink.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineChain } from "../utils.js";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing eslint-disable guard for defineChain.

Other chain-definition files in this repo add
// eslint-disable-next-line no-restricted-syntax immediately before the defineChain import to bypass the custom lint rule that forbids direct usage.
Add the same line here or CI will fail.

+// eslint-disable-next-line no-restricted-syntax
 import { defineChain } from "../utils.js";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { defineChain } from "../utils.js";
// eslint-disable-next-line no-restricted-syntax
import { defineChain } from "../utils.js";
🤖 Prompt for AI Agents
In packages/thirdweb/src/chains/chain-definitions/etherlink.ts at line 1, add
the comment 
// eslint-disable-next-line no-restricted-syntax immediately before the import
statement 
for defineChain to disable the lint rule that forbids direct usage. This will
prevent 
CI failures due to lint errors.


/**
* @chain
*/
export const etherlink = /* @__PURE__ */ defineChain({
blockExplorers: [
{
name: "Etherlink Explorer",
url: "https://explorer.etherlink.com/",
},
],
id: 42793,
name: "Etherlink",
nativeCurrency: {
decimals: 18,
name: "Etherlink",
symbol: "XTZ",
},
});
2 changes: 2 additions & 0 deletions packages/thirdweb/src/exports/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export { cronos } from "../chains/chain-definitions/cronos.js";
export { degen } from "../chains/chain-definitions/degen.js";
// mainnet = alias for ethereum
export { ethereum, mainnet } from "../chains/chain-definitions/ethereum.js";
export { etherlink } from "../chains/chain-definitions/etherlink.js";
export { etherlinkTestnet } from "../chains/chain-definitions/etherlink-testnet.js";
export { fantom } from "../chains/chain-definitions/fantom.js";
export { fantomTestnet } from "../chains/chain-definitions/fantom-testnet.js";
export { frameTestnet } from "../chains/chain-definitions/frame-testnet.js";
Expand Down
Loading