Skip to content

createLightAccountClient

Creates a light account client using the provided parameters, including account information, transport mechanism, blockchain chain, and additional client configurations. This function first creates a light account and then uses it to create a smart account client, extending it with light account client actions.

Import

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

Usage

import { createLightAccountClient } from "@account-kit/smart-contracts";
import { LocalAccountSigner } from "@aa-sdk/core";
import { sepolia } from "viem/chains";
import { http, generatePrivateKey } from "viem";
 
const account = await createLightAccountClient({
  chain: sepolia,
  transport: http("RPC_URL"),
  signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),
});

Parameters

params

CreateLightAccountClientParams The parameters for creating a light account client

Returns

Promise<SmartAccountClient> A promise that resolves to a SmartAccountClient object containing the created account information and methods