Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

This PR updates our UTXO transaction parsing capabilities with several
improvements for handling external outputs and better type definitions:

  • Add method to parse outputs with wallet keys without requiring valid wallet
    inputs, enabling identification of outputs belonging to a wallet
  • Update test fixtures to handle external outputs with 3 external outputs in
    new fixtures
  • Refactor ParsedInput/Output types with stronger typing (non-optional address
    fields) and explicit null values
  • Improve transaction parsing with functional style map/filter operations for
    better readability and error handling
  • Extract helper methods for summing input and output values to reduce code
    duplication
  • Add test coverage for OP_RETURN outputs in transaction parsing
  • Standardize naming convention with Rust snake_case and JavaScript camelCase

BTC-2652

OttoAllmendinger and others added 2 commits November 10, 2025 14:22
Update tests to expect external outputs in fixtures. The new fixtures
contain 3 external outputs, which changes validation expectations and
affects spend amount calculations.

Issue: BTC-2652

Co-authored-by: llm-git <llm-git@ttll.de>
Update the ParsedInput/Output types to use stronger typing (non-optional
address fields) and more explicit null values instead of undefined.

Also add test coverage for OP_RETURN outputs in transaction parsing.

Issue: BTC-2652

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review November 10, 2025 13:44
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner November 10, 2025 13:44
OttoAllmendinger and others added 3 commits November 10, 2025 17:23
Adds a new method to BitGoPsbt that allows parsing transaction outputs
with wallet keys without requiring valid wallet inputs. This enables
identification of which outputs belong to a given wallet, even if the
inputs don't belong to the same wallet.

The implementation reuses existing parsing logic and adds proper tests
that verify outputs can be correctly identified when using different
wallet keys.

Issue: BTC-2652

Co-authored-by: llm-git <llm-git@ttll.de>
Refactor BitGoPsbt transaction parsing methods to use functional style with
map/filter operations for improved readability and error handling. Extract
helper methods for summing input and output values to reduce code duplication.

Issue: BTC-2652

Co-authored-by: llm-git <llm-git@ttll.de>
Update documentation and implementation to follow a consistent naming
convention where:
- Rust WASM bindings use snake_case (Rust convention)
- TypeScript wrappers convert to camelCase (JS convention)

Update BitGoPsbt class implementation to follow this pattern and align
method call sites with the new naming.

Issue: BTC-2652

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2652.bitgo-psbt-parse-other-wallet-output branch from b727900 to a05e620 Compare November 10, 2025 16:23
@OttoAllmendinger OttoAllmendinger merged commit ab167b4 into master Nov 10, 2025
1 check passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-2652.bitgo-psbt-parse-other-wallet-output branch November 10, 2025 17:04
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.

3 participants