[−][src]Trait bdk::wallet::coin_selection::CoinSelectionAlgorithm
Trait for generalized coin selection algorithms
This trait can be implemented to make the Wallet
use a customized coin
selection algorithm when it creates transactions.
For an example see this module's documentation.
Required methods
fn coin_select(
&self,
utxos: Vec<UTXO>,
use_all_utxos: bool,
fee_rate: FeeRate,
amount_needed: u64,
input_witness_weight: usize,
fee_amount: f32
) -> Result<CoinSelectionResult, Error>
&self,
utxos: Vec<UTXO>,
use_all_utxos: bool,
fee_rate: FeeRate,
amount_needed: u64,
input_witness_weight: usize,
fee_amount: f32
) -> Result<CoinSelectionResult, Error>
Perform the coin selection
utxos
: the list of spendable UTXOsuse_all_utxos
: if true all utxos should be spent unconditionallyfee_rate
: fee rate to useamount_needed
: the amount in satoshi to selectinput_witness_weight
: the weight of an input's witness to keep into account for the feesfee_amount
: the amount of fees in satoshi already accumulated from adding outputs