account-kit/smart-contracts

Enumerations

EnumerationDescription
SessionKeyAccessListType-

Classes

ClassDescription
InvalidAggregatedSignatureErrorError thrown when the aggregated signature is invalid
InvalidContextSignatureErrorError thrown when the context signature is invalid
MultisigAccountExpectedErrorError thrown when the expected account is not a multisig modular account
MultisigMissingSignatureErrorError thrown when a multisig user op is missing a signature
SessionKeyPermissionsBuilderA builder for creating the hex-encoded data for updating session key permissions.
SessionKeySignerA simple session key signer that uses localStorage or sessionStorage to store a private key. If the key is not found, it will generate a new one and store it in the storage.

Type Aliases

Type AliasDescription
AccountLoupeActions-
AlchemyLightAccountClientConfig-
AlchemyModularAccountClientConfig-
AlchemyMultiOwnerLightAccountClientConfig-
AlchemyMultisigAccountClientConfig-
BuildDeferredActionDigestParams-
BuildNonceParams-
ContractAccessEntry-
ContractMethodEntry-
CreateLightAccountParams-
CreateMAV2BaseParams-
CreateMAV2BaseReturnType-
CreateModularAccountV2AlchemyClientParams-
CreateModularAccountV2ClientParams-
CreateModularAccountV2Params-
CreateMultiOwnerLightAccountParams-
CreateMultiOwnerModularAccountParams-
CreateMultisigModularAccountParams-
CreateWebauthnMAV2BaseParams-
CreateWebauthnModularAccountV2ClientParams-
CreateWebauthnModularAccountV2Params-
Erc20TokenLimit-
ExecutionDataView-
ExecutionFunctionConfig-
ExecutionHooks-
FunctionId-
FunctionReference-
GasSpendLimit-
GetLightAccountType-
GetMAV2UpgradeToData-
GetPluginAddressParameter-
InstallMultiOwnerPluginParams-
InstallMultisigPluginParams-
InstallPluginParams-
InstallSessionKeyPluginParams-
LightAccount-
LightAccountClientActions-
LightAccountEntryPointVersion-
LightAccountTypeLight account types supported: LightAccount, MultiOwnerLightAccount
LightAccountVersion-
LightAccountVersionConfig-
LightAccountVersionConfigs-
ModularAccountsV2-
ModularAccountV2-
ModularAccountV2Client-
MultiOwnerLightAccount-
MultiOwnerLightAccountClientActions-
MultiOwnerModularAccount-
MultiOwnerPluginActions-
MultisigModularAccount-
MultisigPluginActions-
MultisigUserOperationContext-
NativeTokenLimit-
Pack1271SignatureParams-
PackUOSignatureParams-
Plugin-
PluginManagerActions-
PreValidationHooks-
ProposeUserOperationResult-
SessionKeyPluginActions-
Signature-
SignerEntity-
SignerType-
SignMultisigUserOperationResult-
TimeRange-
UninstallPluginParams-
UserOpSignatureType-
ValidationDataParams-
ValidationDataView-
WebauthnModularAccountV2-
WebauthnModularAccountV2Client-

Variables

VariableDescription
accountLoupeActionsProvides a set of actions for account loupe operations using the specified client. NOTE: this is already added to the client when using any of the Modular Account Clients.
AccountVersionRegistryAccount version registry interface that defines the light account versions and the version definition for each light account type
DEFAULT_OWNER_ENTITY_ID-
entityIdAndNonceReaderBytecode-
executeUserOpSelector-
IAccountLoupeAbi-
IPluginAbi-
IPluginManagerAbi-
IStandardExecutorAbi-
lightAccountClientActionsProvides a set of actions for managing a light account client, including transferring ownership.
LightAccountUnsupported1271FactoriesCan be used to check if the account with one of the following factory addresses to not support 1271 signing.
LightAccountUnsupported1271ImplsCan be used to check if the account with one of the following implementation addresses to not support 1271 signing.
mintableERC20Abi-
mintableERC20Bytecode-
multiOwnerLightAccountClientActionsGenerates client actions for a multi-owner light account, including the ability to update owners.
MultiOwnerModularAccountFactoryAbi-
MultiOwnerPlugin-
MultiOwnerPluginAbi-
multiOwnerPluginActionsCreates actions for the MultiOwner plugin, including reading owners and checking ownership. NOTE: this is already added to the client returned from createMultiOwnerModularAccountClient
MultiOwnerPluginExecutionFunctionAbi-
MULTISIG_ACCOUNT_SOURCE-
MultisigModularAccountFactoryAbi-
MultisigPlugin-
MultisigPluginAbi-
multisigPluginActionsProvides actions for managing a multisig plugin within the specified client, including reading owners, checking ownership, getting the threshold, proposing user operations, and signing multisig user operations.
MultisigPluginExecutionFunctionAbi-
multisigSignatureMiddlewareA signer middleware to be used with Multisig Account Clients. This middleware handles correctly aggregating signatures passed through as context when sending UserOperations, proposing UserOperations, or adding signatures to a UserOperation.
semiModularAccountBytecodeAbi-
SessionKeyPlugin-
SessionKeyPluginAbi-
sessionKeyPluginActionsCreates actions for managing session keys in a smart contract associated with a client, including adding, removing, rotating, and updating session key permissions.
SessionKeyPluginExecutionFunctionAbi-
standardExecutor-
updateMultiOwnerLightAccountOwnersUpdates the owners of a multi-owner light account. This includes adding new owners and removing existing ones.
UpgradeableModularAccountAbi-

