Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@
"fixBatchSize": 0,
},
],
"no-warning-comments": [
"warn",
{ "terms": ["TODO(v5)"], "location": "anywhere" },
],
},
"overrides": [
{
Expand Down Expand Up @@ -98,7 +94,12 @@
},
},
{
"files": ["packages/**/*.test.ts", "packages/**/*.test-d.ts", "packages/**/test-utils/**/*", "packages/**/__tests__/**/*"],
"files": [
"packages/**/*.test.ts",
"packages/**/*.test-d.ts",
"packages/**/test-utils/**/*",
"packages/**/__tests__/**/*",
],
"rules": {
"no-restricted-syntax": "off",
},
Expand Down
8 changes: 1 addition & 7 deletions docs/pages/reference/smart-accounts/src/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,14 @@ layout: reference
| [InstallValidationParams](/wallets/reference/smart-accounts/type-aliases/InstallValidationParams) | - |
| [LightAccount](/wallets/reference/smart-accounts/type-aliases/LightAccount) | - |
| [LightAccountAbi](/wallets/reference/smart-accounts/type-aliases/LightAccountAbi) | - |
| [LightAccountActions](/wallets/reference/smart-accounts/type-aliases/LightAccountActions) | - |
| [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) | - |
| [MultiOwnerLightAccountActions](/wallets/reference/smart-accounts/type-aliases/MultiOwnerLightAccountActions) | - |
| [MultiOwnerModularAccountV1](/wallets/reference/smart-accounts/type-aliases/MultiOwnerModularAccountV1) | - |
| [MultiOwnerModularAccountV1Actions](/wallets/reference/smart-accounts/type-aliases/MultiOwnerModularAccountV1Actions) | - |
| [Pack1271SignatureParams](/wallets/reference/smart-accounts/type-aliases/Pack1271SignatureParams) | - |
| [PackUOSignatureParams](/wallets/reference/smart-accounts/type-aliases/PackUOSignatureParams) | - |
| [Permission](/wallets/reference/smart-accounts/type-aliases/Permission) | - |
Expand Down Expand Up @@ -149,12 +146,10 @@ layout: reference
| [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 functionalities for a MA v2 client, ensuring compatibility with `SmartAccountClient`. |
| [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. |
| [multiOwnerLightAccountActions](/wallets/reference/smart-accounts/functions/multiOwnerLightAccountActions) | Generates client actions for a multi-owner light account, including the ability to update owners. |
| [multiOwnerModularAccountV1Actions](/wallets/reference/smart-accounts/functions/multiOwnerModularAccountV1Actions) | Generates client actions for a multi-owner MAv1 account, including the ability to update owners. |
| [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. |
Expand All @@ -165,7 +160,6 @@ layout: reference
| [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. |
| [singleOwnerLightAccountActions](/wallets/reference/smart-accounts/functions/singleOwnerLightAccountActions) | A decorator that can be used with viem's bundler client to add light account actions to the client |
| [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. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ layout: reference
function buildFullNonceKey(params): bigint;
```

Defined in: [packages/smart-accounts/src/ma-v2/utils/account.ts:86](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/ma-v2/utils/account.ts#L86)
Defined in: [packages/smart-accounts/src/ma-v2/utils/account.ts:84](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/ma-v2/utils/account.ts#L84)

Builds a full nonce key.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function defaultLightAccountVersion<
>(): keyof object[TLightAccountType];
```

Defined in: [packages/smart-accounts/src/light-account/utils.ts:21](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/light-account/utils.ts#L21)
Defined in: [packages/smart-accounts/src/light-account/utils.ts:15](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/light-account/utils.ts#L15)

Get the default light account version for the given light account type

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ layout: reference
function getLightAccountImplAddress<TAccount>(account): Promise<`0x${string}`>;
```

Defined in: [packages/smart-accounts/src/light-account/utils.ts:55](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/light-account/utils.ts#L55)
Defined in: [packages/smart-accounts/src/light-account/utils.ts:49](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/light-account/utils.ts#L49)

Get the light account implementation address for the given light account

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,23 @@ function installValidationActions<TTransport, TChain, TAccount>(
>;
```

Defined in: [packages/smart-accounts/src/ma-v2/decorators/installValidation.ts:111](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/ma-v2/decorators/installValidation.ts#L111)
Defined in: [packages/smart-accounts/src/ma-v2/decorators/installValidation.ts:95](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/ma-v2/decorators/installValidation.ts#L95)

Provides validation installation and uninstallation functionalities for a MA v2 client, ensuring compatibility with `SmartAccountClient`.
Provides validation installation and uninstallation encoding functionalities for a MA v2 client.

## Example

```ts
import { createModularAccountV2Client, installValidationActions, getDefaultSingleSignerValidationModuleAddress, SingleSignerValidationModule } from "@alchemy/smart-accounts";
import { installValidationActions, SingleSignerValidationModule } from "@alchemy/smart-accounts";
import { Address } from "viem";

const client = (await createModularAccountV2Client({ ... })).extend(installValidationActions);
const sessionKeyAddress: Address = "0x1234";
const sessionKeyEntityId: number = 1;

await client.installValidation({
const callData = await client.encodeInstallValidation({
validationConfig: {
moduleAddress: getDefaultSingleSignerValidationModuleAddress(
client.chain
),
moduleAddress: getDefaultSingleSignerValidationModuleAddress(client.chain),
entityId: sessionKeyEntityId,
isGlobal: true,
isSignatureValidation: false,
Expand All @@ -47,15 +45,7 @@ await client.installValidation({
hooks: [],
});

await client.uninstallValidation({
moduleAddress: sessionKeyAddress,
entityId: sessionKeyEntityId,
uninstallData: SingleSignerValidationModule.encodeOnUninstallData({
entityId: sessionKeyEntityId,
}),
hookUninstallDatas: [],
});

await client.sendUserOperation({ callData, account });
```

## Type Parameters
Expand Down Expand Up @@ -124,7 +114,7 @@ await client.uninstallValidation({
</td>

<td>
The client instance which provides account and sendUserOperation functionality.
The client instance which provides account functionality.
</td>
</tr>

Expand All @@ -135,4 +125,4 @@ await client.uninstallValidation({

[`InstallValidationActions`](../type-aliases/InstallValidationActions)\<[`IsUndefined`](https://viem.sh)\<`TAccount`> _extends_ `true` ? `undefined` : [`ModularAccountV2`](../type-aliases/ModularAccountV2)>

- An object containing two methods, `installValidation` and `uninstallValidation`.
- An object containing `encodeInstallValidation` and `encodeUninstallValidation`.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ layout: reference
function isModularAccountV2(account): account is ModularAccountV2Base;
```

Defined in: [packages/smart-accounts/src/ma-v2/utils/account.ts:130](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/ma-v2/utils/account.ts#L130)
Defined in: [packages/smart-accounts/src/ma-v2/utils/account.ts:128](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/ma-v2/utils/account.ts#L128)

Checks if an account is a ModularAccountV2.

Expand Down
Loading
Loading