alchemyUserOperationSimulator

A middleware function to be used during simulation of user operations which leverages Alchemy’s RPC uo simulation method.

Import

1import { alchemyUserOperationSimulator } from "@account-kit/infra";

Usage

1import {
2 alchemyUserOperationSimulator,
3 alchemy,
4 sepolia,
5} from "@account-kit/infra";
6import { createSmartAccountClient } from "@aa-sdk/core";
7
8const alchemyTransport = alchemy({
9 chain: sepolia,
10 apiKey: "your-api-key",
11});
12
13const client = createSmartAccountClient({
14 chain: sepolia,
15 userOperationSimulator: alchemyUserOperationSimulator(alchemyTransport),
16 ...otherParams,
17});

Parameters

transport

AlchemyTransport An Alchemy Transport that can be used for making RPC calls to alchemy

Returns

ClientMiddlewareFn A middleware function to simulate and process user operations