# @alchemy/aa-alchemy

> adapters for @alchemy/aa-core for interacting with alchemy services

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

## Install

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

## 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-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 18 |
| Unpacked size | 2.7 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 323 |
| Author | Alchemy |
| Maintainers | alchemy-team, brian-alchemy |

## Links

- npm: https://www.npmjs.com/package/@alchemy/aa-alchemy
- 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-alchemy

## Dependencies (18)

- [zod](https://npm.io/package/zod.md) ^3.22.4
- [viem](https://npm.io/package/viem.md) 2.8.6
- [wagmi](https://npm.io/package/wagmi.md) ^2.8.8
- [zustand](https://npm.io/package/zustand.md) ^4.5.2
- [js-cookie](https://npm.io/package/js-cookie.md) ^3.0.5
- [@wagmi/core](https://npm.io/package/@wagmi/core.md) ^2.9.8
- [alchemy-sdk](https://npm.io/package/alchemy-sdk.md) ^3.0.0
- [tailwindcss](https://npm.io/package/tailwindcss.md) ^3.4.3
- [@turnkey/http](https://npm.io/package/@turnkey/http.md) ^2.6.2
- [@turnkey/viem](https://npm.io/package/@turnkey/viem.md) ^0.4.8
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^5.0.1
- [@alchemy/aa-core](https://npm.io/package/@alchemy/aa-core.md) ^3.19.0
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) ^4.3.9
- [@alchemy/aa-accounts](https://npm.io/package/@alchemy/aa-accounts.md) ^3.19.0
- [@tanstack/react-form](https://npm.io/package/@tanstack/react-form.md) ^0.19.4
- [@turnkey/iframe-stamper](https://npm.io/package/@turnkey/iframe-stamper.md) ^1.0.0
- [@turnkey/webauthn-stamper](https://npm.io/package/@turnkey/webauthn-stamper.md) ^0.4.3
- [@tanstack/zod-form-adapter](https://npm.io/package/@tanstack/zod-form-adapter.md) ^0.19.4

## 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.2 — 2024-05-26
- 3.16.1 — 2024-05-23
- 3.16.0 — 2024-05-22
- 3.15.0 — 2024-05-20
- 3.14.1 — 2024-05-17
- 3.14.0 — 2024-05-17
- 3.13.1 — 2024-05-14
- … 95 more at https://npm.io/package/@alchemy/aa-alchemy/versions

## README

# `@alchemy/aa-alchemy`

This package contains `AlchemySmartAccountClient`, an implementation of `SmartAccountClient` interface defined in `aa-core`. It also contains middleware for accessing the Alchemy Gas Manager (an [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) Paymaster) for doing Fee Estimates according to the expectations of the Alchemy [Rundler](https://github.com/alchemyplatform/rundler/tree/main) (an ERC-4337 Bundler). You may also find the util methods helpful. 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 `AlchemySmartAccountClient`. If you are not using `@alchemy/aa-core` yet, you can install it and follow the instructions in the ["Getting started"](https://accountkit.alchemy.com/packages/aa-alchemy/) docs to get started.

```bash [yarn]
yarn add @alchemy/aa-alchemy
```

```bash [npm]
npm i -s @alchemy/aa-alchemy
```

```bash [pnpm]
pnpm i @alchemy/aa-alchemy
```

## Usage

You can create `AlchemySmartAccountClient` like so:

```typescript
import {
  LightSmartContractAccount,
  getDefaultLightAccountFactoryAddress,
} from "@alchemy/aa-accounts";
import { AlchemyProvider } from "@alchemy/aa-alchemy";
import { LocalAccountSigner, type SmartAccountSigner } from "@alchemy/aa-core";
import { sepolia } from "@alchemy/aa-core";

const chain = sepolia;
const PRIVATE_KEY = "0xYourEOAPrivateKey";
const eoaSigner: SmartAccountSigner =
  LocalAccountSigner.privateKeyToAccountSigner(`0x${PRIVATE_KEY}`);

export const provider = new AlchemyProvider({
  apiKey: "ALCHEMY_API_KEY", // replace with your alchemy api key of the Alchemy app associated with the Gas Manager, get yours at https://dashboard.alchemy.com/
  chain,
}).connect(
  (rpcClient) =>
    new LightSmartContractAccount({
      chain,
      signer: eoaSigner,
      factoryAddress: getDefaultLightAccountFactoryAddress(chain),
      rpcClient,
    })
);
```

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