Skip to content

Commit 36db4bd

Browse files
committed
feat(electrum): Add relay_fee and transaction_get_raw
1 parent 6ed0930 commit 36db4bd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

bdk-ffi/src/electrum.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,19 @@ impl ElectrumClient {
199199
pub fn ping(&self) -> Result<(), ElectrumError> {
200200
self.0.inner.ping().map_err(ElectrumError::from)
201201
}
202+
203+
/// Returns the minimum accepted fee by the server’s node in Bitcoin, not Satoshi.
204+
pub fn relay_fee(&self) -> Result<f64, ElectrumError> {
205+
self.0.inner.relay_fee().map_err(ElectrumError::from)
206+
}
207+
208+
/// Gets the raw bytes of a transaction with txid. Returns an error if not found.
209+
pub fn transaction_get_raw(&self, txid: Arc<Txid>) -> Result<Vec<u8>, ElectrumError> {
210+
self.0
211+
.inner
212+
.transaction_get_raw(&txid.0)
213+
.map_err(ElectrumError::from)
214+
}
202215
}
203216

204217
/// Response to an ElectrumClient.server_features request.

0 commit comments

Comments
 (0)