setChain

1function 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.

Example

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

Parameters

ParameterTypeDescription

config

AlchemyAccountsConfig

the accounts config object

chain

Chain

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

Returns

Promise<void>