Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Add linea support #390

Merged
merged 3 commits into from
Jul 24, 2023
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/perfect-lobsters-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wagmi/chains": patch
---

Added Linea support
1 change: 1 addition & 0 deletions packages/chains/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
43 changes: 43 additions & 0 deletions packages/chains/src/linea.ts
Original file line number Diff line number Diff line change
@@ -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
14 changes: 11 additions & 3 deletions packages/chains/src/lineaTestnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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',
},
},
Expand Down