pub trait Wallet {
// Required methods
fn get_new_address(&self) -> Result<Address, Error>;
fn get_new_change_address(&self) -> Result<Address, Error>;
fn get_utxos_for_amount(
&self,
amount: u64,
fee_rate: u64,
lock_utxos: bool,
) -> Result<Vec<Utxo>, Error>;
fn import_address(&self, address: &Address) -> Result<(), Error>;
fn sign_psbt_input(
&self,
psbt: &mut Psbt,
input_index: usize,
) -> Result<(), Error>;
fn unreserve_utxos(&self, outpoints: &[OutPoint]) -> Result<(), Error>;
}
Expand description
Wallet trait to provide functionalities related to generating, storing and managing bitcoin addresses and UTXOs.
Required Methods§
Sourcefn get_new_address(&self) -> Result<Address, Error>
fn get_new_address(&self) -> Result<Address, Error>
Returns a new (unused) address.
Sourcefn get_new_change_address(&self) -> Result<Address, Error>
fn get_new_change_address(&self) -> Result<Address, Error>
Returns a new (unused) change address.
Sourcefn get_utxos_for_amount(
&self,
amount: u64,
fee_rate: u64,
lock_utxos: bool,
) -> Result<Vec<Utxo>, Error>
fn get_utxos_for_amount( &self, amount: u64, fee_rate: u64, lock_utxos: bool, ) -> Result<Vec<Utxo>, Error>
Get a set of UTXOs to fund the given amount.