Skip to content

stxerSimulate, trace and explore Stacks transactions

Run transactions against current or historical mainnet state, read how they executed, and share the result with a link.

What stxer is ​

stxer is tooling for Stacks developers:

  • API at https://api.stxer.xyz (mainnet) and https://testnet-api.stxer.xyz (testnet). JSON over HTTPS, no API key.
  • SDK: the stxer npm package, typed TypeScript wrappers for the API.
  • Inspector at stxer.xyz: trace viewer and simulation UI. Every simulation has a share link.
  • Explorer at explorer.stxer.xyz.

30-second quickstart ​

With curl, start a session forked at the current mainnet tip and evaluate some Clarity in it:

sh
curl -s -X POST https://api.stxer.xyz/devtools/v2/simulations \
  -H 'content-type: application/json' -d '{}'
# {"id":"cf7654e25f1fc629bf6060489a643e03"}

curl -s -X POST https://api.stxer.xyz/devtools/v2/simulations/cf7654e25f1fc629bf6060489a643e03 \
  -H 'content-type: application/json' \
  -d '{"steps":[{"Eval":["SP212Y5JKN59YP3GYG07K3S8W5SSGE4KH6B5STXER","","SP000000000000000000002Q6VF78.pox-4","(stx-get-balance tx-sender)"]}]}'
# {"steps":[{"Eval":{"Ok":"01000000000000000000000000055c9200"}}]}

Open https://stxer.xyz/simulations/mainnet/<id> to see it in the inspector.

With the SDK:

ts
import { SimulationBuilder } from 'stxer'

const id = await SimulationBuilder.new({ network: 'mainnet' })
  .withSender('SP212Y5JKN59YP3GYG07K3S8W5SSGE4KH6B5STXER')
  .addEvalCode('SP000000000000000000002Q6VF78.pox-4', '(stx-get-balance tx-sender)')
  .run()
// Simulation will be available at: https://stxer.xyz/simulations/mainnet/<id>

Next: the quickstart walks through a full session, and Limits explains fair use.