curl --request POST \
--url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "simulateTransaction",
"params": [
"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArczbMia1tLmq7zz4DinMNN0pJ1JtLdqIJPUw3YrGCzYAMHBsgN27lcgB6H2WQvFgyZuJYHa46puOQo9yQ8CVQbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp20C7Wj2aiuk5TReAXo+VTVg8QTHjs0UjNMMKCvpzZ+ABAgEBARU=",
{
"encoding": "base64"
}
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}curl --request POST \
--url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "simulateTransaction",
"params": [
"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArczbMia1tLmq7zz4DinMNN0pJ1JtLdqIJPUw3YrGCzYAMHBsgN27lcgB6H2WQvFgyZuJYHa46puOQo9yQ8CVQbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp20C7Wj2aiuk5TReAXo+VTVg8QTHjs0UjNMMKCvpzZ+ABAgEBARU=",
{
"encoding": "base64"
}
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}simulateTransaction method simulates sending a transaction. This method does not send a transaction, but rather runs the transaction and returns the result of the execution.
This method is useful for predicting how a transaction will affect the state of the blockchain without actually committing any changes. It can be used to estimate transaction fees, check for potential errors, and understand the effects of a transaction before sending it.
transaction (string) - A base64 encoded string representing the transaction to simulate.config (object, optional) - Configuration object containing the following optional fields:
encoding (string) - Encoding used for the transaction data. Default is “base64”.result object with details about the simulated transaction execution, including:
err - If the transaction simulation was successful, this field will be null. Otherwise, it will contain an error message.logs - An array of log messages the transaction produced during simulation.accounts - An array of account information after the simulation.unitsConsumed - The number of compute units consumed by the transaction.simulateTransaction is to estimate the cost and effects of a transaction before actually sending it. This can help developers ensure their transactions will execute as expected and avoid unnecessary fees from failed transactions.Was this page helpful?