Vana SDK - v2.2.2
    Preparing search index...

    Function isVanaChainId

    • Validates whether a chain ID represents a supported Vana network.

      Parameters

      • chainId: number

        The chain ID to validate

      Returns chainId is VanaChainId

      true if the chain ID is a supported Vana network, false otherwise

      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 VanaChainId
      const config = getChainConfig(chainId);