Skip to content

Commit

Permalink
feat: add kaia chain (#2643)
Browse files Browse the repository at this point in the history
* feat: change klaytn to kaia chain

* fix: keep the original chains

* Update kaia.ts

* Create sour-ads-reflect.md

---------

Co-authored-by: jxom <j@wevm.dev>
  • Loading branch information
0oooooooo0 and jxom authored Aug 27, 2024
1 parent 6c0a254 commit 8ac740e
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 41 deletions.
5 changes: 5 additions & 0 deletions .changeset/sour-ads-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

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

export const kaia = /*#__PURE__*/ defineChain({
id: 8_217,
name: 'Kaia',
nativeCurrency: {
decimals: 18,
name: 'Kaia',
symbol: 'KAIA',
},
rpcUrls: {
default: { http: ['https://public-en.node.kaia.io'] },
},
blockExplorers: {
default: {
name: 'KaiaScope',
url: 'https://kaiascope.com',
},
},
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 96002415,
},
},
})
28 changes: 28 additions & 0 deletions src/chains/definitions/kairos.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const kairos = /*#__PURE__*/ defineChain({
id: 1_001,
name: 'Kairos Testnet',
network: 'kairos',
nativeCurrency: {
decimals: 18,
name: 'Kairos KAIA',
symbol: 'KAIA',
},
rpcUrls: {
default: { http: ['https://public-en-kairos.node.kaia.io'] },
},
blockExplorers: {
default: {
name: 'KaiaScope',
url: 'https://kairos.kaiascope.com',
},
},
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 123390593,
},
},
testnet: true,
})
38 changes: 19 additions & 19 deletions src/chains/definitions/klaytn.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const klaytn = /*#__PURE__*/ defineChain({
id: 8_217,
name: 'Klaytn',
nativeCurrency: {
decimals: 18,
id: 8_217,
name: 'Klaytn',
symbol: 'KLAY',
},
rpcUrls: {
default: { http: ['https://public-en-cypress.klaytn.net'] },
},
blockExplorers: {
default: {
name: 'KlaytnScope',
url: 'https://scope.klaytn.com',
nativeCurrency: {
decimals: 18,
name: 'Klaytn',
symbol: 'KLAY',
},
},
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 96002415,
rpcUrls: {
default: { http: ['https://public-en-cypress.klaytn.net'] },
},
blockExplorers: {
default: {
name: 'KlaytnScope',
url: 'https://scope.klaytn.com',
},
},
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 96002415,
},
},
},
})
44 changes: 22 additions & 22 deletions src/chains/definitions/klaytnBaobab.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const klaytnBaobab = /*#__PURE__*/ defineChain({
id: 1_001,
name: 'Klaytn Baobab Testnet',
network: 'klaytn-baobab',
nativeCurrency: {
decimals: 18,
name: 'Baobab Klaytn',
symbol: 'KLAY',
},
rpcUrls: {
default: { http: ['https://public-en-baobab.klaytn.net'] },
},
blockExplorers: {
default: {
name: 'KlaytnScope',
url: 'https://baobab.klaytnscope.com',
id: 1_001,
name: 'Klaytn Baobab Testnet',
network: 'klaytn-baobab',
nativeCurrency: {
decimals: 18,
name: 'Baobab Klaytn',
symbol: 'KLAY',
},
},
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 123390593,
rpcUrls: {
default: { http: ['https://public-en-baobab.klaytn.net'] },
},
},
testnet: true,
blockExplorers: {
default: {
name: 'KlaytnScope',
url: 'https://baobab.klaytnscope.com',
},
},
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 123390593,
},
},
testnet: true,
})
4 changes: 4 additions & 0 deletions src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,12 @@ export { kakarotSepolia } from './definitions/kakarotSepolia.js'
export { kava } from './definitions/kava.js'
export { kavaTestnet } from './definitions/kavaTestnet.js'
export { kcc } from './definitions/kcc.js'
/** @deprecated Use `kaia` instead. */
export { klaytn } from './definitions/klaytn.js'
/** @deprecated Use `kairos` instead. */
export { klaytnBaobab } from './definitions/klaytnBaobab.js'
export { kaia } from './definitions/kaia.js'
export { kairos } from './definitions/kairos.js'
export { koi } from './definitions/koi.js'
export { kroma } from './definitions/kroma.js'
export { kromaSepolia } from './definitions/kromaSepolia.js'
Expand Down

0 comments on commit 8ac740e

Please sign in to comment.