-
Notifications
You must be signed in to change notification settings - Fork 321
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
Document example code or add helper code for fee estimation #1053
Comments
Nakamoto has a way of estimating feerate per block. https://docs.rs/nakamoto-client/0.4.0/nakamoto_client/enum.Event.html#variant.FeeEstimated. I don't yet know how we could use that information for feerate calculation in the case of CBF, but I will definitely look into it. |
In my opinion it would be great to have a trait that abstracts away the implementation details of each of the clients. |
I also think that having traits to abstract details is the way to go. |
Before adding a trait can we use the fee estimation in all the examples. |
Picking this up. Is there any opposition to adding a trait that abstracts away different sources, as mentioned by sebastianmontero and realeinherjar? |
Describe the enhancement
In the pre-1.0.0 BDK APIs the
Blockchain.estimate_fee
API provided a thin wrapper around blockchain clients native calls. Since theBlockchain
trait is not needed anymore we need a new way to help users estimate transaction fees.A couple options are:
electrum-client:
esplora-client BlockingClient:
eplora-client AsyncClient:
bitcoincore_rpc:
FeeEstimator
trait with implementations for each of the above. Could also add implementations for popular providers custom APIs like mempool.space.Use case
Getting the fee rate is a common operation most bdk based apps will need. It is also something that pre-1.0 BDK provided and if missing could slow down users migrating to the 1.0.
Additional context
This issue was discussed in #1052 by @tnull and in bitcoindevkit/.github#70 and on Discord.
The text was updated successfully, but these errors were encountered: