An operational developer tool, on-chain transaction inspector, simulation pre-flight debugger, batch transaction analyzer, and automated remediation code generator for the Stellar Soroban smart contract ecosystem.
Install from PyPI / local source in editable mode:
pip install -e .Both traptrace and soroban-explain CLI binaries are available globally.
Connects directly to Stellar RPC (Testnet, Mainnet, Futurenet, or local node) to fetch transactions, decode meta XDR, parse DiagnosticEvents, and pinpoint exact host traps with verified fixes.
# Inspect a failed transaction on Testnet
traptrace inspect 8a3f7c12d9e4a5b6c7d8e9f0123456789abcdef0123456789abcdef012345678 --network testnet
# Inspect on Mainnet with JSON output or export to Markdown report
traptrace inspect <TX_HASH> --network mainnet --export-md report.mdPerforms bulk diagnostics across arrays or datasets of transaction hashes, calculating aggregate failure rates, average CPU/memory consumption, category distributions, and top recurring trap root causes.
# Batch inspect transactions from a JSON file
traptrace batch-inspect -f failed_txs.json --network testnet --export-md batch_report.mdRuns simulateTransaction against live Soroban RPC without submitting on-chain. Renders real-time ANSI meter gauges for CPU gas instructions, WASM RAM bytes, auth requirements, and fee calculations.
traptrace simulate "AAAAAgAAAA..." --network testnetSimulates envelope XDR and validates Soroban authorization hierarchies (AddressCredentials, require_auth, require_auth_for_args), surfacing missing signatures or unauthorized sub-invocation trees.
traptrace auth-check "AAAAAgAAAA..." --network testnetGenerates tailored, idiomatic Rust and Soroban SDK remediation code snippets illustrating Before (Buggy pattern) vs After (Remediated best practice) for any catalog error.
# View fix for arithmetic overflow / underflow
traptrace fix arith-error
# Export remediation code directly to a Rust file
traptrace fix require-auth-missing --export-rs fix_auth.rsStreams contract and diagnostic events from the ledger in real time, alerting developers to contract panics, auth failures, and host errors as they occur.
# Stream events for a specific contract ID
traptrace watch --contract CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA --interval 2.0Audits contract ledger storage keys and checks live TTL values to detect expired/archived keys before transactions fail on-chain.
traptrace storage --contract CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA --keys "AAAA..." --network testnetDecodes base64-encoded DiagnosticEvent and SCVal structures into human-readable contract calls, arguments, and host error types.
traptrace decode "AAAAAgAAAA..."Performs tokenized fuzzy lookup across the 21 testnet-verified Soroban error catalog entries with ranked scoring.
traptrace explain "HostError::BudgetExceeded" --rank --detailed| Network | Flag | Default RPC URL |
|---|---|---|
| Testnet | --network testnet |
https://soroban-testnet.stellar.org |
| Mainnet | --network mainnet |
https://mainnet.sorobanrpc.com |
| Futurenet | --network futurenet |
https://rpc-futurenet.stellar.org |
| Local Standalone | --network local |
http://localhost:8000/soroban/rpc |
| Custom RPC | --rpc-url <URL> |
Any custom JSON-RPC 2.0 endpoint |
pytest tests/ -vAll 31 unit, mock integration, and operational tests pass with zero external dependencies.
MIT License. Copyright (c) 2026 TrapTrace.