Reference

LegibilityReport

Every simulate call returns a LegibilityReport. Its JSON shape is stable across patch versions, safe to pipe into jq, render in a UI, or persist in a database for later review.

Top-level shape

LegibilityReport.json
{ "tx_signature_preview": "4dLPchZ8d2eCX2eobPtT9eN4DHw...", "fee_payer": "4kfEfEk7HrCLpdqo3vtrMYYF9e...", "uses_durable_nonce": true, "durable_nonce_warning": "Transaction uses a durable nonce ...", "instructions": [ DecodedInstruction, ... ], "account_diffs": [ AccountDiff, ... ], "token_transfers": [ TokenTransfer, ... ], "overall_risk": "Critical", "human_summary": [ "[System Program] ...", ... ], "simulation_logs": [ "Program 11111... invoke [1]", ... ], "simulation_success": true, "simulation_error": null }
fieldtypedescription
tx_signature_previewstringThe first 88-char signature of the tx, or '(unsigned)' if the tx has no signatures. Used as a human-readable identifier in logs and UI.
fee_payerstringBase58 pubkey of the first static account key in the message, which is always the fee payer by Solana convention.
uses_durable_noncebooleanTrue iff the first instruction is a System Program AdvanceNonceAccount. This is the only way the runtime permits durable-nonce transactions, so the detection is exact.
durable_nonce_warningstring | nullHuman-readable warning emitted when uses_durable_nonce is true. Null otherwise.
instructionsDecodedInstruction[]One entry per top-level instruction in the message, in on-wire order. Never empty for a well-formed transaction.
account_diffsAccountDiff[]Per-account state diffs from the simulation pre/post snapshots. Empty in offline mode or when no writable account changed.
token_transfersTokenTransfer[]Token transfer events synthesized from SPL Token / Token-2022 account layout in the pre/post diffs. Does not require a top-level Transfer instruction — CPI-only transfers are still captured.
overall_riskRiskLevelThe merged verdict. One of: Low, Medium, High, Critical. See /docs/risk-model for the exact escalation rules.
human_summarystring[]Ordered human-readable lines suitable for printing verbatim in a terminal or rendering as a list in a UI. Always non-empty.
simulation_logsstring[]The logs field from simulateTransaction, or ['(offline mode — simulation skipped)'] in offline mode.
simulation_successbooleanTrue if the simulation returned no error. Always true in offline mode.
simulation_errorstring | nullThe TransactionError formatted as a string, or null if the simulation succeeded.

DecodedInstruction

fieldtypedescription
program_idstringBase58 pubkey of the program the instruction targets.
program_namestringFriendly name the decoder assigned: System Program, SPL Token, Token-2022, Squads v4, Jupiter v6, Drift v2, Kamino Lend, MarginFi v2, or Unknown.
instruction_namestringSpecific instruction the decoder matched: Transfer, AdvanceNonceAccount, config_transaction_execute, etc. For Unknown programs, this is also 'Unknown'.
summarystringA one-sentence description of the instruction's effect, templated with account pubkeys where the decoder can resolve them.
accountsstring[]The base58 pubkeys of every account referenced by this instruction's accounts index list, in order.
riskRiskLevelThe per-instruction risk level. The classifier takes the max of every instruction's risk as the starting point for the overall verdict.
risk_reasonsstring[]Human-readable reasons the decoder attached to this risk level. May be empty for LOW-risk instructions.

AccountDiff

fieldtypedescription
addressstringBase58 pubkey of the account that changed.
owner_beforestring | nullOwning program of the account before the simulation.
owner_afterstring | nullOwning program after the simulation. A change here is escalated to CRITICAL by the classifier.
lamports_beforenumberLamport balance before the simulation.
lamports_afternumberLamport balance after the simulation.
lamports_deltanumberSigned delta (lamports_after - lamports_before). Large negative deltas escalate the overall verdict.
data_changedbooleanWhether any byte of the account's data region changed.
data_len_beforenumberLength of the data region before the simulation.
data_len_afternumberLength of the data region after the simulation.

TokenTransfer

fieldtypedescription
mintstringBase58 pubkey of the mint the transfer belongs to.
fromstringSource token account, or '?' if the source could not be determined from the diff alone.
tostringDestination token account, or '?' if not determinable.
ui_amountnumberRaw amount as a floating-point value. Decimals are not yet applied — multiply client-side.
raw_amountnumberRaw amount in the mint's base units.
decimalsnumberMint decimals. Always zero in v0.1.0 — fetch from the mint account client-side if you need proper UI formatting.

RiskLevel

A four-variant enum serialized as one of the following exact strings:

"Low" | "Medium" | "High" | "Critical"