bdk-ffi
bdk-ffi copied to clipboard
Expose add_foreign_utxo for TxBuilder
At the moment TxBuilder does not have add_foreign_utxo
https://bitcoindevkit.org/docs-rs/bdk/nightly/latest/bdk/wallet/tx_builder/struct.TxBuilder.html#method.add_foreign_utxo
It will be great to have this method exposed so that it can be used in the language and framework bindings.
There is interest from the community in using this method in apps.
Ref: https://github.com/LtbLightning/bdk-flutter/issues/63
@thunderbiscuit can you put this on the agenda for Tues call? Let's see if we can get it into the next release.
Looks like there are a few other changes needed before we can enable this function. Per @BitcoinZavior's example in https://github.com/LtbLightning/bdk-flutter/issues/63 other structs and functions we're missing in bdk-ffi
are:
- psbt::Input, shouldn't need to expose internals
- psbt::PsbtSighashType, only add to UDL?
- Wallet::get_psbt_input
- Descriptor::max_satisfaction_weight
Should we divide and conquer and do in multiple PRs or all in one?
This comparison shows the Rust
file changes: https://github.com/LtbLightning/bdk-flutter/compare/main...foreign-utxo?expand=1
This branch was made as an example for someone to use.
I went ahead and created #362 to add the Input
, PsbtSighashType
structs and the Wallet::get_psbt_input
function. Once those are in it should be easier to finish up this PR.
EDIT: forgot about the Descriptor::max_satisfaction_weight
function, I'll add that too.