Sjors/libwally-swift

Feature request: Expose outputs to Transaction

Opened this issue · 3 comments

It would be useful to be able to access the outputs of a raw transaction like so Transaction("rawtxhex").outputs just as you can access the inputs.

Sjors commented

I'm somewhat tempted to strip all non-psbt functionality from the library. Do you think you can do what you need with the PSBT methods? Or is something missing here, or even missing in libwally-core?

On the other hand, if you can make a PR and it's simple, that's fine too.

The only reason I am using Transaction is because the library allows me to create a Transaction manually with TxInput and TxOutput, whereas to generate a PSBT I need to pass it a PSBT.

Would be great to initialize a PSBT in a similar way that we initialize a Transaction, by supplying the inputs and outputs.

Sjors commented

That sounds like a more future-proof approach to me, but no idea how involved it is.