Overview
When a Stellar transaction fails or behaves unexpectedly, a developer's first instinct is to look up the transaction hash — but raw Horizon JSON is verbose, nested, and hard to parse quickly under pressure. The Transaction Inspector is a dedicated decode-and-explain page: paste any transaction hash, Stellar address, or raw XDR and get a clean, structured, human-readable breakdown of everything that happened — operations, result codes, fee charged, ledger changes, and plain-English explanations of any errors.
What needs to be built
NestJS API — apps/api/src/modules/inspector/
-
GET /inspector/tx/:hash — fetches full transaction record from Horizon, decodes the XDR envelope, and returns a structured breakdown:
- Transaction-level: hash, ledger, created at, source account, sequence number, fee charged, memo, time bounds, signatures
- Per-operation: type, all fields resolved to human-readable values (e.g. asset codes resolved, account IDs truncated with copy button), result code with plain-English meaning
- Ledger effects: all effects produced (account credited, trustline created, offer executed, etc.)
-
GET /inspector/account/:publicKey/txs — returns the last 20 transactions for an account, each summarised (hash, date, op count, fee, success/fail)
-
POST /inspector/decode-xdr — decodes a raw XDR string (envelope, result, or fee bump) and returns the same structured format without a Horizon lookup
Next.js web — /inspector route
-
Single search input at the top accepting: transaction hash, Stellar public key (G...), or raw XDR string — auto-detects input type
-
For a tx hash: renders full structured breakdown (see API above)
- Operations listed as numbered cards, each showing type, fields, result code, and a colour-coded success/failure badge
- Effects accordion — expandable list of all ledger effects produced by the transaction
- Raw JSON toggle — reveals the unprocessed Horizon response for advanced users
-
For a public key: renders the last 20 transactions as a timeline list; clicking any row loads its full breakdown
-
For raw XDR: decodes locally and renders the same operation breakdown without any Horizon call
-
Error result codes rendered with plain-English explanation inline (e.g. op_underfunded → "The source account does not have enough XLM to complete this operation after accounting for the base reserve.")
-
"Inspect in Composer" button — loads the decoded transaction into the Transaction Composer for editing and re-submission
Acceptance Criteria
Overview
When a Stellar transaction fails or behaves unexpectedly, a developer's first instinct is to look up the transaction hash — but raw Horizon JSON is verbose, nested, and hard to parse quickly under pressure. The Transaction Inspector is a dedicated decode-and-explain page: paste any transaction hash, Stellar address, or raw XDR and get a clean, structured, human-readable breakdown of everything that happened — operations, result codes, fee charged, ledger changes, and plain-English explanations of any errors.
What needs to be built
NestJS API —
apps/api/src/modules/inspector/GET /inspector/tx/:hash— fetches full transaction record from Horizon, decodes the XDR envelope, and returns a structured breakdown:GET /inspector/account/:publicKey/txs— returns the last 20 transactions for an account, each summarised (hash, date, op count, fee, success/fail)POST /inspector/decode-xdr— decodes a raw XDR string (envelope, result, or fee bump) and returns the same structured format without a Horizon lookupNext.js web —
/inspectorrouteSingle search input at the top accepting: transaction hash, Stellar public key (G...), or raw XDR string — auto-detects input type
For a tx hash: renders full structured breakdown (see API above)
For a public key: renders the last 20 transactions as a timeline list; clicking any row loads its full breakdown
For raw XDR: decodes locally and renders the same operation breakdown without any Horizon call
Error result codes rendered with plain-English explanation inline (e.g.
op_underfunded→ "The source account does not have enough XLM to complete this operation after accounting for the base reserve.")"Inspect in Composer" button — loads the decoded transaction into the Transaction Composer for editing and re-submission
Acceptance Criteria