Simulates user operations and returns a list of asset changes.
NOTE
This endpoint does not require a valid signature field in
userOperation
. It just requires a dummy signature for gas estimation. You can use the dummy signature mentioned below when the sender account isLightAccount
orSimpleAccount
:
0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c
NOTE
This method accepts an array containing a
UserOperation
, an Entrypoint address and a block override param however you will see these 3 items three times in the param array below. This has to do with Readme (our docs platform) not supporting multi-type arrays. To workaround, you will need to expand each option from those 3 array items to make the in-browser request work.If you are still unable to make the in-browser request work, you can use the sample request given below:
curl --location 'https://eth-mainnet.g.alchemy.com/v2/alch-demo' \ --header 'Content-Type: application/json' \ --data '{ "method": "alchemy_simulateUserOperationAssetChanges", "params": [ { "sender": "0xceb161d3e0B6d01bc0e87ECC27fF9f2E2eCDCD81", "nonce": "0x3", "initCode": "0x", "callData": "0xb61d27f600000000000000000000000043f6bfbe9dad44cf0a60570c30c307d949be4cd40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000645c833bfd000000000000000000000000613c64104b98b048b93289ed20aefd80912b3cde0000000000000000000000000000000000000000000000000de123e8a84f9901000000000000000000000000c9371ea30dea5ac745b71e191ba8cde2c4e66df500000000000000000000000000000000000000000000000000000000", "callGasLimit": "0x7A1200", "verificationGasLimit": "0x927C0", "preVerificationGas": "0x15F90", "maxFeePerGas": "0x656703D00", "maxPriorityFeePerGas": "0x13AB6680", "paymasterAndData": "0x9db7f05b0eb93eb242b5913596dcfaada756af5c", "signature": "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c" }, "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", "0x113CF6E" ] }'