pub trait OnchainWallet: MaybeSend + MaybeSync {
// Required methods
fn transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WalletTx>, PaymentError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn transactions_by_tx_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<Txid, WalletTx>, PaymentError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn build_tx<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
fee_rate_sats_per_kvb: Option<f32>,
recipient_address: &'life1 str,
asset_id: &'life2 str,
amount_sat: u64,
) -> Pin<Box<dyn Future<Output = Result<Transaction, PaymentError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn build_drain_tx<'life0, 'life1, 'async_trait>(
&'life0 self,
fee_rate_sats_per_kvb: Option<f32>,
recipient_address: &'life1 str,
enforce_amount_sat: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Transaction, PaymentError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn build_tx_or_drain_tx<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
fee_rate_sats_per_kvb: Option<f32>,
recipient_address: &'life1 str,
asset_id: &'life2 str,
amount_sat: u64,
) -> Pin<Box<dyn Future<Output = Result<Transaction, PaymentError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn next_unused_address<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Address, PaymentError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn tip<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = u32> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn pubkey(&self) -> Result<String>;
fn fingerprint(&self) -> Result<String>;
fn sign_message(&self, msg: &str) -> Result<String>;
fn check_message(
&self,
message: &str,
pubkey: &str,
signature: &str,
) -> Result<bool>;
fn full_scan<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PaymentError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Required Methods§
Sourcefn transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WalletTx>, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WalletTx>, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all transactions in the wallet
Sourcefn transactions_by_tx_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<Txid, WalletTx>, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transactions_by_tx_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<Txid, WalletTx>, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all transactions in the wallet mapped by tx id
Sourcefn build_tx<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
fee_rate_sats_per_kvb: Option<f32>,
recipient_address: &'life1 str,
asset_id: &'life2 str,
amount_sat: u64,
) -> Pin<Box<dyn Future<Output = Result<Transaction, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn build_tx<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
fee_rate_sats_per_kvb: Option<f32>,
recipient_address: &'life1 str,
asset_id: &'life2 str,
amount_sat: u64,
) -> Pin<Box<dyn Future<Output = Result<Transaction, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Build a transaction to send funds to a recipient
Sourcefn build_drain_tx<'life0, 'life1, 'async_trait>(
&'life0 self,
fee_rate_sats_per_kvb: Option<f32>,
recipient_address: &'life1 str,
enforce_amount_sat: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Transaction, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn build_drain_tx<'life0, 'life1, 'async_trait>(
&'life0 self,
fee_rate_sats_per_kvb: Option<f32>,
recipient_address: &'life1 str,
enforce_amount_sat: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Transaction, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Builds a drain tx.
§Arguments
fee_rate_sats_per_kvb
: custom drain tx feeraterecipient_address
: drain tx recipientenforce_amount_sat
: if set, the drain tx will only be built if the amount transferred is this amount, otherwise it will fail with a validation error
Sourcefn build_tx_or_drain_tx<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
fee_rate_sats_per_kvb: Option<f32>,
recipient_address: &'life1 str,
asset_id: &'life2 str,
amount_sat: u64,
) -> Pin<Box<dyn Future<Output = Result<Transaction, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn build_tx_or_drain_tx<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
fee_rate_sats_per_kvb: Option<f32>,
recipient_address: &'life1 str,
asset_id: &'life2 str,
amount_sat: u64,
) -> Pin<Box<dyn Future<Output = Result<Transaction, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Build a transaction to send funds to a recipient. If building a transaction
results in an InsufficientFunds error, attempt to build a drain transaction
validating that the amount_sat
matches the drain output.
Sourcefn next_unused_address<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Address, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next_unused_address<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Address, PaymentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the next unused address in the wallet
Sourcefn tip<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = u32> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn tip<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = u32> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the current tip of the blockchain the wallet is aware of
Sourcefn fingerprint(&self) -> Result<String>
fn fingerprint(&self) -> Result<String>
Get the fingerprint of the wallet
Sourcefn sign_message(&self, msg: &str) -> Result<String>
fn sign_message(&self, msg: &str) -> Result<String>
Sign given message with the wallet private key. Returns a zbase encoded signature.