Skip to content

createModularAccountAlchemyClient

Creates a modular account Alchemy client with the provided configuration.

Import

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

Usage

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

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