Skip to content

feat(ui): raw transaction inspector on the transaction details sheet - #824

Merged
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
feat/raw-tx-viewer
Jul 16, 2026
Merged

QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
feat/raw-tx-viewer

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

What

Two new rows on the transaction detail sheet, above "View in Block Explorer":

  • View Transaction — a full consensus-field inspector for the transaction's stored raw bytes:
    • Overview: txid, version, DIP-2 type (named: ProRegTx, CbTx, Asset Lock, …), size, locktime, block height, network fee.
    • Inputs: outpoint (txid:vout), best-effort sender address (SDK TransactionDecoder P2PKH scriptSig recovery), amount when the spent output is the wallet's own TXO (raw txs carry no input values), sequence, full scriptSig hex. Coinbase inputs labeled.
    • Outputs: value, P2PKH/P2SH address (shared ScriptAddressCodec), OP_RETURN contents (hex + ASCII when fully printable), non-standard scripts flagged, full scriptPubKey hex.
    • Special payload: type name, parsed fields for known types (CbTx version/height/merkle roots; Asset Lock credit outputs with amounts + destinations), full payload hex.
    • Raw transaction: complete serialized hex. Every value in the inspector is tap-to-copy with feedback.
  • Copy Raw Transaction — copies the serialized tx hex to the pasteboard; reports "Raw transaction unavailable" if the row's bytes aren't stored rather than copying nothing.

Implementation

  • RawTransactionInspector (new, Models/Transactions/Model): fetches PersistentTransaction.transactionData from the wallet SwiftData store and consensus-parses it app-side (ParsedRawTransaction: version/type split, scriptSigs, sequences, locktime, DIP-2 extra payload; CompactSize reader; throws on malformed/trailing bytes — the UI shows an honest "unavailable" state instead of guessed structure). Input addresses merge from the SDK decoder; input values from the wallet's own TXO rows keyed by PersistentTxo.makeOutpoint.
  • RawTransactionView (new, SwiftUI + @MainActor ViewModel) presented in the existing BottomSheet chrome from TXDetailViewController, which gains a .rawTransaction section with the two action rows.
  • Display-only throughout — nothing here feeds signing or validation.

Note for reviewers: the repo .gitignore contains a bare tx pattern that (case-insensitively) swallows new files under Sources/UI/Tx/ — RawTransactionView.swift is force-added. Possibly worth scoping that ignore pattern separately.

Testing

Testnet smoke on QA-iPhone16 / iPhone 16 Pro sims: classic sends/receives (inputs, outputs, scripts), a Core→Shielded transfer (Asset Lock payload with decoded credit outputs), coinbase rewards (CbTx payload, coinbase input), copy actions. Unit-test target pre-existing-broken per CLAUDE.md.

🤖 Generated with Claude Code

Two new rows on the transaction detail sheet, above View in Block
Explorer:
 - View Transaction: a full consensus-field inspector for the stored
   raw bytes — version/DIP-2 type (named), size, locktime, block
   height, fee; every input (outpoint, best-effort sender address,
   amount when the spent output is the wallet's own TXO, sequence,
   scriptSig); every output (value, P2PKH/P2SH address via
   ScriptAddressCodec, OP_RETURN contents as hex + ASCII when
   printable, non-standard scripts flagged, scriptPubKey); the DIP-2
   special payload (type name, parsed fields for CbTx and Asset Lock
   credit outputs, full hex); and the complete raw hex. Every value is
   tap-to-copy.
 - Copy Raw Transaction: copies the serialized transaction hex; reports
   "Raw transaction unavailable" when the row's bytes aren't stored
   instead of copying nothing.

Data layer: RawTransactionInspector fetches PersistentTransaction
.transactionData from the wallet's SwiftData store and consensus-parses
it app-side (ParsedRawTransaction — version/type split, scriptSigs,
sequences, locktime, extra payload; throws on malformed bytes rather
than guessing), merged with the SDK TransactionDecoder's input-address
recovery and the wallet's own TXO rows for input values. Display-only —
nothing feeds signing or validation.

Co-Authored-By: Claude Fable 5 <[email protected]>
QuantumExplorer added a commit that referenced this pull request Jul 16, 2026
The bare `tx` pattern (added in 2e34e82 to ignore a locally
downloaded Transifex CLI binary) also matched the tracked source
directories DashWallet/Sources/UI/Tx/ and DashWallet/Sources/Models/Tx/
on case-insensitive filesystems (core.ignorecase=true, the macOS
default). Existing tracked files were unaffected, but any NEW file
created under those directories was silently ignored — this bit
RawTransactionView.swift on PR #824, which had to be force-added.

Anchor the pattern to the repo root as `/tx`, which is where the CLI
binary lands. Verified:
- git check-ignore DashWallet/Sources/UI/Tx/Details/RawTransactionView.swift no longer matches
- a new probe file under Sources/UI/Tx/ now shows up in git status
- a root-level `tx` file is still ignored

Co-authored-by: Claude Fable 5 <[email protected]>
@QuantumExplorer
QuantumExplorer merged commit 852e7d9 into swift-sdk-integration Jul 16, 2026
1 check passed
QuantumExplorer added a commit that referenced this pull request Jul 16, 2026
…ector #824, Topper fix #823) — keep send-sheet arrow wiring + adopt onInfo

Co-Authored-By: Claude Fable 5 <[email protected]>
@QuantumExplorer
QuantumExplorer deleted the feat/raw-tx-viewer branch August 7, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant