Skip to content

isEthereum

The isEthereum utility is designed to verify if the chain id is a valid Ethereum Mainnet or Ethereum Sepolia chain id.

Usage

code
import { isEthereum } from '@coinbase/onchainkit';
 
const chainId = 1;
 
if (isEthereum({ chainId })) {
  console.log('The chainId is Ethereum Mainnet or Ethereum Sepolia.');
} else {
  console.log('The chainId is not Ethereum.');
}

Returns

boolean - Returns true if the chain id is Ethereum Mainnet or Ethereum Sepolia, otherwise false.

Parameters

isEthereumOptions