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

How to get a transaction fees? #58

Closed
awaik opened this issue Feb 13, 2023 · 3 comments
Closed

How to get a transaction fees? #58

awaik opened this issue Feb 13, 2023 · 3 comments

Comments

@awaik
Copy link

awaik commented Feb 13, 2023

As we can see in the example with the package

final PartiallySignedTransaction psbt = await txBuilder.addRecipient(script, 700).feeRate(1.1).finish(wallet);

it was used as a predefined transaction fee.

Also, on the BDK website, there is an article https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/ about this issue.

So the question is - what is the recommended way to get fees for building a UX like in the attached image?

photo_2023-02-13 12 07 35

@BitcoinZavior
Copy link
Contributor

BitcoinZavior commented Feb 13, 2023

Hi @awaik enhanced fee estimation will be added to bdk-flutter in the next release. It will have flutter api for this functionality bitcoindevkit/bdk-ffi#289

In the meantime electrs provides fee estimation:
link to fee estimate reference from electrs: https://github.com/blockstream/esplora/blob/master/API.md#get-fee-estimates
This is an example call to the blockstream public server for current fee rates:
https://blockstream.info/api/fee-estimates

@BitcoinZavior
Copy link
Contributor

@awaik this is available in v0.27.1

@awaik
Copy link
Author

awaik commented Mar 21, 2023

@awaik this is available in v0.27.1

Thank you! There is an issue - I've tried to use it and always have a result 1.0 sat/vB. Code
final FeeRate rate = await blockchain!.estimateFee(13);

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

2 participants