setChain

Allows you to change the current chain in the core store. Note, this chain must be one of the chains configured in your original createConfig call.

Import

1import { setChain } from "@account-kit/core";

Usage

1import { setChain } from "@account-kit/core";
2import { config } from "./config";
3import { sepolia } from "@account-kit/infra";
4
5await setChain(config, sepolia);

Parameters

config

AlchemyAccountsConfig the accounts config object

chain

Chain the chain to change to. It must be present in the connections config object