From 414ff36553ff5db53aee6488ead29bcdee82fb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Van=20Eyck?= Date: Mon, 24 Jul 2023 15:26:12 +0200 Subject: [PATCH] feat: add linea support (#390) * feat: added linea support * feat: add multicall info for linea mainnet * feat: change etherscan explorer urls --- .changeset/perfect-lobsters-chew.md | 5 ++++ packages/chains/src/index.ts | 1 + packages/chains/src/linea.ts | 43 +++++++++++++++++++++++++++++ packages/chains/src/lineaTestnet.ts | 14 ++++++++-- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 .changeset/perfect-lobsters-chew.md create mode 100644 packages/chains/src/linea.ts diff --git a/.changeset/perfect-lobsters-chew.md b/.changeset/perfect-lobsters-chew.md new file mode 100644 index 00000000..2a29d374 --- /dev/null +++ b/.changeset/perfect-lobsters-chew.md @@ -0,0 +1,5 @@ +--- +"@wagmi/chains": patch +--- + +Added Linea support diff --git a/packages/chains/src/index.ts b/packages/chains/src/index.ts index 2663fb28..3d35f150 100644 --- a/packages/chains/src/index.ts +++ b/packages/chains/src/index.ts @@ -57,6 +57,7 @@ export { haqqMainnet } from './haqqMainnet' export { haqqTestedge2 } from './haqqTestedge2' export { klaytn } from './klaytn' export { lineaTestnet } from './lineaTestnet' +export { linea } from './linea' export { localhost } from './localhost' export { mainnet } from './mainnet' export { mantle } from './mantle' diff --git a/packages/chains/src/linea.ts b/packages/chains/src/linea.ts new file mode 100644 index 00000000..fcd2272b --- /dev/null +++ b/packages/chains/src/linea.ts @@ -0,0 +1,43 @@ +import { Chain } from './types' + +export const linea = { + id: 59_144, + name: 'Linea Mainnet', + network: 'linea-mainnet', + nativeCurrency: { name: 'Linea Ether', symbol: 'ETH', decimals: 18 }, + rpcUrls: { + infura: { + http: ['https://linea-mainnet.infura.io/v3'], + webSocket: ['wss://linea-mainnet.infura.io/ws/v3'], + }, + default: { + http: ['https://rpc.linea.build'], + webSocket: ['wss://rpc.linea.build'], + }, + public: { + http: ['https://rpc.linea.build'], + webSocket: ['wss://rpc.linea.build'], + }, + }, + blockExplorers: { + default: { + name: 'Etherscan', + url: 'https://lineascan.build', + }, + etherscan: { + name: 'Etherscan', + url: 'https://lineascan.build', + }, + blockscout: { + name: 'Blockscout', + url: 'https://explorer.linea.build', + }, + }, + contracts: { + multicall3: { + address: '0xcA11bde05977b3631167028862bE2a173976CA11', + blockCreated: 42, + }, + }, + testnet: false, +} as const satisfies Chain diff --git a/packages/chains/src/lineaTestnet.ts b/packages/chains/src/lineaTestnet.ts index 9b5f3c39..888b861e 100644 --- a/packages/chains/src/lineaTestnet.ts +++ b/packages/chains/src/lineaTestnet.ts @@ -7,8 +7,8 @@ export const lineaTestnet = { nativeCurrency: { name: 'Linea Ether', symbol: 'ETH', decimals: 18 }, rpcUrls: { infura: { - http: ['https://consensys-zkevm-goerli-prealpha.infura.io/v3'], - webSocket: ['wss://consensys-zkevm-goerli-prealpha.infura.io/ws/v3'], + http: ['https://linea-goerli.infura.io/v3'], + webSocket: ['wss://linea-goerli.infura.io/ws/v3'], }, default: { http: ['https://rpc.goerli.linea.build'], @@ -21,7 +21,15 @@ export const lineaTestnet = { }, blockExplorers: { default: { - name: 'BlockScout', + name: 'Etherscan', + url: 'https://goerli.lineascan.build', + }, + etherscan: { + name: 'Etherscan', + url: 'https://goerli.lineascan.build', + }, + blockscout: { + name: 'Blockscout', url: 'https://explorer.goerli.linea.build', }, },