createLightAccountAlchemyClient

Creates an Alchemy smart account client connected to a Light Account instance.

Import

1import { createLightAccountAlchemyClient } from "@account-kit/smart-contracts";

Usage

1import { createLightAccountAlchemyClient } from "@account-kit/smart-contracts";
2import { sepolia, alchemy } from "@account-kit/infra";
3import { LocalAccountSigner } from "@aa-sdk/core";
4import { generatePrivateKey } from "viem";
5
6const lightAccountClient = await createLightAccountAlchemyClient({
7 transport: alchemy({ apiKey: "your-api-key" }),
8 chain: sepolia,
9 signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),
10});

Parameters

config

AlchemyLightAccountClientConfig The configuration for setting up the Alchemy Light Account Client

Returns

Promise<AlchemySmartAccountClient> A promise that resolves to an AlchemySmartAccountClient object containing the created client