Skip to content

simulateUserOperationChanges

Simulates user operation changes including asset changes for a specified user operation and returns the resulting state changes.

Import

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

Usage

import { simulateUserOperationChanges, createAlchemyPublicRpcClient } from "@account-kit/infra";
 
const client = createAlchemyPublicRpcClient(...);
const response = await simulateUserOperationChanges(client, {
uo: ...
});

Parameters

client

Client<Transport, TChain, TAccount, AlchemyRpcSchema> The client instance used to send the simulation request

args

SendUserOperationParameters<TAccount> The parameters of the user operation including the account and other overrides

Returns

Promise<SimulateUserOperationAssetChangesResponse> A promise that resolves to the response of the simulation showing the asset changes