bitcoindevkit / rust-esplora-client

Bitcoin Esplora API client library. Supports plaintext, TLS and Onion servers. Blocking or async.
MIT License
29 stars 44 forks source link

feat: mempool get_recommended_fees #91

Closed storopoli closed 3 months ago

storopoli commented 3 months ago

You can test it with:

let builder = Builder::new("https://mempool.space/api");
let blocking_client = builder.clone().build_blocking();
let async_client = builder.build_async().unwrap();
let fee_estimates = blocking_client.get_recommended_fees().unwrap();
let fee_estimates_async = async_client.get_recommended_fees().await.unwrap();

A workaround for https://github.com/bitcoindevkit/bdk/issues/1519

Then, we can add a

mempool = ["esplora-client/mempool"]

to bdk/esplora/Cargo.toml

tnull commented 3 months ago

Is there any way to check the configured Esplora backend supports this API? IIUC, previously rust-electrum-client and rust-esplora-client were very cautious not to add any features that aren't supported by all implementations even for methods that are actually part of the latest protocol specs (e.g., see the discussion in https://github.com/bitcoindevkit/rust-electrum-client/pull/58). Did this policy change?

I just want to raise the question whether this crate should support the proprietary protocol extensions of mempool.space in such a specialized manner?

storopoli commented 3 months ago

Closing this since we might be adding a new crate bitcoindevkit/rust-mempool-client. To be discussed.

oleonardolima commented 2 months ago

Closing this since we might be adding a new crate bitcoindevkit/rust-mempool-client. To be discussed.

I started working on it, I'll share it as soon as I have a working PoC of it.

Discussions will be needed regarding testing it, as running a mempool.space instance on regtest was quite hard in the past, not sure about its current state.