Skip to content

Commit c003ea4

Browse files
authored
feat: Add Robinhood chain and Robinhood chain testnet (#382)
* Add chain configuration for Robinhood chain and Robinhood chain testnet * Add Robinhood chain and Robinhood chain testnet to site project
1 parent 8cd7207 commit c003ea4

3 files changed

Lines changed: 66 additions & 3 deletions

File tree

packages/gator-permissions-snap/src/core/chainMetadata.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ export const nameAndExplorerUrlByChainId: Record<
146146
0x64: { name: 'Gnosis', explorerUrl: 'https://gnosisscan.io' },
147147
0x82: { name: 'Unichain', explorerUrl: 'https://uniscan.xyz' },
148148
0x89: { name: 'Polygon Mainnet', explorerUrl: 'https://polygonscan.com' },
149+
0x1237: {
150+
name: 'Robinhood Chain',
151+
explorerUrl: 'https://robinhoodchain.blockscout.com',
152+
},
149153
0x2105: { name: 'Base', explorerUrl: 'https://basescan.org' },
150154
0xa4b1: { name: 'Arbitrum One', explorerUrl: 'https://arbiscan.io' },
151155
0xa4ba: {
@@ -173,6 +177,10 @@ export const nameAndExplorerUrlByChainId: Record<
173177
name: 'Gnosis Chiado Testnet',
174178
explorerUrl: 'https://gnosis-chiado.blockscout.com',
175179
},
180+
0xb626: {
181+
name: 'Robinhood Chain Testnet',
182+
explorerUrl: 'https://explorer.testnet.chain.robinhood.com',
183+
},
176184
0xe705: {
177185
name: 'Linea Sepolia Testnet',
178186
explorerUrl: 'https://sepolia.lineascan.build',

packages/site/.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
VITE_KERNEL_SNAP_ORIGIN=local:http://localhost:8081
33
VITE_GATOR_SNAP_ORIGIN=local:http://localhost:8082
44
VITE_BUNDLER_RPC_URL=https://<bundler-url>
5-
VITE_SUPPORTED_CHAINS=11155111
5+
# Comma-separated chain IDs. Includes Robinhood Chain (4663) and Robinhood Chain Testnet (46630).
6+
VITE_SUPPORTED_CHAINS=11155111,4663,46630

packages/site/src/config/chains.ts

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,62 @@
1-
import { extractChain } from 'viem';
1+
import { defineChain, extractChain } from 'viem';
22
import type { Chain } from 'viem';
33
import * as chains from 'viem/chains';
44

5-
const ALL_CHAINS = [...Object.values(chains)];
5+
/**
6+
* Robinhood Chain is not yet included in viem/chains.
7+
* Network details: https://docs.robinhood.com/chain/add-network-to-wallet/
8+
*/
9+
export const robinhoodChain = defineChain({
10+
id: 4663,
11+
name: 'Robinhood Chain',
12+
nativeCurrency: {
13+
name: 'Ether',
14+
symbol: 'ETH',
15+
decimals: 18,
16+
},
17+
rpcUrls: {
18+
default: {
19+
http: ['https://rpc.mainnet.chain.robinhood.com'],
20+
},
21+
},
22+
blockExplorers: {
23+
default: {
24+
name: 'Robinhood Chain Explorer',
25+
url: 'https://robinhoodchain.blockscout.com',
26+
},
27+
},
28+
});
29+
30+
/**
31+
* Robinhood Chain Testnet is not yet included in viem/chains.
32+
* Network details: https://docs.robinhood.com/chain/add-network-to-wallet/
33+
*/
34+
export const robinhoodChainTestnet = defineChain({
35+
id: 46630,
36+
name: 'Robinhood Chain Testnet',
37+
nativeCurrency: {
38+
name: 'Ether',
39+
symbol: 'ETH',
40+
decimals: 18,
41+
},
42+
rpcUrls: {
43+
default: {
44+
http: ['https://rpc.testnet.chain.robinhood.com'],
45+
},
46+
},
47+
blockExplorers: {
48+
default: {
49+
name: 'Robinhood Chain Testnet Explorer',
50+
url: 'https://explorer.testnet.chain.robinhood.com',
51+
},
52+
},
53+
});
54+
55+
const ALL_CHAINS = [
56+
...Object.values(chains),
57+
robinhoodChain,
58+
robinhoodChainTestnet,
59+
];
660

761
const DEFAULT_CHAINS = [chains.sepolia];
862

0 commit comments

Comments
 (0)