createModularAccountAlchemyClient

Creates a modular account Alchemy client with the provided configuration.

Import

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

Usage

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

Parameters

config

AlchemyModularAccountClientConfig The configuration for creating the Alchemy client

Returns

Promise<AlchemySmartAccountClient> A promise that resolves to an AlchemySmartAccountClient configured with the desired plugins and actions