Skip to main content
POST
Simulate transaction

Authorizations

X-Api-Key
string
header
required

API key (programmatic access — recommended)

Send your API key in the X-Api-Key header. Keys start with nxs_ and are created in the dashboard (or via POST /api/keys with a session JWT).

Each key is scoped to one chain and one network (for example CARDANO_MAINNET), fixed at creation time. It cannot query a different network on the same chain, and it cannot query a different chain at all. A mismatched network parameter returns 400 Network Mismatch. Create one key per chain and network under the same account.

This is the credential most integrations should use.

Query Parameters

network
enum<string>

Accepts either the value listed here (CARDANO_MAINNET) or its kebab-case alias (cardano-mainnet); matching is case-insensitive. Omit it and the network is taken from the API key. A value that disagrees with the key's own network returns 400 Network Mismatch.

Available options:
CARDANO_MAINNET,
CARDANO_PREPROD,
CARDANO_PREVIEW,
MIDNIGHT_MAINNET,
MIDNIGHT_PREPROD,
MIDNIGHT_PREVIEW,
MIDNIGHT_STAGENET,
BITCOIN_MAINNET,
BITCOIN_TESTNET4,
SOLANA_MAINNET,
SOLANA_DEVNET

Body

application/json
transaction
string
required

Wire-format transaction, base64 (at most 1232 bytes decoded). Signatures are not checked, so an unsigned transaction (zeroed signatures) simulates too

Minimum string length: 1
accounts
string[]

Accounts to report before and after the simulation, at most 32

Maximum array length: 32
Minimum string length: 1

Response

200 - application/json

OK

Simulation of a transaction: outcome, logs and the requested accounts before and after

slot
integer<int64>

Slot the simulation ran at

Example:

312345679

success
boolean
err
null

The runtime error when success is false, as returned by RPC

logs
string[] | null

Program log lines (the node truncates long logs)

unitsConsumed
integer<int64> | null

Compute units the transaction consumed

before
object

The requested accounts as they were before the simulation (read just before it)

after
object[] | null

The requested accounts as the simulation left them (at slot), in the order requested. Null when the simulation failed. An account the transaction did not load is given as it was before (unchanged); a closed account appears with 0 lamports