pub mod primitives; pub use crate::primitives::{ScriptStatus, Subscription, Watchable}; use anyhow::Result; use bdk_wallet::{export::FullyNodedExport, Balance}; use bitcoin::{Address, Amount, Network, Psbt, Txid, Weight}; #[async_trait::async_trait] pub trait BitcoinWallet: Send + Sync { async fn balance(&self) -> Result; async fn balance_info(&self) -> Result; async fn new_address(&self) -> Result
; async fn send_to_address( &self, address: Address, amount: Amount, spending_fee: Amount, change_override: Option
, ) -> Result; async fn send_to_address_dynamic_fee( &self, address: Address, amount: Amount, change_override: Option
, ) -> Result; async fn sweep_balance_to_address_dynamic_fee( &self, address: Address, ) -> Result; async fn sign_and_finalize(&self, psbt: bitcoin::psbt::Psbt) -> Result; async fn broadcast( &self, transaction: bitcoin::Transaction, kind: &str, ) -> Result<(Txid, Subscription)>; async fn sync(&self) -> Result<()>; async fn subscribe_to(&self, tx: Box) -> Subscription; async fn status_of_script(&self, tx: &dyn Watchable) -> Result; async fn get_raw_transaction( &self, txid: Txid, ) -> Result>>; async fn max_giveable(&self, locking_script_size: usize) -> Result<(Amount, Amount)>; async fn estimate_fee(&self, weight: Weight, transfer_amount: Option) -> Result; fn network(&self) -> Network; fn finality_confirmations(&self) -> u32; async fn wallet_export(&self, role: &str) -> Result; }