alchemy_simulateUserOperationAssetChanges

Simulates user operations and returns a list of asset changes.

📘

NOTE

Please note that the results provided by API are based on the blockchain's state at the moment of simulation. Changes in the blockchain state, such as updates to contract variables or balances, can occur between the time of simulation and when you actually execute your UserOperation(UO).

This could lead to different outcomes than predicted. For instance, if a UO's effect is conditional on the current state of a contract, and this state is altered before the transaction is executed, the final result may not match the simulation.

Please be aware of this potential variance and consider it while using the API.

📘

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 is LightAccount or SimpleAccount:

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/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"
           ]
        }'

Network Support

ChainMainnetTestnet
Ethereum:white-check-mark::white-check-mark:
Polygon:white-check-mark::white-check-mark:
Arbitrum:white-check-mark::white-check-mark:
Optimism:white-check-mark::white-check-mark:
Base:white-check-mark::white-check-mark:
Frax:white-check-mark::white-check-mark:
Zora:white-check-mark::white-check-mark:
Language
URL
Click Try It! to start a request and see the response here!
ReadMe