Skip to content

createLightAccountAlchemyClient

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

Import

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

Usage

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

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