Wallet

Trait Wallet 

Source
pub trait Wallet {
    // Required methods
    fn get_new_address<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Address, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_new_change_address<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Address, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_utxos_for_amount<'life0, 'async_trait>(
        &'life0 self,
        amount: Amount,
        fee_rate: u64,
        lock_utxos: bool,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Utxo>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sign_psbt_input<'life0, 'life1, 'async_trait>(
        &'life0 self,
        psbt: &'life1 mut Psbt,
        input_index: usize,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn import_address(&self, address: &Address) -> 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§

Source

fn get_new_address<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Address, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a new (unused) address.

Source

fn get_new_change_address<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Address, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a new (unused) change address.

Source

fn get_utxos_for_amount<'life0, 'async_trait>( &'life0 self, amount: Amount, fee_rate: u64, lock_utxos: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<Utxo>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a set of UTXOs to fund the given amount.

Source

fn sign_psbt_input<'life0, 'life1, 'async_trait>( &'life0 self, psbt: &'life1 mut Psbt, input_index: usize, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs a transaction input

Source

fn import_address(&self, address: &Address) -> Result<(), Error>

Import the provided address.

Source

fn unreserve_utxos(&self, outpoints: &[OutPoint]) -> Result<(), Error>

Unlock reserved utxo

Implementors§