Also: update `wallet_electrum` example to use the method.
Ok(tx)
}
+ /// Broadcasts a transaction to the network.
+ ///
+ /// This is a re-export of [`ElectrumApi::transaction_broadcast`].
+ pub fn transaction_broadcast(&self, tx: &Transaction) -> Result<Txid, Error> {
+ self.inner.transaction_broadcast(tx)
+ }
+
/// Full scan the keychain scripts specified with the blockchain (via an Electrum client) and
/// returns updates for [`bdk_chain`] data structures.
///
use std::io::Write;
use std::str::FromStr;
-use bdk_electrum::electrum_client::{self, ElectrumApi};
+use bdk_electrum::electrum_client;
use bdk_electrum::BdkElectrumClient;
use bdk_file_store::Store;
use bdk_wallet::bitcoin::{Address, Amount};
assert!(finalized);
let tx = psbt.extract_tx()?;
- client.inner.transaction_broadcast(&tx)?;
+ client.transaction_broadcast(&tx)?;
println!("Tx broadcasted! Txid: {}", tx.txid());
Ok(())