Instant simulation
POST /devtools/v2/simulations:instant
Runs one transaction against chain state and returns its receipt, with optional reads taken after it. Nothing is stored, there is no trace and no share link. Built for wallets and apps that want to preview a transaction before sending it.
| Body field | Required | Meaning |
|---|---|---|
transaction | yes | The transaction, serialized to hex. It does not have to be signed. |
block_height | no | Stacks block to run on top of. Omit for the current tip. |
block_hash | no | Hash of that block; pass it with block_height. |
reads | no | Reads to take after the transaction, same forms as the session Reads step: DataVar, MapEntry, EvalReadonly, StxBalance, FtBalance, FtSupply, Nonce. |
Example
sh
curl -s -X POST https://api.stxer.xyz/devtools/v2/simulations:instant \
-H 'content-type: application/json' \
-d '{
"transaction": "0000000001040053…01a4",
"block_height": 1044660,
"block_hash": "31c1c350a532eb2a2e183c2bcdeb7496330ad8c0fa22173058168bab6031340b",
"reads": [ { "StxBalance": "SP212Y5JKN59YP3GYG07K3S8W5SSGE4KH6B5STXER" } ]
}'json
{
"receipt": {
"result": "0801000000000000000000000000000007db",
"post_condition_aborted": true,
"vm_error": "Post-condition check failure on fungible asset SP3W69VDG9VTZNG7NTW1QNCC1W45SNY98W1JSZBJH.flat-earth-stxcity::FlatEarth owned by SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.amm-vault-v2-01: 884190453436 SentGe 0",
"events": [],
"execution_cost": { "runtime": 0, "read_count": 0, "read_length": 0, "write_count": 0, "write_length": 0 },
"stx_burned": 0,
"tx_index": 0,
"costs": 18
},
"reads": [ { "Ok": "89952768" } ]
}The full example transaction is in the OpenAPI description. Read the receipt the same way as a session Transaction step: post_condition_aborted, then vm_error, then an (err …) in result.
To get a trace or a share link, run the transaction as a Transaction step in a session instead.