# @alchemy/aa-infra

> Overview of aa-infra

> 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, along with `@alchemy/common`, replaces `@account-kit/infra`. 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 call bundler or paymaster RPCs directly via viem.

Alchemy Account Abstraction infrastructure utilities. Provides Rundler-specific fee estimation and RPC types for use with viem's bundler client.

## Installation

```bash
npm install @alchemy/aa-infra @alchemy/common viem
```

## Key Exports

- **`estimateFeesPerGas`** - Custom fee estimation using Alchemy's `rundler_maxPriorityFeePerGas` RPC method. Pass this as `userOperation.estimateFeesPerGas` when creating a viem `BundlerClient` pointed at Alchemy's Rundler.
- **`RundlerClient`** / **`RundlerRpcSchema`** - TypeScript types extending viem's `BundlerClient` with Rundler-specific RPC methods

## Usage

```ts
import { estimateFeesPerGas } from "@alchemy/aa-infra";
import { createBundlerClient } from "viem/account-abstraction";
import { sepolia } from "viem/chains";
import { alchemyTransport } from "@alchemy/common";

const bundlerClient = createBundlerClient({
  chain: sepolia,
  transport: alchemyTransport({ apiKey: "YOUR_API_KEY" }),
  userOperation: {
    estimateFeesPerGas,
  },
});
```

## License

MIT

## Type Aliases

| Type Alias                                                                    | Description |
| :---------------------------------------------------------------------------- | :---------- |
| [RundlerClient](/wallets/reference/aa-infra/type-aliases/RundlerClient)       | -           |
| [RundlerRpcSchema](/wallets/reference/aa-infra/type-aliases/RundlerRpcSchema) | -           |

## Functions

| Function                                                                       | Description                                                                                                                   |
| :----------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------- |
| [estimateFeesPerGas](/wallets/reference/aa-infra/functions/estimateFeesPerGas) | A custom `estimateFeesPerGas` function for viem bundler clients to use `rundler_getUserOperationGasPrice` for fee estimation. |