alchemyUserOperationSimulator

1function alchemyUserOperationSimulator<TContext>(
2 transport,
3): ClientMiddlewareFn<TContext>;

Defined in: account-kit/infra/dist/types/middleware/userOperationSimulator.d.ts:26

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

Example

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});

Type Parameters

Type ParameterDefault type

TContext extends undefined | UserOperationContext

undefined | UserOperationContext

Parameters

ParameterTypeDescription

transport

AlchemyTransport

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

Returns

ClientMiddlewareFn<TContext>

A middleware function to simulate and process user operations