Functions

| Function | Description | | :----------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- | | assertNeverSignatureRequestType | - | | buildDeferredActionDigest | Creates the digest which must be prepended to the userOp signature. | | buildFullNonceKey | - | | buildSessionKeysToRemoveStruct | Finds predecessors for each provided key and returns them in the struct ISessionKeyPlugin.SessionKeyToRemove[]. | | combineSignatures | Combines multiple signatures with provided upper limit values for gas fees and returns the concatenated result. | | createLightAccount | Creates a light account based on the provided parameters such as transport, chain, signer, init code, and more. Ensures that an account is configured and returned with various capabilities, such as transferring ownership and retrieving the owner’s address. | | createLightAccountAlchemyClient | Creates an Alchemy smart account client connected to a Light Account instance. | | 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. | | createMAv2Base | - | | createModularAccountAlchemyClient | Creates a modular account Alchemy client with the provided configuration. | | createModularAccountV2 | Creates a ModularAccount V2 account, with the mode depending on the provided “mode” field. Possible modes include: “default”, which is SMA Bytecode, and “7702”, which is SMA 7702. Handles nonce generation, transaction encoding, and mode variant-specific behavior like initcode construction. | | createModularAccountV2Client | Creates a Modular Account V2 client using the provided configuration parameters. | | createMultiOwnerLightAccount | Creates a multi-owner light account using the provided parameters, including transport, chain, signer, initialization code, version, account address, factory address, salt, and owners. Ensures the owners list is deduplicated, ordered, and valid. | | createMultiOwnerLightAccountAlchemyClient | Creates a multi-owner light account Alchemy client using the provided configuration. | | createMultiOwnerLightAccountClient | Creates a multi-owner light account client using the provided parameters. It first creates a multi-owner light account and then creates a smart account client with the provided configurations. | | createMultiOwnerModularAccount | Creates a multi-owner modular account with the given parameters, including transport, chain, signer, account address, initialization code, entry point, factory address, owners, and salt. Ensures that the owners are unique, ordered, and non-zero. | | createMultiOwnerModularAccountClient | Creates a multi-owner modular account client with the provided parameters including account, transport, chain, and additional client configuration. This function uses a modular account and extends it with various plugin actions. | | createMultisigAccountAlchemyClient | Creates an Alchemy client for a multisig account using the provided configuration. | | createMultisigModularAccount | Creates a multisig modular account using the provided parameters, including transport, chain, signer, account address, and other account settings. It configures the account with multiple owners and the specified threshold. | | 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. | | defaultLightAccountVersion | Get the default light account version for the given light account type | | formatSignatures | Formats a collection of Signature objects into a single aggregated signature. The format is in the form of EOA_SIGS | CONTRACT_SIG_DATAS. The signatures are ordered by signer address. The EOA SIGS contain the 65 signautre data for EOA signers and 65 bytes containing SIGNER | OFFSET | V for contract signers. The OFFSET is used to fetch the signature data from the CONTRACT_SIG_DATAS. | | getDefaultLightAccountFactoryAddress | Utility method returning the default light account factory address given a Chain object | | getDefaultMAV2Address | - | | getDefaultMAV2FactoryAddress | - | | getDefaultMultiOwnerLightAccountFactoryAddress | Utility method returning the default multi owner light account factory address given a Chain object | | getDefaultMultiOwnerModularAccountFactoryAddress | Utility method returning the default multi owner msca factory address given a chain | | getDefaultMultisigModularAccountFactoryAddress | Utility method returning the default multi sig msca factory address given a chain | | getDefaultSMAV27702Address | - | | getDefaultSMAV2BytecodeAddress | - | | getDefaultSMAV2StorageAddress | - | | getDefaultWebAuthnMAV2FactoryAddress | - | | getLightAccountVersionForAccount | Get the light account version definition for the given light account and chain | | getMAInitializationData | Retrieves the initialization data for a multi-owner modular account. Throws an error if the client’s chain is not found or if the multi-owner plugin address is not retrievable. | | 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 | | getMSCAUpgradeToData | Retrieves the data necessary to upgrade to a Multi-Signature Contract Account (MSCA) and provides a method to create a Multi-Owner Modular Account. | | getSignerType | Determines the type of signer (Externally Owned Account (EOA) or CONTRACT) based on the provided client, signature, and signer. | | installPlugin | 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 | | isModularAccountV2 | - | | isMultisigModularAccount | - | | pack1271Signature | - | | packUOSignature | - | | parseDeferredAction | - | | pluginManagerActions | Provides actions for managing plugins on a given client, including installing and uninstalling plugins. NOTE: this is provided by default when using a modular account client | | predictLightAccountAddress | Predicts the address of a light account based on provided parameters such as factory address, salt, owner address, and version. | | predictModularAccountV2Address | Predicts the address of a modular account V2 based on the provided parameters, which include factory address, salt, and implementation address. This function supports different types of accounts including “SMA”, “MA”, and “WebAuthn”. | | predictMultiOwnerLightAccountAddress | Predicts the address of a Multi-Owner Light Account given the factory, salt and the set of owner addresses. | | splitAggregatedSignature | Takes an aggregated signature and threshold and splits it into its components | | transferLightAccountOwnership | Transfers the ownership of a light account to a new owner. This function ensures that the client is a compatible smart acccount client and that a Light Account is provided. If the waitForTxn parameter is true, it will wait for the transaction to be completed before returning. |

References

SignMultisigUserOperationParams

Re-exports SignMultisigUserOperationParams