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';
const chainId = 8453;
if (isBase({ chainId })) {
console.log('The chainId is Base.');
} else {
console.log('The chainId is not Base.');
}
Returns
boolean
- Returns true
if the chain id is Base or Base Sepolia, otherwise false
.