bitcoinjs / coinselect

An unspent transaction output (UTXO) selection module for bitcoin.
MIT License
175 stars 101 forks source link

TransactionBuilder is now deprecated #45

Closed ekkis closed 4 years ago

ekkis commented 4 years ago

the main page shows an example using the TransactionBuilder. apparently we now need to use the Psbt class instead. could we modify the read me to use this new method?

junderw commented 4 years ago

Nice catch! Will work on it.

ekkis commented 4 years ago

thanks for the changes. could you demonstrate how to sign one of these transactions? the object returned by the new .Psbt() no longer has a .sign() and I don't find any examples. I'm tempted to go back to the TransactionBuilder...

ekkis commented 4 years ago

btw, it will sort of look like this:

tx.signInput(0, signingKey);
tx.validateSignaturesOfInput(0);
tx.finalizeAllInputs();
console.log(tx.extractTransaction().toHex());
junderw commented 4 years ago

There are tons of examples in bitcoinjs-lib integration tests (linked on the README) and PSBT is not a part of the coinselect library, so explaining it's use here is irrelevant.

ekkis commented 4 years ago

you're right. thanks