Add a dedicated transaction viewing type to the experimental API
Maintainers usually reply within 2 days
@palas is already working on this.
Since Nov 13, 2026.
Assessment
This issue has not been assessed yet.
Description
Summary
cardano-api should give the CLI a ready-made view of a decoded tx. The CLI should only format it.
API = what is in the tx. CLI = how it is shown.
Why
- Today
transaction view(Cardano.CLI.Compatible.Json.Friendly) reads the ledger tx directly. It keeps its own split of shared vs top-level-only fields (sharedTxPairs,dijkstraTopLevelPairs). - The experimental API knows the same split (
TxBodyContent/SubTxBodyContent). Two copies, so they drift. - We can't reuse
TxBodyContent. It is for building txs and needs info a decoded tx doesn't have, e.g.txIns :: [(TxIn, AnyWitness era)].
Plan
cardano-api (experimental)
- Add a type for viewing a decoded tx, separate from the building type (
TxBodyContent). Use experimental API types as much as possible, not the ledger's. - Cover top-level txs and sub-txs. The types say which fields are shared and which are top-level only.
- Spending inputs: a plain list, no
AnyWitness. - Scripts, datums, redeemers and key witnesses: kept separate, as decoded.
- Redeemer pointers: resolved to their purposes from the tx body, as the renderer does today.
- Add conversions for top-level txs and sub-txs. Embedded sub-txs keep their order and their own witnesses.
cardano-cli
- The renderer takes the new type. Only friendly labels and JSON/YAML formatting stay in the CLI.
- Take the shared / top-level-only split from the API types. Don't keep a second one in the CLI.
-
friendly*functions throw (CIO) instead of returningEither (FileError e) ()(review comment).- Which:
friendly,friendlyTx,friendlyTxBody,friendlySubTx,friendlyProposal,friendlyCertificate. - Why: callers throw right away with
fromEitherIOCli.governance action vieweven drops the error withvoid.
- Which:
-
transaction viewoutput stays the same. Golden tests pass as they are.
Don't
- Don't assume an input is key-controlled because it has no redeemer (it could be a simple script).
- Don't look up the UTxO.
transaction viewdoesn't get it. - Don't invent info that isn't in the tx.
Notes
- Moving the current code to
cardano-apias it is can be a first step. It does not close this issue. read*functions moving toCIOis tracked in IntersectMBO/cardano-cli#1503.
- Dominant language
- Haskell
- Stars
- 41
- Forks
- 33
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 15
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IntersectMBO/cardano-api
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
IntersectMBO/cardano-api#1434 ·
Maintainers usually reply within 2 days
-
`Prelude.maximum: empty list` crash in fee estimation for empty `RequireAnyOf` (`{"type": "any", "scripts": []}`) scriptsPossibly taken @Jimbo4350 claimed this 8 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
IntersectMBO/cardano-api#1424 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 53/100
IntersectMBO/cardano-api#1431 ·
Maintainers usually reply within 2 days
-
type: enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
IntersectMBO/cardano-api#1423 ·
Maintainers usually reply within 2 days
-
Dijkstra era type: enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
IntersectMBO/cardano-api#1386 ·
Maintainers usually reply within 2 days
All issues in IntersectMBO/cardano-api
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
haskell/bytestring#730 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
seal-harness/seal-harness#399 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
fmidue/codeworld-tasks#124 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
reflex-frp/reflex#563 ·
-
The codecov job never gets a runner on macos-26 and is cancelledPossibly taken @yegor256 claimed this 1 day ago. Openbug
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
objectionary/phino#2524 · 1 comment ·
Maintainers usually reply within 1 day