isEthereum utility is designed to verify if the chain id is a valid Ethereum Mainnet or Ethereum Sepolia chain id.
Usage
Returns
boolean - Returns true if the chain id is Ethereum Mainnet or Ethereum Sepolia, otherwise false.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
isEthereum utility is designed to verify if the chain id is a valid Ethereum Mainnet or Ethereum Sepolia chain id.
import { isEthereum } from '@coinbase/onchainkit';
// Ethereum Mainnet (chain ID: 1)
isEthereum({ chainId: 1 }); // returns true
// Ethereum Sepolia (chain ID: 11155111)
isEthereum({ chainId: 11155111 }); // returns true
// Base (chain ID: 8453)
isEthereum({ chainId: 8453 }); // returns false
true; // When chainId is 1 (Ethereum Mainnet) or 11155111 (Ethereum Sepolia)
false; // For all other chain IDs
boolean - Returns true if the chain id is Ethereum Mainnet or Ethereum Sepolia, otherwise false.
Was this page helpful?