# @alchemy/smart-accounts

> Overview of smart-accounts

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

**Beta** — This package replaces `@account-kit/smart-contracts`. This is a low-level package. Most users should use [`@alchemy/wallet-apis`](https://www.alchemy.com/docs/wallets/reference/wallet-apis) unless you need to use interface with Smart Accounts directly via viem.

Viem-compatible smart account implementations for Alchemy's smart contract accounts. Supports LightAccount, Modular Account v1, and Modular Account v2 with EIP-7702.

## Installation

```bash
npm install @alchemy/smart-accounts @alchemy/common viem
```

## Example Usage

```ts
import { createPublicClient } from "viem";
import {
  createBundlerClient,
  createPaymasterClient,
} from "viem/account-abstraction";
import { sepolia } from "viem/chains";
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
import { alchemyTransport } from "@alchemy/common";
import { estimateFeesPerGas } from "@alchemy/aa-infra";
import { toModularAccountV2 } from "@alchemy/smart-accounts";

const transport = alchemyTransport({ apiKey: "YOUR_API_KEY" });

// 1. Create a MAv2 smart account
const account = await toModularAccountV2({
  client: createPublicClient({ chain: sepolia, transport }),
  owner: privateKeyToAccount(generatePrivateKey()),
});

// 2. Create a bundler client with the account
const bundlerClient = createBundlerClient({
  account,
  chain: sepolia,
  transport,
  userOperation: {
    estimateFeesPerGas,
  },
  // Optional: sponsor gas with a paymaster
  paymaster: createPaymasterClient({ transport }),
  paymasterContext: { policyId: "YOUR_POLICY_ID" },
});

// 3. Send a user operation
const hash = await bundlerClient.sendUserOperation({
  calls: [{ to: "0x...", value: 0n, data: "0x" }],
});

const receipt = await bundlerClient.waitForUserOperationReceipt({ hash });
```

## Key Exports

### LightAccount

- **`toLightAccount`** - Single-owner LightAccount
- **`toMultiOwnerLightAccount`** - Multi-owner variant
- **`predictLightAccountAddress`** / **`predictMultiOwnerLightAccountAddress`** - Counterfactual address prediction

### Modular Account v1 (ERC-6900)

- **`toMultiOwnerModularAccountV1`** - Account constructor
- **`predictMultiOwnerModularAccountV1Address`** - Address prediction

### Modular Account v2

- **`toModularAccountV2`** - Account constructor with EIP-7702 support
- **`deferralActions`** / **`installValidationActions`** - Client decorators
- **Modules** - `AllowlistModule`, `NativeTokenLimitModule`, `PaymasterGuardModule`, `SingleSignerValidationModule`, `TimeRangeModule`
- **`PermissionBuilder`** - Fluent builder for session key permissions
- **Signature utilities** - `packUOSignature`, `pack1271Signature`, `toReplaySafeTypedData`

## License

MIT

## Classes

| Class                                                                                                          | Description                                                                                               |
| :------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------- |
| [AccountAddressAsTargetError](/wallets/reference/smart-accounts/classes/AccountAddressAsTargetError)           | Error class for when an account address is used as target.                                                |
| [DeadlineOverLimitError](/wallets/reference/smart-accounts/classes/DeadlineOverLimitError)                     | Error class for when a deadline is over the limit.                                                        |
| [DuplicateTargetAddressError](/wallets/reference/smart-accounts/classes/DuplicateTargetAddressError)           | Error class for when a duplicate target address is added to a permission builder.                         |
| [EntityIdOverrideError](/wallets/reference/smart-accounts/classes/EntityIdOverrideError)                       | Error class denoting that the provided entity id is invalid because it's overriding the native entity id. |
| [ExpiredDeadlineError](/wallets/reference/smart-accounts/classes/ExpiredDeadlineError)                         | Error class for when a deadline is expired.                                                               |
| [InvalidDeferredActionNonceError](/wallets/reference/smart-accounts/classes/InvalidDeferredActionNonceError)   | Error class denoting that the deferred action nonce used is invalid.                                      |
| [InvalidEntityIdError](/wallets/reference/smart-accounts/classes/InvalidEntityIdError)                         | Error class denoting that the provided entity id is invalid because it's too large.                       |
| [InvalidNonceKeyError](/wallets/reference/smart-accounts/classes/InvalidNonceKeyError)                         | Error class denoting that the nonce key is invalid because its too large.                                 |
| [InvalidOwnerError](/wallets/reference/smart-accounts/classes/InvalidOwnerError)                               | Error class denoting that the owner for an account is invalid                                             |
| [MultipleGasLimitError](/wallets/reference/smart-accounts/classes/MultipleGasLimitError)                       | Error class for when a multiple gas limit permission is added to a permission builder.                    |
| [MultipleNativeTokenTransferError](/wallets/reference/smart-accounts/classes/MultipleNativeTokenTransferError) | Error class for when a multiple native token transfer permission is added to a permission builder.        |
| [NoFunctionsProvidedError](/wallets/reference/smart-accounts/classes/NoFunctionsProvidedError)                 | Error class for when no functions are provided to a permission builder.                                   |
| [PermissionBuilder](/wallets/reference/smart-accounts/classes/PermissionBuilder)                               | A builder for constructing a Permission object.                                                           |
| [PermissionBuilderError](/wallets/reference/smart-accounts/classes/PermissionBuilderError)                     | Abstract class representing a Permission Builder Error, subclassed by all permission builder errors.      |
| [RootPermissionOnlyError](/wallets/reference/smart-accounts/classes/RootPermissionOnlyError)                   | Error class for when a root permission is added to a permission builder.                                  |
| [SelectorNotAllowed](/wallets/reference/smart-accounts/classes/SelectorNotAllowed)                             | Error class for when a selector is not allowed.                                                           |
| [UnsupportedPermissionTypeError](/wallets/reference/smart-accounts/classes/UnsupportedPermissionTypeError)     | Error class for when an unsupported permission type is added to a permission builder.                     |
| [ValidationConfigUnsetError](/wallets/reference/smart-accounts/classes/ValidationConfigUnsetError)             | Error class for when a validation config is unset.                                                        |
| [ZeroAddressError](/wallets/reference/smart-accounts/classes/ZeroAddressError)                                 | Error class for when a zero address is provided to a permission builder.                                  |

## Type Aliases

| Type Alias                                                                                                                                                            | Description                                                                                                                                                                              |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [BaseMaV1AccountImplementation](/wallets/reference/smart-accounts/type-aliases/BaseMaV1AccountImplementation)                                                         | -                                                                                                                                                                                        |
| [BaseModularAccountV2Implementation](/wallets/reference/smart-accounts/type-aliases/BaseModularAccountV2Implementation)                                               | -                                                                                                                                                                                        |
| [BuildNonceParams](/wallets/reference/smart-accounts/type-aliases/BuildNonceParams)                                                                                   | -                                                                                                                                                                                        |
| [BuildPreSignatureDeferredActionPayloadParams](/wallets/reference/smart-accounts/type-aliases/BuildPreSignatureDeferredActionPayloadParams)                           | -                                                                                                                                                                                        |
| [CreateDeferredActionTypedDataParams](/wallets/reference/smart-accounts/type-aliases/CreateDeferredActionTypedDataParams)                                             | -                                                                                                                                                                                        |
| [DeferralActions](/wallets/reference/smart-accounts/type-aliases/DeferralActions)                                                                                     | -                                                                                                                                                                                        |
| [DeferredActionReturnData](/wallets/reference/smart-accounts/type-aliases/DeferredActionReturnData)                                                                   | -                                                                                                                                                                                        |
| [DeferredActionTypedData](/wallets/reference/smart-accounts/type-aliases/DeferredActionTypedData)                                                                     | -                                                                                                                                                                                        |
| [EncodeDeferredActionWithSignatureParams](/wallets/reference/smart-accounts/type-aliases/EncodeDeferredActionWithSignatureParams)                                     | -                                                                                                                                                                                        |
| [EntityIdAndNonceParams](/wallets/reference/smart-accounts/type-aliases/EntityIdAndNonceParams)                                                                       | -                                                                                                                                                                                        |
| [EntryPointFromAccountRegistry](/wallets/reference/smart-accounts/type-aliases/EntryPointFromAccountRegistry)                                                         | Infers the EntryPoint details as a type, given the account type and version.                                                                                                             |
| [ExecutionDataView](/wallets/reference/smart-accounts/type-aliases/ExecutionDataView)                                                                                 | -                                                                                                                                                                                        |
| [GetAccountParameter](/wallets/reference/smart-accounts/type-aliases/GetAccountParameter)                                                                             | -                                                                                                                                                                                        |
| [GetLightAccountAddressFromFactoryDataParams](/wallets/reference/smart-accounts/type-aliases/GetLightAccountAddressFromFactoryDataParams)                             | -                                                                                                                                                                                        |
| [GetLightAccountType](/wallets/reference/smart-accounts/type-aliases/GetLightAccountType)                                                                             | -                                                                                                                                                                                        |
| [GetMAV2UpgradeToData](/wallets/reference/smart-accounts/type-aliases/GetMAV2UpgradeToData)                                                                           | -                                                                                                                                                                                        |
| [GetModularAccountV2AddressFromFactoryDataParams](/wallets/reference/smart-accounts/type-aliases/GetModularAccountV2AddressFromFactoryDataParams)                     | -                                                                                                                                                                                        |
| [GetMultiOwnerLightAccountAddressFromFactoryDataParams](/wallets/reference/smart-accounts/type-aliases/GetMultiOwnerLightAccountAddressFromFactoryDataParams)         | -                                                                                                                                                                                        |
| [GetMultiOwnerModularAccountV1AddressFromFactoryDataParams](/wallets/reference/smart-accounts/type-aliases/GetMultiOwnerModularAccountV1AddressFromFactoryDataParams) | -                                                                                                                                                                                        |
| [HookConfig](/wallets/reference/smart-accounts/type-aliases/HookConfig)                                                                                               | -                                                                                                                                                                                        |
| [HookIdentifier](/wallets/reference/smart-accounts/type-aliases/HookIdentifier)                                                                                       | -                                                                                                                                                                                        |
| [HookType](/wallets/reference/smart-accounts/type-aliases/HookType)                                                                                                   | -                                                                                                                                                                                        |
| [InstallValidationActions](/wallets/reference/smart-accounts/type-aliases/InstallValidationActions)                                                                   | -                                                                                                                                                                                        |
| [InstallValidationParams](/wallets/reference/smart-accounts/type-aliases/InstallValidationParams)                                                                     | -                                                                                                                                                                                        |
| [LightAccount](/wallets/reference/smart-accounts/type-aliases/LightAccount)                                                                                           | -                                                                                                                                                                                        |
| [LightAccountAbi](/wallets/reference/smart-accounts/type-aliases/LightAccountAbi)                                                                                     | -                                                                                                                                                                                        |
| [LightAccountType](/wallets/reference/smart-accounts/type-aliases/LightAccountType)                                                                                   | -                                                                                                                                                                                        |
| [LightAccountVersion](/wallets/reference/smart-accounts/type-aliases/LightAccountVersion)                                                                             | -                                                                                                                                                                                        |
| [ModularAccountV1Base](/wallets/reference/smart-accounts/type-aliases/ModularAccountV1Base)                                                                           | -                                                                                                                                                                                        |
| [ModularAccountV2](/wallets/reference/smart-accounts/type-aliases/ModularAccountV2)                                                                                   | -                                                                                                                                                                                        |
| [ModularAccountV2Base](/wallets/reference/smart-accounts/type-aliases/ModularAccountV2Base)                                                                           | -                                                                                                                                                                                        |
| [ModuleEntity](/wallets/reference/smart-accounts/type-aliases/ModuleEntity)                                                                                           | -                                                                                                                                                                                        |
| [MultiOwnerLightAccount](/wallets/reference/smart-accounts/type-aliases/MultiOwnerLightAccount)                                                                       | -                                                                                                                                                                                        |
| [MultiOwnerModularAccountV1](/wallets/reference/smart-accounts/type-aliases/MultiOwnerModularAccountV1)                                                               | -                                                                                                                                                                                        |
| [Pack1271SignatureParams](/wallets/reference/smart-accounts/type-aliases/Pack1271SignatureParams)                                                                     | -                                                                                                                                                                                        |
| [PackUOSignatureParams](/wallets/reference/smart-accounts/type-aliases/PackUOSignatureParams)                                                                         | -                                                                                                                                                                                        |
| [Permission](/wallets/reference/smart-accounts/type-aliases/Permission)                                                                                               | -                                                                                                                                                                                        |
| [PermissionType](/wallets/reference/smart-accounts/type-aliases/PermissionType)                                                                                       | -                                                                                                                                                                                        |
| [PredictLightAccountAddressParams](/wallets/reference/smart-accounts/type-aliases/PredictLightAccountAddressParams)                                                   | -                                                                                                                                                                                        |
| [PredictModularAccountV2AddressParams](/wallets/reference/smart-accounts/type-aliases/PredictModularAccountV2AddressParams)                                           | -                                                                                                                                                                                        |
| [PredictMultiOwnerLightAccountAddressParams](/wallets/reference/smart-accounts/type-aliases/PredictMultiOwnerLightAccountAddressParams)                               | -                                                                                                                                                                                        |
| [PredictMultiOwnerModularAccountV1AddressParams](/wallets/reference/smart-accounts/type-aliases/PredictMultiOwnerModularAccountV1AddressParams)                       | -                                                                                                                                                                                        |
| [SemiModularAccount7702StaticImpl](/wallets/reference/smart-accounts/type-aliases/SemiModularAccount7702StaticImpl)                                                   | -                                                                                                                                                                                        |
| [SemiModularAccountV2FactoryArgs](/wallets/reference/smart-accounts/type-aliases/SemiModularAccountV2FactoryArgs)                                                     | -                                                                                                                                                                                        |
| [SemiModularAccountV2StaticImpl](/wallets/reference/smart-accounts/type-aliases/SemiModularAccountV2StaticImpl)                                                       | -                                                                                                                                                                                        |
| [SignaturePrefix](/wallets/reference/smart-accounts/type-aliases/SignaturePrefix)                                                                                     | -                                                                                                                                                                                        |
| [SignatureRequest](/wallets/reference/smart-accounts/type-aliases/SignatureRequest)                                                                                   | -                                                                                                                                                                                        |
| [SignerEntity](/wallets/reference/smart-accounts/type-aliases/SignerEntity)                                                                                           | -                                                                                                                                                                                        |
| [SmartAccountWithDecodeCalls](/wallets/reference/smart-accounts/type-aliases/SmartAccountWithDecodeCalls)                                                             | Helper type that converts a SmartAccount type to have a required `decodeCalls` function. This is useful for account implementations that always provide the `decodeCalls` functionality. |
| [StaticSmartAccountImplementation](/wallets/reference/smart-accounts/type-aliases/StaticSmartAccountImplementation)                                                   | -                                                                                                                                                                                        |
| [ToLightAccountParams](/wallets/reference/smart-accounts/type-aliases/ToLightAccountParams)                                                                           | -                                                                                                                                                                                        |
| [ToModularAccountV1BaseParams](/wallets/reference/smart-accounts/type-aliases/ToModularAccountV1BaseParams)                                                           | -                                                                                                                                                                                        |
| [ToModularAccountV2BaseParams](/wallets/reference/smart-accounts/type-aliases/ToModularAccountV2BaseParams)                                                           | -                                                                                                                                                                                        |
| [ToModularAccountV2Params](/wallets/reference/smart-accounts/type-aliases/ToModularAccountV2Params)                                                                   | -                                                                                                                                                                                        |
| [ToMultiOwnerLightAccountParams](/wallets/reference/smart-accounts/type-aliases/ToMultiOwnerLightAccountParams)                                                       | -                                                                                                                                                                                        |
| [ToMultiOwnerModularAccountV1Params](/wallets/reference/smart-accounts/type-aliases/ToMultiOwnerModularAccountV1Params)                                               | -                                                                                                                                                                                        |
| [UninstallValidationParams](/wallets/reference/smart-accounts/type-aliases/UninstallValidationParams)                                                                 | -                                                                                                                                                                                        |
| [UpgradeToData](/wallets/reference/smart-accounts/type-aliases/UpgradeToData)                                                                                         | -                                                                                                                                                                                        |
| [ValidationConfig](/wallets/reference/smart-accounts/type-aliases/ValidationConfig)                                                                                   | -                                                                                                                                                                                        |
| [ValidationData](/wallets/reference/smart-accounts/type-aliases/ValidationData)                                                                                       | -                                                                                                                                                                                        |
| [ValidationDataParams](/wallets/reference/smart-accounts/type-aliases/ValidationDataParams)                                                                           | -                                                                                                                                                                                        |
| [ValidationDataView](/wallets/reference/smart-accounts/type-aliases/ValidationDataView)                                                                               | -                                                                                                                                                                                        |

## Variables

| Variable                                                                                                                     | Description                                                                                                                       |
| :--------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- |
| [AccountVersionRegistry](/wallets/reference/smart-accounts/variables/AccountVersionRegistry)                                 | Account version registry interface that defines the light account versions and the version definition for each light account type |
| [AllowlistModule](/wallets/reference/smart-accounts/variables/AllowlistModule)                                               | -                                                                                                                                 |
| [DEFAULT_OWNER_ENTITY_ID](/wallets/reference/smart-accounts/variables/DEFAULT_OWNER_ENTITY_ID)                               | The default owner entity ID.                                                                                                      |
| [DefaultAddress](/wallets/reference/smart-accounts/variables/DefaultAddress)                                                 | A mapping of default addresses for the ModularAccountV2.                                                                          |
| [DefaultMaV1Address](/wallets/reference/smart-accounts/variables/DefaultMaV1Address)                                         | A mapping of default addresses for the ModularAccountV1.                                                                          |
| [DefaultMaV1PluginAddress](/wallets/reference/smart-accounts/variables/DefaultMaV1PluginAddress)                             | A mapping of default addresses for the ModularAccountV1 plugins.                                                                  |
| [DefaultModuleAddress](/wallets/reference/smart-accounts/variables/DefaultModuleAddress)                                     | A mapping of default addresses for the ModularAccountV2 modules.                                                                  |
| [ENTITY_ID_AND_NONCE_READER_BYTECODE](/wallets/reference/smart-accounts/variables/ENTITY_ID_AND_NONCE_READER_BYTECODE)       | -                                                                                                                                 |
| [EXECUTE_USER_OP_SELECTOR](/wallets/reference/smart-accounts/variables/EXECUTE_USER_OP_SELECTOR)                             | The selector for the execute user operation function.                                                                             |
| [HookIdentifier](/wallets/reference/smart-accounts/variables/HookIdentifier)                                                 | A pseudo-enum for hook identifiers.                                                                                               |
| [HookType](/wallets/reference/smart-accounts/variables/HookType)                                                             | -                                                                                                                                 |
| [lightAccountStaticImplV1_0_1](/wallets/reference/smart-accounts/variables/lightAccountStaticImplV1_0_1)                     | -                                                                                                                                 |
| [lightAccountStaticImplV1_0_2](/wallets/reference/smart-accounts/variables/lightAccountStaticImplV1_0_2)                     | -                                                                                                                                 |
| [lightAccountStaticImplV1_1_0](/wallets/reference/smart-accounts/variables/lightAccountStaticImplV1_1_0)                     | -                                                                                                                                 |
| [lightAccountStaticImplV2_0_0](/wallets/reference/smart-accounts/variables/lightAccountStaticImplV2_0_0)                     | -                                                                                                                                 |
| [LightAccountUnsupported1271Factories](/wallets/reference/smart-accounts/variables/LightAccountUnsupported1271Factories)     | Can be used to check if the account with one of the following factory addresses to not support 1271 signing.                      |
| [LightAccountUnsupported1271Impls](/wallets/reference/smart-accounts/variables/LightAccountUnsupported1271Impls)             | Can be used to check if the account with one of the following implementation addresses to not support 1271 signing.               |
| [LightAccountV1Versions](/wallets/reference/smart-accounts/variables/LightAccountV1Versions)                                 | Light Account v1 versions                                                                                                         |
| [LightAccountV2Versions](/wallets/reference/smart-accounts/variables/LightAccountV2Versions)                                 | Light Account v2 versions                                                                                                         |
| [multiOwnerLightAccountStaticImplV2_0_0](/wallets/reference/smart-accounts/variables/multiOwnerLightAccountStaticImplV2_0_0) | -                                                                                                                                 |
| [multiOwnerModularAccountStaticImpl](/wallets/reference/smart-accounts/variables/multiOwnerModularAccountStaticImpl)         | Static implementation logic for ModularAccountV1.                                                                                 |
| [NativeTokenLimitModule](/wallets/reference/smart-accounts/variables/NativeTokenLimitModule)                                 | -                                                                                                                                 |
| [PaymasterGuardModule](/wallets/reference/smart-accounts/variables/PaymasterGuardModule)                                     | -                                                                                                                                 |
| [PermissionType](/wallets/reference/smart-accounts/variables/PermissionType)                                                 | A pseudo-enum for permission types.                                                                                               |
| [semiModularAccount7702StaticImpl](/wallets/reference/smart-accounts/variables/semiModularAccount7702StaticImpl)             | Static implementation logic for SemiModularAccount7702.                                                                           |
| [semiModularAccountV2StaticImpl](/wallets/reference/smart-accounts/variables/semiModularAccountV2StaticImpl)                 | Static implementation logic for SemiModularAccountV2.                                                                             |
| [SignaturePrefix](/wallets/reference/smart-accounts/variables/SignaturePrefix)                                               | -                                                                                                                                 |
| [SingleSignerValidationModule](/wallets/reference/smart-accounts/variables/SingleSignerValidationModule)                     | -                                                                                                                                 |
| [TimeRangeModule](/wallets/reference/smart-accounts/variables/TimeRangeModule)                                               | -                                                                                                                                 |

## Functions

| Function                                                                                                                                               | Description                                                                                                                                                                                                                                                      |
| :----------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [buildFullNonceKey](/wallets/reference/smart-accounts/functions/buildFullNonceKey)                                                                     | Builds a full nonce key.                                                                                                                                                                                                                                         |
| [decodeCallsLA](/wallets/reference/smart-accounts/functions/decodeCallsLA)                                                                             | Decodes LightAccount calldata back into an array of calls. Used internally by the LightAccount SmartAccount implementation. Typically not needed directly unless you have an advanced use case.                                                                  |
| [decodeCallsMAv1](/wallets/reference/smart-accounts/functions/decodeCallsMAv1)                                                                         | Decodes ModularAccountV1 calldata back into an array of calls. Used internally by the ModularAccountV1 SmartAccount implementation. Typically not needed directly unless you have an advanced use case.                                                          |
| [decodeCallsMAv2](/wallets/reference/smart-accounts/functions/decodeCallsMAv2)                                                                         | Decodes ModularAccountV2 calldata back into an array of calls. Strips the `EXECUTE_USER_OP_SELECTOR` prefix if present. Used internally by the ModularAccountV2 SmartAccount implementation. Typically not needed directly unless you have an advanced use case. |
| [defaultLightAccountVersion](/wallets/reference/smart-accounts/functions/defaultLightAccountVersion)                                                   | Get the default light account version for the given light account type                                                                                                                                                                                           |
| [deferralActions](/wallets/reference/smart-accounts/functions/deferralActions)                                                                         | Provides deferred action functionalities for a MA v2 client, ensuring compatibility with `SmartAccountClient`.                                                                                                                                                   |
| [encodeCallsLA](/wallets/reference/smart-accounts/functions/encodeCallsLA)                                                                             | Encodes an array of calls into LightAccount calldata for `execute` or `executeBatch`. Used internally by the LightAccount SmartAccount implementation. Typically not needed directly unless you have an advanced use case.                                       |
| [encodeCallsMAv1](/wallets/reference/smart-accounts/functions/encodeCallsMAv1)                                                                         | Encodes an array of calls into ModularAccountV1 calldata for `execute` or `executeBatch`. Used internally by the ModularAccountV1 SmartAccount implementation. Typically not needed directly unless you have an advanced use case.                               |
| [encodeCallsMAv2](/wallets/reference/smart-accounts/functions/encodeCallsMAv2)                                                                         | Encodes an array of calls into ModularAccountV2 calldata for `execute` or `executeBatch`. Used internally by the ModularAccountV2 SmartAccount implementation. Typically not needed directly unless you have an advanced use case.                               |
| [encodeDeferredActionWithSignature](/wallets/reference/smart-accounts/functions/encodeDeferredActionWithSignature)                                     | Encodes the deferred action with its signature, producing the payload to prepend to the userOp signature.                                                                                                                                                        |
| [getLightAccountAddressFromFactoryData](/wallets/reference/smart-accounts/functions/getLightAccountAddressFromFactoryData)                             | Gets the light account address from factory data. If the factory is a known default, decodes the args and predicts without RPC. Otherwise falls back to calling the entry point's getSenderAddress.                                                              |
| [getLightAccountImplAddress](/wallets/reference/smart-accounts/functions/getLightAccountImplAddress)                                                   | Get the light account implementation address for the given light account                                                                                                                                                                                         |
| [getMAV2UpgradeToData](/wallets/reference/smart-accounts/functions/getMAV2UpgradeToData)                                                               | Gets the upgrade to data for the ModularAccountV2.                                                                                                                                                                                                               |
| [getModularAccountV2AddressFromFactoryData](/wallets/reference/smart-accounts/functions/getModularAccountV2AddressFromFactoryData)                     | Gets the modular account v2 address from factory data. If the factory is a known default (SMA), decodes the args and predicts without RPC. Otherwise falls back to calling the entry point's getSenderAddress.                                                   |
| [getMultiOwnerLightAccountAddressFromFactoryData](/wallets/reference/smart-accounts/functions/getMultiOwnerLightAccountAddressFromFactoryData)         | Gets the multi-owner light account address from factory data. If the factory is a known default, decodes the args and predicts without RPC. Otherwise falls back to calling the entry point's getSenderAddress.                                                  |
| [getMultiOwnerModularAccountV1AddressFromFactoryData](/wallets/reference/smart-accounts/functions/getMultiOwnerModularAccountV1AddressFromFactoryData) | Gets the multi-owner modular account v1 address from factory data. If the factory is a known default, decodes the args and predicts without RPC. Otherwise falls back to calling the entry point's getSenderAddress.                                             |
| [installValidationActions](/wallets/reference/smart-accounts/functions/installValidationActions)                                                       | Provides validation installation and uninstallation encoding functionalities for a MA v2 client.                                                                                                                                                                 |
| [isLightAccountVersion1](/wallets/reference/smart-accounts/functions/isLightAccountVersion1)                                                           | Type guard to check if a version is a Light Account v1 version                                                                                                                                                                                                   |
| [isLightAccountVersion2](/wallets/reference/smart-accounts/functions/isLightAccountVersion2)                                                           | Type guard to check if a version is a Light Account v2 version                                                                                                                                                                                                   |
| [isModularAccountV2](/wallets/reference/smart-accounts/functions/isModularAccountV2)                                                                   | Checks if an account is a ModularAccountV2.                                                                                                                                                                                                                      |
| [pack1271Signature](/wallets/reference/smart-accounts/functions/pack1271Signature)                                                                     | Signature packing utility for 1271 signatures.                                                                                                                                                                                                                   |
| [packUOSignature](/wallets/reference/smart-accounts/functions/packUOSignature)                                                                         | Signature packing utility for user operations.                                                                                                                                                                                                                   |
| [parseDeferredAction](/wallets/reference/smart-accounts/functions/parseDeferredAction)                                                                 | Parses out the 3 components from a deferred action.                                                                                                                                                                                                              |
| [predictLightAccountAddress](/wallets/reference/smart-accounts/functions/predictLightAccountAddress)                                                   | Predicts the address of a light account based on provided parameters such as factory address, salt, owner address, and version.                                                                                                                                  |
| [predictModularAccountV2Address](/wallets/reference/smart-accounts/functions/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" and "MA".                                     |
| [predictMultiOwnerLightAccountAddress](/wallets/reference/smart-accounts/functions/predictMultiOwnerLightAccountAddress)                               | Predicts the address of a **Multi-Owner Light Account** given the factory, salt and the set of owner addresses.                                                                                                                                                  |
| [predictMultiOwnerModularAccountV1Address](/wallets/reference/smart-accounts/functions/predictMultiOwnerModularAccountV1Address)                       | Predicts the address of a MultiOwnerModularAccountV1 smart account before deployment.                                                                                                                                                                            |
| [serializeHookConfig](/wallets/reference/smart-accounts/functions/serializeHookConfig)                                                                 | Serializes a `HookConfig` object into a `Hex` format by encoding the hook type, presence of post/pre hooks, address, and entity ID.                                                                                                                              |
| [serializeModuleEntity](/wallets/reference/smart-accounts/functions/serializeModuleEntity)                                                             | Serializes a module entity into a hexadecimal format by concatenating the module address and entity ID.                                                                                                                                                          |
| [serializeValidationConfig](/wallets/reference/smart-accounts/functions/serializeValidationConfig)                                                     | Serializes a validation configuration into a hexadecimal string representation. This involves converting boolean flags into bitwise representation and combining them with serialized module entity data.                                                        |
| [toLightAccount](/wallets/reference/smart-accounts/functions/toLightAccount)                                                                           | Creates a light account.                                                                                                                                                                                                                                         |
| [toModularAccountV1Base](/wallets/reference/smart-accounts/functions/toModularAccountV1Base)                                                           | Creates a ModularAccountV1Base instance.                                                                                                                                                                                                                         |
| [toModularAccountV2](/wallets/reference/smart-accounts/functions/toModularAccountV2)                                                                   | Creates a MAv2 account.                                                                                                                                                                                                                                          |
| [toModularAccountV2Base](/wallets/reference/smart-accounts/functions/toModularAccountV2Base)                                                           | Creates a ModularAccountV2Base instance.                                                                                                                                                                                                                         |
| [toMultiOwnerLightAccount](/wallets/reference/smart-accounts/functions/toMultiOwnerLightAccount)                                                       | Creates a multi-owner light account.                                                                                                                                                                                                                             |
| [toMultiOwnerModularAccountV1](/wallets/reference/smart-accounts/functions/toMultiOwnerModularAccountV1)                                               | Creates a multi-owner MAv1 account.                                                                                                                                                                                                                              |
| [toReplaySafeTypedData](/wallets/reference/smart-accounts/functions/toReplaySafeTypedData)                                                             | Converts a hash to a replay safe typed data.                                                                                                                                                                                                                     |