Skip to content

Commit

Permalink
add world chain networks (#2738)
Browse files Browse the repository at this point in the history
* add world chain networks

* chore: changeset

---------

Co-authored-by: Tom Meagher <[email protected]>
  • Loading branch information
johncpalmer and tmm authored Sep 18, 2024
1 parent e015630 commit 15c71b6
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/chatty-spies-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Added World Chain
18 changes: 18 additions & 0 deletions src/chains/definitions/worldchain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const worldchain = /*#__PURE__*/ defineChain({
id: 480,
name: 'World Chain',
network: 'worldchain',
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: { http: ['https://worldchain-mainnet.g.alchemy.com/public'] },
},
blockExplorers: {
default: {
name: 'World Chain Explorer',
url: 'https://worldchain-mainnet.explorer.alchemy.com',
},
},
testnet: false,
})
19 changes: 19 additions & 0 deletions src/chains/definitions/worldchainSepolia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const worldchainSepolia = /*#__PURE__*/ defineChain({
id: 4801,
name: 'World Chain Sepolia',
network: 'worldchain-sepolia',
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: { http: ['https://worldchain-sepolia.g.alchemy.com/public'] },
public: { http: ['https://worldchain-sepolia.g.alchemy.com/public'] },
},
blockExplorers: {
default: {
name: 'World Chain Sepolia Explorer',
url: 'https://worldchain-sepolia.explorer.alchemy.com',
},
},
testnet: true,
})
2 changes: 2 additions & 0 deletions src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ export { wanchain } from './definitions/wanchain.js'
export { wanchainTestnet } from './definitions/wanchainTestnet.js'
export { wemix } from './definitions/wemix.js'
export { wemixTestnet } from './definitions/wemixTestnet.js'
export { worldchain } from './definitions/worldchain.js'
export { worldchainSepolia } from './definitions/worldchainSepolia.js'
export {
xLayerTestnet,
/** @deprecated Use `xLayerTestnet` */
Expand Down

0 comments on commit 15c71b6

Please sign in to comment.