LtbLightning / bdk-flutter

Bitcoin Development Kit - Flutter Package
MIT License
63 stars 28 forks source link

signTransaction does not return signed PSBT. #14

Closed MrUnfunny closed 2 years ago

MrUnfunny commented 2 years ago

Hi @BitcoinZavior Thanks for your work on this project. signTransaction is a void function. It takes input of a PSBT but does not return signed PSBT. Is this the intended behaviour? I think it needs to return a signed PSBT.

MrUnfunny commented 2 years ago

bdk signs and updates the PSBT that it gets as input to the sign method but it isn't possible in dart as it does not support pass by reference arguments. So, we explicitly need to return the signed PSBT. Please let me know if I am mistaken.

BitcoinZavior commented 2 years ago

Hey @MrUnfunny yes you are right. Currently creating PSBT can be one method and then sign+broadcast can be another method.

BitcoinZavior commented 2 years ago

This should be possible as part of changes for https://github.com/LtbLightning/bdk-flutter/issues/16

BitcoinZavior commented 2 years ago

@MrUnfunny you should be able to get a signed psbt from signTx() now. Let me know if it works for you else reopen this issue. Thanks!