Skip to content

isBase

The isBase utility is designed to verify if the chain id is a valid Base or Base Sepolia chain id.

Usage

code
import { isBase } from '@coinbase/onchainkit';
 
// Base Mainnet (chain ID: 8453)
isBase({ chainId: 8453 }); // returns true
 
// Base Sepolia (chain ID: 84532)
isBase({ chainId: 84532 }); // returns true
 
// Ethereum (chain ID: 1)
isBase({ chainId: 1 }); // returns false

Returns

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

Parameters

IsBaseOptions - See IsBaseOptions for more details.