diff --git a/bdk-ffi/src/bdk.udl b/bdk-ffi/src/bdk.udl index 4f60001d..d8e37e38 100644 --- a/bdk-ffi/src/bdk.udl +++ b/bdk-ffi/src/bdk.udl @@ -1104,6 +1104,10 @@ interface ElectrumClient { /// Returns the capabilities of the server. [Throws=ElectrumError] ServerFeaturesRes server_features(); + + /// Estimates the fee required in bitcoin per kilobyte to confirm a transaction in `number` blocks. + [Throws=ElectrumError] + f64 estimate_fee(u64 number); }; /// Response to an ElectrumClient.server_features request. diff --git a/bdk-ffi/src/electrum.rs b/bdk-ffi/src/electrum.rs index 40932044..86b53e95 100644 --- a/bdk-ffi/src/electrum.rs +++ b/bdk-ffi/src/electrum.rs @@ -104,6 +104,13 @@ impl ElectrumClient { .map_err(ElectrumError::from) .map(ServerFeaturesRes::from) } + + pub fn estimate_fee(&self, number: u64) -> Result { + self.0 + .inner + .estimate_fee(number as usize) + .map_err(ElectrumError::from) + } } pub struct ServerFeaturesRes {