Skip to content

fix(ada): providing unsigned sweep support for WRW#8248

Draft
dgm003 wants to merge 1 commit intomasterfrom
fix/ada-unsigned-sweep-CSHLD-134
Draft

fix(ada): providing unsigned sweep support for WRW#8248
dgm003 wants to merge 1 commit intomasterfrom
fix/ada-unsigned-sweep-CSHLD-134

Conversation

@dgm003
Copy link
Contributor

@dgm003 dgm003 commented Mar 5, 2026

Ticket: CSHLD-134

Description

Extends the ADA unsigned sweep (cold wallet recovery) flow to correctly handle token-holding wallets.

Two gaps existed in the unsigned sweep path:

  1. 'explainTransaction()' stripped 'multiAssets' from outputs — token info was never surfaced in the parsed/explained view
  2. 'recover()' function unsigned path only used parsedTx.outputs[0], so token transactions with 2 outputs were broken

Changes:

  • transaction.ts: Added extractTokenTransfers() helper that converts CardanoWasm.MultiAsset into a flat '{ policyId, assetName, quantity }' array. Updated 'explainTransaction()' return type and output mapping to include 'tokenTransfers?' per output.
  • ada.ts: Fixed recover() unsigned sweep path to map over all 'parsedTx.outputs' instead of hardcoding only 'outputs[0]', with 'tokenTransfers' passed through.
  • ada.ts test: Added test for unsigned sweep with ADA+Token UTXOs — asserts 2 inputs, 2 outputs, correct token amounts, and tokenTransfers populated in explainTransaction().

Issue Number

CSHLD-134

Type of change

Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Ran npx mocha test file

  • All 160 existing unit tests pass
  • New unit test added: 'should recover ADA plus token UTXOs - token and ADA both appear in outputs (unsigned sweep)'
  • Validates 2 inputs (ADA UTXO + token UTXO), 2 outputs (token output with correct MultiAsset + ADA remainder), and 'tokenTransfers' in 'explainTransaction()'

@dgm003 dgm003 force-pushed the fix/ada-unsigned-sweep-CSHLD-134 branch from 6269f8c to 2321317 Compare March 5, 2026 08:08
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