installPlugin

1function installPlugin<TTransport, TChain, TAccount, TContext>(
2 client,
3 params,
4): Promise<any>;

Defined in: account-kit/smart-contracts/src/msca/plugin-manager/installPlugin.ts:65

Installs a plugin on a smart account via the client, sending the user operation with the appropriate parameters. NOTE: it’s recommended to just use the installPlugin action returned from generated plugins

Example

1import { installPlugin, createModularAccountAlchemyClient } from "@account-kit/smart-contracts";
2
3const client = createModularAccountAlchemyClient(...);
4
5const hash = await installPlugin(client, {
6 pluginAddress: "0x...",
7 manifestHash: "0x...",
8 dependencies: [], // this is defined by the plugin you're installing
9});

Type Parameters

Type ParameterDefault type

TTransport extends Transport

Transport

TChain extends undefined | Chain

undefined | Chain

TAccount extends undefined | SmartContractAccount

undefined | SmartContractAccount

TContext extends undefined | Record<string, unknown>

undefined | Record<string, unknown>

Parameters

ParameterTypeDescription

client

Client<TTransport, TChain, TAccount>

The client configured to the smart account on which the plugin will be installed

params

InstallPluginParams<TAccount, TContext>

The parameters required to install the plugin, including overrides, context, and account information

Returns

Promise<any>

A promise that resolves once the plugin installation operation is sent