Sjors / libwally-swift

Swift wrapper for LibWally, a collection of useful primitives for cryptocurrency wallets
MIT License
41 stars 18 forks source link

Feature request: Expose outputs to Transaction #87

Open Fonta1n3 opened 1 year ago

Fonta1n3 commented 1 year ago

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 1 year ago

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.

Fonta1n3 commented 1 year ago

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 1 year ago

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