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

    Function isVanaChain

    • Validates whether a Chain object represents a supported Vana network.

      Parameters

      • chain: Chain

        The chain object to validate

      Returns chain is VanaChain

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

      Type guard for validating viem Chain objects as Vana chains. Ensures both type safety and runtime validation for chain compatibility.

      import { mainnet, mokshaTestnet } from 'viem/chains';

      if (isVanaChain(chain)) {
      // TypeScript knows this is a VanaChain
      console.log(`Connected to Vana network: ${chain.id}`);
      } else {
      console.error('Please connect to a Vana network');
      }