Skip to content

Commit

Permalink
feat: add Xai mainnet and testnet chains. (#2393)
Browse files Browse the repository at this point in the history
Added Xai and Xai testnet chains.
  • Loading branch information
venticello authored Jun 12, 2024
1 parent b80ec49 commit f624e23
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nasty-zoos-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Added Xai and Xai testnet chains.
25 changes: 25 additions & 0 deletions src/chains/definitions/xai.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const xai = /*#__PURE__*/ defineChain({
id: 660279,
name: 'Xai Mainnet',
nativeCurrency: { name: 'Xai', symbol: 'XAI', decimals: 18 },
rpcUrls: {
default: {
http: ['https://xai-chain.net/rpc'],
},
},
blockExplorers: {
default: {
name: 'Blockscout',
url: 'https://explorer.xai-chain.net',
},
},
contracts: {
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 222549,
},
},
testnet: false,
})
19 changes: 19 additions & 0 deletions src/chains/definitions/xaiTestnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const xaiTestnet = /*#__PURE__*/ defineChain({
id: 37714555429,
name: 'Xai Testnet',
nativeCurrency: { name: 'sXai', symbol: 'sXAI', decimals: 18 },
rpcUrls: {
default: {
http: ['https://testnet-v2.xai-chain.net/rpc'],
},
},
blockExplorers: {
default: {
name: 'Blockscout',
url: 'https://testnet-explorer-v2.xai-chain.net',
},
},
testnet: true,
})
2 changes: 2 additions & 0 deletions src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ export {
x1Testnet,
} from './definitions/xLayerTestnet.js'
export { xLayer } from './definitions/xLayer.js'
export { xai } from './definitions/xai.js'
export { xaiTestnet } from './definitions/xaiTestnet.js'
export { xdc } from './definitions/xdc.js'
export { xdcTestnet } from './definitions/xdcTestnet.js'
export { yooldoVerse } from './definitions/yooldoVerse.js'
Expand Down

0 comments on commit f624e23

Please sign in to comment.