Skip to content

Commit 1a235e6

Browse files
authored
feat: add NEAR Protocol chains (#3224)
1 parent f4009ad commit 1a235e6

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

.changeset/shaggy-zebras-camp.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"viem": patch
3+
---
4+
5+
Added NEAR Protocol chains.

src/chains/definitions/near.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { defineChain } from '../../utils/chain/defineChain.js'
2+
3+
export const near = /*#__PURE__*/ defineChain({
4+
id: 397,
5+
name: 'NEAR Protocol',
6+
nativeCurrency: {
7+
decimals: 18,
8+
name: 'NEAR',
9+
symbol: 'NEAR',
10+
},
11+
rpcUrls: {
12+
default: { http: ['https://eth-rpc.mainnet.near.org'] },
13+
},
14+
blockExplorers: {
15+
default: {
16+
name: 'NEAR Explorer',
17+
url: 'https://eth-explorer.near.org',
18+
},
19+
},
20+
testnet: false,
21+
})
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { defineChain } from '../../utils/chain/defineChain.js'
2+
3+
export const nearTestnet = /*#__PURE__*/ defineChain({
4+
id: 398,
5+
name: 'NEAR Protocol Testnet',
6+
nativeCurrency: {
7+
decimals: 18,
8+
name: 'NEAR',
9+
symbol: 'NEAR',
10+
},
11+
rpcUrls: {
12+
default: { http: ['https://eth-rpc.testnet.near.org'] },
13+
},
14+
blockExplorers: {
15+
default: {
16+
name: 'NEAR Explorer',
17+
url: 'https://eth-explorer-testnet.near.org',
18+
},
19+
},
20+
testnet: true,
21+
})

src/chains/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ export { morphHolesky } from './definitions/morphHolesky.js'
300300
export { morphSepolia } from './definitions/morphSepolia.js'
301301
export { nahmii } from './definitions/nahmii.js'
302302
export { nautilus } from './definitions/nautilus.js'
303+
export { near } from './definitions/near.js'
304+
export { nearTestnet } from './definitions/nearTestnet.js'
303305
export { neonDevnet } from './definitions/neonDevnet.js'
304306
export { neonMainnet } from './definitions/neonMainnet.js'
305307
export { neoxMainnet } from './definitions/neoxMainnet.js'

0 commit comments

Comments
 (0)