Skip to content

getChain

This is a utility method for converting a chainId to a viem Chain object

Usage

ts
import { getChain } from "@alchemy/aa-core";

const result = getChain(1);
// mainnet

Returns

Chain

a viem Chain object

Parameters

chainId: number

The chainId to convert to a Chain object