Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add NEAR Protocol chains. #3224

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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