From f8a2f725f0000fdcc2ece84328c334854e2f63ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Van=20Eyck?= Date: Wed, 28 Jun 2023 10:17:45 +0200 Subject: [PATCH] feat: added linea support --- .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 45cb89cd..8b7a19e5 100644 --- a/packages/chains/src/index.ts +++ b/packages/chains/src/index.ts @@ -56,6 +56,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..02f5022a --- /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: 'Blockscout', + url: 'https://explorer.linea.build', + }, + etherscan: { + name: 'Etherscan', + url: 'https://lineascan.io', + }, + blockscout: { + name: 'Blockscout', + url: 'https://explorer.linea.build', + }, + }, + contracts: { + multicall3: { + address: '0x0', + blockCreated: 0, + }, + }, + testnet: false, +} as const satisfies Chain diff --git a/packages/chains/src/lineaTestnet.ts b/packages/chains/src/lineaTestnet.ts index 9b5f3c39..09ef3ad1 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/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.io', + }, + etherscan: { + name: 'Etherscan', + url: 'https://goerli.lineascan.io', + }, + blockscout: { + name: 'Blockscout', url: 'https://explorer.goerli.linea.build', }, },