Skip to content

getMAV2UpgradeToData

Retrieves the data necessary to upgrade to a Modular Account V2 (MA v2). Note that the upgrade will be to the Semi Modular Account Storage variant

Import

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

Usage

import {
  createLightAccountClient,
  getMAV2UpgradeToData,
} from "@account-kit/smart-contracts";
 
const client = createLightAccountClient({});
const upgradeData = await getMAV2UpgradeToData(client, {});

Parameters

client

SmartAccountClient<TTransport, TChain, TAccount> The smart account client

args

GetMAV2UpgradeToData<TSigner, TAccount> The arguments required for the upgrade

Returns

Promise<UpgradeToData & { createModularAccountV2FromExisting: () => Promise<ModularAccountV2<TSigner>>}> A promise that resolves to upgrade data augmented with a function to create a Modular Account V2