mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
refactor: Move official RPC url to HlChainSpec
This commit is contained in:
@ -137,3 +137,16 @@ impl HlHardforks for Arc<HlChainSpec> {
|
||||
self.as_ref().hl_fork_activation(fork)
|
||||
}
|
||||
}
|
||||
|
||||
impl HlChainSpec {
|
||||
pub const MAINNET_RPC_URL: &str = "https://rpc.hyperliquid.xyz/evm";
|
||||
pub const TESTNET_RPC_URL: &str = "https://rpc.hyperliquid-testnet.xyz/evm";
|
||||
|
||||
pub fn official_rpc_url(&self) -> &'static str {
|
||||
match self.inner.chain().id() {
|
||||
999 => Self::MAINNET_RPC_URL,
|
||||
998 => Self::TESTNET_RPC_URL,
|
||||
_ => unreachable!("Unreachable since ChainSpecParser won't return other chains"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user