Skip to content

Commit

Permalink
feat: add Linea Sepolia chain (#2056)
Browse files Browse the repository at this point in the history
* feat: Add Linea Sepolia chain

* fix: format code

* fix: deprecate lineaTestnet in favor of lineaGoerli
  • Loading branch information
VGau committed Apr 3, 2024
1 parent 21f4387 commit 368d8e6
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/smart-timers-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"viem": patch
---

Added Linea Sepolia chain.
Updated Linea Goerli export name.
27 changes: 27 additions & 0 deletions src/chains/definitions/lineaGoerli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const lineaGoerli = /*#__PURE__*/ defineChain({
id: 59_140,
name: 'Linea Goerli Testnet',
nativeCurrency: { name: 'Linea Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: ['https://rpc.goerli.linea.build'],
webSocket: ['wss://rpc.goerli.linea.build'],
},
},
blockExplorers: {
default: {
name: 'Etherscan',
url: 'https://goerli.lineascan.build',
apiUrl: 'https://api-goerli.lineascan.build/api',
},
},
contracts: {
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 498623,
},
},
testnet: true,
})
27 changes: 27 additions & 0 deletions src/chains/definitions/lineaSepolia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const lineaSepolia = /*#__PURE__*/ defineChain({
id: 59_141,
name: 'Linea Sepolia Testnet',
nativeCurrency: { name: 'Linea Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: ['https://rpc.sepolia.linea.build'],
webSocket: ['wss://rpc.sepolia.linea.build'],
},
},
blockExplorers: {
default: {
name: 'Etherscan',
url: 'https://sepolia.lineascan.build',
apiUrl: 'https://api-sepolia.lineascan.build/api',
},
},
contracts: {
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 227427,
},
},
testnet: true,
})
3 changes: 3 additions & 0 deletions src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ export { kromaSepolia } from './definitions/kromaSepolia.js'
export { lightlinkPegasus } from './definitions/lightlinkPegasus.js'
export { lightlinkPhoenix } from './definitions/lightlinkPhoenix.js'
export { linea } from './definitions/linea.js'
export { lineaGoerli } from './definitions/lineaGoerli.js'
export { lineaSepolia } from './definitions/lineaSepolia.js'
/** @deprecated Use `lineaGoerli` instead. */
export { lineaTestnet } from './definitions/lineaTestnet.js'
export { liskSepolia } from './definitions/liskSepolia.js'
export { localhost } from './definitions/localhost.js'
Expand Down

0 comments on commit 368d8e6

Please sign in to comment.