Skip to content

Commit

Permalink
feat: Add NEAR Protocol chains.
Browse files Browse the repository at this point in the history
  • Loading branch information
paouvrard committed Jan 14, 2025
1 parent f4009ad commit 52b02fb
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-zebras-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

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

export const near = /*#__PURE__*/ defineChain({
id: 397,
name: 'NEAR Protocol',
nativeCurrency: {
decimals: 18,
name: 'NEAR',
symbol: 'NEAR',
},
rpcUrls: {
default: { http: ['https://eth-rpc.mainnet.near.org'] },
},
blockExplorers: {
default: {
name: 'NEAR Explorer',
url: 'https://eth-explorer.near.org',
},
},
testnet: false,
})
21 changes: 21 additions & 0 deletions src/chains/definitions/nearTestnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const nearTestnet = /*#__PURE__*/ defineChain({
id: 398,
name: 'NEAR Protocol Testnet',
nativeCurrency: {
decimals: 18,
name: 'NEAR',
symbol: 'NEAR',
},
rpcUrls: {
default: { http: ['https://eth-rpc.testnet.near.org'] },
},
blockExplorers: {
default: {
name: 'NEAR Explorer',
url: 'https://eth-explorer-testnet.near.org',
},
},
testnet: true,
})
2 changes: 2 additions & 0 deletions src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ export { morphHolesky } from './definitions/morphHolesky.js'
export { morphSepolia } from './definitions/morphSepolia.js'
export { nahmii } from './definitions/nahmii.js'
export { nautilus } from './definitions/nautilus.js'
export { near } from './definitions/near.js'
export { nearTestnet } from './definitions/nearTestnet.js'
export { neonDevnet } from './definitions/neonDevnet.js'
export { neonMainnet } from './definitions/neonMainnet.js'
export { neoxMainnet } from './definitions/neoxMainnet.js'
Expand Down

0 comments on commit 52b02fb

Please sign in to comment.