Skip to content
Alchemy Logo

setChain

function setChain(config, chain): Promise<void>;

Defined in: account-kit/core/src/actions/setChain.ts:23

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 { setChain } from "@account-kit/core";
import { config } from "./config";
import { sepolia } from "@account-kit/infra";
 
await setChain(config, sepolia);

ParameterTypeDescription

config

AlchemyAccountsConfig

the accounts config object

chain

Chain

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

Promise<void>

Was this page helpful?