Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API surface of the TxBuilder type #597

Open
6 of 9 tasks
thunderbiscuit opened this issue Sep 26, 2024 · 1 comment
Open
6 of 9 tasks

API surface of the TxBuilder type #597

thunderbiscuit opened this issue Sep 26, 2024 · 1 comment

Comments

@thunderbiscuit
Copy link
Member

thunderbiscuit commented Sep 26, 2024

After taking some time to look at what parts of the TxBuilder API were available/not available/useful for the bindings, many methods stood out. This issue will track them. Note that not all of those are top priority, but most of them we figured would be useful and not too costly to include either in the first version of the 1.0 or in a future feature release (1.1, 1.2, etc.)

  • TxBuilder::add_data
  • TxBuilder::current_height
  • TxBuilder::nlocktime
  • TxBuilder::coin_selection
  • TxBuilder::ordering
  • TxBuilder::sighash
  • TxBuilder::allow_dust
  • TxBuilder::policy_path
  • TxBuilder::version
@thunderbiscuit thunderbiscuit mentioned this issue Oct 9, 2024
5 tasks
@thunderbiscuit thunderbiscuit mentioned this issue Oct 22, 2024
10 tasks
@thunderbiscuit
Copy link
Member Author

thunderbiscuit commented Nov 22, 2024

Some notes related to the APIs I looked into:

1. TxBuilder::ordering

TxBuilder::ordering requires adding the TxOrdering type, which has the Custom variant:

Custom {
    input_sort: Arc<dyn Fn(&TxIn, &TxIn) -> Ordering>,
    output_sort: Arc<dyn Fn(&TxOut, &TxOut) -> Ordering>,
}

2. TxBuilder::sighash

TxBuilder::sighash requires adding the PsbtSighashType. I'm less familiar with this type, and the API does mention to be really careful when using the method. I'd like to be really sure I understand the PsbtSighashType and it's usage before opening this one up.

3. TxBuilder::coin_selection

TxBuilder::coin_selection requires adding the CoinSelectionAlgorithm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant