@alchemy/aa-accounts
TypeScript icon, indicating that this package has built-in type declarations

3.12.3 • Public • Published

@alchemy/aa-accounts

This package contains various implementations of the 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 docs to get started.

via yarn

yarn add @alchemy/aa-accounts

via npm

npm i -s @alchemy/aa-accounts

via pnpm

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:
export const MyContractAbi = [] as const; // the as const is important so we can get correct typing from viem
  1. If you need to extend the SmartAccountProvider 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
  1. 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
  2. export the classes and types you have defined in src/index.ts
  3. Open a PR and we will review it as soon as possible!

Readme

Keywords

none

Package Sidebar

Install

npm i @alchemy/aa-accounts

Weekly Downloads

3,971

Version

3.12.3

License

MIT

Unpacked Size

4.29 MB

Total Files

843

Last publish

Collaborators

  • alchemy-team
  • brian-alchemy