Skip to content

Universal Stellar TX Decoder & Operation Breakdown #29

Description

@grantfox-oss

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

  • All 25 Stellar operation types decode correctly with fully resolved field values
  • Every Stellar result code maps to a plain-English explanation (no raw code shown without explanation)
  • Raw XDR decode works fully offline (no Horizon call required)
  • Account timeline loads the last 20 transactions in under 1 second
  • "Inspect in Composer" correctly pre-populates all operations in the Transaction Composer
  • Works on both testnet and mainnet via the global network toggle

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions