Validates whether a chain ID represents a supported Vana network.
The chain ID to validate
true if the chain ID is a supported Vana network, false otherwise
true
false
Type guard for runtime validation of chain IDs from external sources. Use when accepting user input or processing network configurations.
const chainId = parseInt(process.env.CHAIN_ID);if (!isVanaChainId(chainId)) { throw new Error(`Unsupported chain ID: ${chainId}`);}// TypeScript now knows chainId is VanaChainIdconst config = getChainConfig(chainId); Copy
const chainId = parseInt(process.env.CHAIN_ID);if (!isVanaChainId(chainId)) { throw new Error(`Unsupported chain ID: ${chainId}`);}// TypeScript now knows chainId is VanaChainIdconst config = getChainConfig(chainId);
Validates whether a chain ID represents a supported Vana network.