# @alchemy/aa-accounts

> A collection of ERC-4337 compliant smart contract account interfaces

Latest version **3.19.0** (published 2024-08-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @alchemy/aa-accounts
pnpm add @alchemy/aa-accounts
yarn add @alchemy/aa-accounts
bun add @alchemy/aa-accounts
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.19.0 |
| Published | 2024-08-02 |
| First published | 2023-06-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 323 |
| Author | Alchemy |
| Maintainers | alchemy-team, brian-alchemy |

## Links

- npm: https://www.npmjs.com/package/@alchemy/aa-accounts
- Repository: https://github.com/alchemyplatform/aa-sdk
- Homepage: https://github.com/alchemyplatform/aa-sdk#readme
- Issues: https://github.com/alchemyplatform/aa-sdk/issues
- npm.io page: https://npm.io/package/@alchemy/aa-accounts

## Dependencies (2)

- [viem](https://npm.io/package/viem.md) 2.8.6
- [@alchemy/aa-core](https://npm.io/package/@alchemy/aa-core.md) ^3.18.2

## Recent versions

- 3.19.0 (latest) — 2024-08-02
- 3.0.0-alpha.13 (next) — 2024-02-16
- 3.18.2 — 2024-06-05
- 3.18.1 — 2024-06-04
- 3.18.0 — 2024-06-04
- 3.17.2 — 2024-05-31
- 3.17.1 — 2024-05-31
- 3.17.0 — 2024-05-29
- 3.16.0 — 2024-05-22
- 3.14.1 — 2024-05-17
- 3.13.1 — 2024-05-14
- 3.13.0 — 2024-05-10
- 3.12.3 — 2024-05-10
- 3.12.2 — 2024-05-09
- 3.12.1 — 2024-05-07
- … 79 more at https://npm.io/package/@alchemy/aa-accounts/versions

## README

# `@alchemy/aa-accounts`

This package contains various implementations of the [`BaseSmartContractAccount`](https://accountkit.alchemy.com/packages/aa-core/accounts/introduction.html#basesmartcontractaccount) class defined in `aa-core`. This repo is community maintained and we welcome contributions!

## Getting started

If you are already using the `@alchemy/aa-core` package, you can simply install this package and start using the accounts. If you are not using `@alchemy/aa-core`, you can install it and follow the instructions in the [Getting started](https://accountkit.alchemy.com/packages/aa-accounts/) docs to get started.

via `yarn`

```bash
yarn add @alchemy/aa-accounts
```

via `npm`

```bash
npm i -s @alchemy/aa-accounts
```

via `pnpm`

```bash
pnpm i @alchemy/aa-accounts
```

## Contributing

If you are looking to add a new account type, please follow the following structure.

1. Create a new folder in `src` with the name of your account type in `kebab-case` (we are following kebab casing for files throughout the project).
2. Create a new file in the folder you just created called `account.ts` and add your implementation for `BaseSmartContractAccount`
3. If needed, create a sub-folder in your account folder called `abis` and add your abis as `.ts` files. eg:

```ts
export const MyContractAbi = [] as const; // the as const is important so we can get correct typing from viem
```

4. If you need to extend the [`SmartAccountProvider`](https://accountkit.alchemy.com/packages/aa-core/smart-account-client/introduction.html) class, add a file called `provider.ts` and add your implementation for `SmartAccountProvider`.

- Ideally, your `Account` impl should _just_ work with the base provider provided by `aa-core`.
- If not, consider generalizing the use case and updating SmartAccountProvider

5. Add some tests for your account and provider (if created) by creating a subfolder in your `account/my-account` called `__tests__` and make sure your files end with the `.test.ts` suffix
6. export the classes and types you have defined in `src/index.ts`
7. Open a PR and we will review it as soon as possible!

---
_Source: https://npm.io/package/@alchemy/aa-accounts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
