Trait WalletSource
pub trait WalletSource {
// Required methods
fn list_confirmed_utxos(&self) -> Result<Vec<Utxo>, ()>;
fn get_change_script(&self) -> Result<Script, ()>;
fn sign_tx(&self, tx: Transaction) -> Result<Transaction, ()>;
}
Expand description
An alternative to CoinSelectionSource
that can be implemented and used along Wallet
to
provide a default implementation to CoinSelectionSource
.
Required Methods§
fn list_confirmed_utxos(&self) -> Result<Vec<Utxo>, ()>
fn list_confirmed_utxos(&self) -> Result<Vec<Utxo>, ()>
Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
fn get_change_script(&self) -> Result<Script, ()>
fn get_change_script(&self) -> Result<Script, ()>
Returns a script to use for change above dust resulting from a successful coin selection attempt.
fn sign_tx(&self, tx: Transaction) -> Result<Transaction, ()>
fn sign_tx(&self, tx: Transaction) -> Result<Transaction, ()>
Signs and provides the full TxIn::script_sig
and TxIn::witness
for all inputs within
the transaction known to the wallet (i.e., any provided via
WalletSource::list_confirmed_utxos
).