Creates a Modular Account V2 client using the provided configuration parameters.
import { createModularAccountV2Client } from "@account-kit/smart-contracts";
import { LocalAccountSigner } from "@aa-sdk/core";
import { alchemy, sepolia } from "@account-kit/infra";
const MNEMONIC = "...";
const RPC_URL = "...";
const signer = LocalAccountSigner.mnemonicToAccountSigner(MNEMONIC);
const chain = sepolia;
const transport = alchemy({ rpcUrl: RPC_URL });
const policyId = "...";
const modularAccountV2Client = await createModularAccountV2Client({
chain,
signer,
transport,
policyId, // NOTE: you may only pass in a gas policy ID if you provide an Alchemy transport!
});The configuration parameters required to create the Modular Account v2 account client
function createModularAccountV2Client<TChain, TSigner>(
args,
): Promise<AlchemySmartAccountClient<TChain, ModularAccountV2<TSigner>>>;Defined in: account-kit/smart-contracts/src/ma-v2/client/client.ts:86
| Type Parameter | Default type |
|---|---|
| |
|
|
| Parameter | Type |
|---|---|
|
|
Promise<AlchemySmartAccountClient<TChain, ModularAccountV2<TSigner>>>
function createModularAccountV2Client<TTransport, TChain, TSigner>(
args,
): Promise<ModularAccountV2Client<TSigner, TChain, TTransport>>;Defined in: account-kit/smart-contracts/src/ma-v2/client/client.ts:97
| Type Parameter | Default type |
|---|---|
| |
| |
|
|
| Parameter | Type |
|---|---|
|
|
Promise<ModularAccountV2Client<TSigner, TChain, TTransport>>
function createModularAccountV2Client<TTransport, TChain>(
args,
): Promise<WebauthnModularAccountV2Client<TChain, TTransport>>;Defined in: account-kit/smart-contracts/src/ma-v2/client/client.ts:105
| Parameter | Type |
|---|---|
|
|
Promise<WebauthnModularAccountV2Client<TChain, TTransport>>