Skip to content

createMultisigModularAccountClient

Creates a multisig modular account client using the provided parameters including account details, transport, chain, and additional client configuration. This function constructs the multisig modular account and extends it with various actions to create a comprehensive client.

Import

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

Usage

import { createMultisigModularAccountClient } from "@account-kit/smart-contracts";
import { LocalAccountSigner } from "@aa-sdk/core";
import { sepolia } from "viem/chains";
import { http } from "viem";
import { generatePrivateKey } from "viem/accounts";
 
const accountClient = await createMultisigModularAccountClient({
  chain: sepolia,
  transport: http("RPC_URL"),
  signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),
  owners: [], // other owners on the account
  threshold: 2, // 2 of N signatures
});

Parameters

config

CreateMultisigModularAccountClientParams the parameters for configuring the multisig modular account client

Returns

Promise<SmartAccountClient<Transport, Chain, MultisigModularAccount<SmartAccountSigner>, {}, SmartAccountClientRpcSchema, MultisigUserOperationContext>> a promise that resolves to a SmartAccountClient object extended with the multisig modular account and additional actions