Skip to content

isSupportedChainId

isSupportedChainId(chainId): chainId is 1 | 137 | 1001 | 8217 | 43113 | 43114 | 80002 | 11155111

Defined in: src/chains/index.ts:115

Type guard that narrows an arbitrary chain ID to a SupportedChainId.

Parameters

chainId

number

The numeric chain ID to test.

Returns

chainId is 1 | 137 | 1001 | 8217 | 43113 | 43114 | 80002 | 11155111

true if kawasekit supports this chain ID.

Example

import { isSupportedChainId } from "kawasekit";
const id = 80002;
if (isSupportedChainId(id)) {
// `id` is now narrowed to SupportedChainId
}