breez_sdk_liquid::lightning_125::events::bump_transaction

Trait WalletSource

pub trait WalletSource {
    // Required methods
    fn list_confirmed_utxos(&self) -> Result<Vec<Utxo>, ()>;
    fn get_change_script(&self) -> Result<ScriptBuf, ()>;
    fn sign_psbt(&self, psbt: Psbt) -> 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>, ()>

Returns all UTXOs, with at least 1 confirmation each, that are available to spend.

fn get_change_script(&self) -> Result<ScriptBuf, ()>

Returns a script to use for change above dust resulting from a successful coin selection attempt.

fn sign_psbt(&self, psbt: Psbt) -> 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).

If your wallet does not support signing PSBTs you can call psbt.extract_tx() to get the unsigned transaction and then sign it with your wallet.

Implementors§