# alchemyFeeEstimator | @account-kit/infra

> Function that estimates the transaction fees using Alchemy methods for a given client. It fetches the latest block and estimates the max priority fee per gas, applying any overrides or fee options provided.

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
const alchemyFeeEstimator: (transport) => ClientMiddlewareFn;
```

Defined in: [account-kit/infra/src/middleware/feeEstimator.ts:32](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/infra/src/middleware/feeEstimator.ts#L32)

Function that estimates the transaction fees using Alchemy methods for a given client.
It fetches the latest block and estimates the max priority fee per gas, applying any overrides or fee options provided.

## Example

```ts
import { alchemyFeeEstimator, alchemy } from "@account-kit/infra";
import { createSmartAccountClient } from "@aa-sdk/core";

const alchemyTransport = alchemy({
  chain: sepolia,
  apiKey: "your-api-key",
});

const client = createSmartAccountClient({
  feeEstimator: alchemyFeeEstimator(alchemyTransport),
  ...otherParams,
});
```

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `transport`
      </td>

      <td>
        `AlchemyTransport`
      </td>

      <td>
        An alchemy transport for making Alchemy specific RPC calls
      </td>
    </tr>

  </tbody>
</table>

## Returns

`ClientMiddlewareFn`

A middleware function that takes a transaction structure and fee options, and returns the augmented structure with estimated fees