Skip to content

docs(transaction-output): deprecate it in favour of TxOut - #712

Open
jorbuedo wants to merge 1 commit into
IntersectMBO:mainfrom
jorbuedo:slice/transaction-output-deprecated
Open

jorbuedo wants to merge 1 commit into
IntersectMBO:mainfrom
jorbuedo:slice/transaction-output-deprecated

Conversation

@jorbuedo

@jorbuedo jorbuedo commented Oct 22, 2026 •

Copy link
Copy Markdown

One of the four fixes asked for in the closing comment on
#619 — deprecation, not an alias, so nothing
breaks.

The second TransactionOutput model. Please deprecate it in favor of TxOut instead of aliasing it, so it is not a breaking change.

The problem

Two models of a transaction output are public from the entry point under names that give no hint
which is which:

TransactionOutput TxOut
address AddressEras Address
value amount: Value assets: Assets
shape a Shelley and a Babbage class one class for both eras
used by nothing in the builders TransactionBody, the builders, the sdk

They reject each other, and the error says Expected TransactionOutput, actual [toString threw]
about a value that is a TransactionOutput — the other one.

Contents

  • packages/evolution/src/TransactionOutput.ts — @deprecated on the module and both classes,
    pointing at TxOut. No removal, no re-point, no alias: every caller holding a
    BabbageTransactionOutput keeps working, and new code is pointed the right way.
  • packages/evolution/test/TransactionOutput.deprecated.test.ts — pins the claim the note makes,
    so it cannot quietly stop being true. ⚠️ It passes before and after, by design: this PR
    changes documentation, not behaviour, and the test is a regression pin on the rejection, not a
    demonstration of a fix.
  • A patch changeset.

Verification

All six CI tasks run locally off ci.yml against this base (lint, type-check, test, build,
check:dts, docgen): green. packages/evolution: 1916 passed, 75 skipped, 0 failed.
devnet's suite needs Docker and was not run here.

Two models of a transaction output are public from the entry point under names
that give no hint which is which: this one (`address: AddressEras`,
`amount: Value`, a Shelley and a Babbage class) and `TxOut` (`address: Address`,
`assets: Assets`, one class for both eras), which is what `TransactionBody`, the
builders and the sdk take.

They reject each other, and the error says `Expected TransactionOutput, actual
[toString threw]` about a value that IS a `TransactionOutput` -- the other one.

Deprecation rather than removal or an alias: every caller holding a
`BabbageTransactionOutput` keeps working, and new code is pointed at `TxOut`.
The test pins the claim the note makes.

This branch has not been deployed

No deployments
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