pub trait WalletExt: BorrowMut<Wallet> {
// Provided methods
fn peek_next_address(&self) -> AddressInfo { ... }
fn unconfirmed_txids(&self) -> impl Iterator<Item = Txid> { ... }
fn unconfirmed_txs(&self) -> impl Iterator<Item = Arc<Transaction>> { ... }
fn is_trusted_utxo(&self, outpoint: OutPoint, min_confs: u32) -> bool { ... }
fn is_trusted_tx(&self, txid: Txid, min_confs: u32) -> bool { ... }
fn trusted_balance(&self, min_confs: u32) -> TrustedBalance { ... }
fn untrusted_utxos(&self, min_confs: u32) -> Vec<OutPoint> { ... }
fn set_checkpoint(&mut self, height: u32, hash: BlockHash) { ... }
fn make_signed_p2a_cpfp(
&mut self,
tx: &Transaction,
fees: MakeCpfpFees,
) -> Result<Transaction, CpfpInternalError> { ... }
}Expand description
An extension trait for Wallet.
Provided Methods§
Sourcefn peek_next_address(&self) -> AddressInfo
fn peek_next_address(&self) -> AddressInfo
Peek into the next address.
Sourcefn unconfirmed_txids(&self) -> impl Iterator<Item = Txid>
fn unconfirmed_txids(&self) -> impl Iterator<Item = Txid>
Returns an iterator for each unconfirmed transaction in the wallet.
Sourcefn unconfirmed_txs(&self) -> impl Iterator<Item = Arc<Transaction>>
fn unconfirmed_txs(&self) -> impl Iterator<Item = Arc<Transaction>>
Returns an iterator for each unconfirmed transaction in the wallet, useful for syncing with bitcoin core.
Sourcefn is_trusted_utxo(&self, outpoint: OutPoint, min_confs: u32) -> bool
fn is_trusted_utxo(&self, outpoint: OutPoint, min_confs: u32) -> bool
Check whether a UTXO can be trusted for spending.
Delegates to WalletExt::is_trusted_tx on the creating transaction.
Sourcefn is_trusted_tx(&self, txid: Txid, min_confs: u32) -> bool
fn is_trusted_tx(&self, txid: Txid, min_confs: u32) -> bool
Check whether a transaction can be trusted to confirm on chain.
A transaction is trusted if:
min_confsis 0 (unconditionally trusted), or- it has at least
min_confsconfirmations, or - all its inputs are ours and their creating transactions are also trusted (checked recursively).
To keep the check cheap, at most 100 ancestor transactions are visited. If the budget is exhausted the transaction is considered untrusted.
Sourcefn trusted_balance(&self, min_confs: u32) -> TrustedBalance
fn trusted_balance(&self, min_confs: u32) -> TrustedBalance
Compute the wallet balance using our recursive trust model.
Sourcefn untrusted_utxos(&self, min_confs: u32) -> Vec<OutPoint>
fn untrusted_utxos(&self, min_confs: u32) -> Vec<OutPoint>
Return all UTXOs that are untrusted.
Delegates to WalletExt::is_trusted_utxo for each UTXO.
Sourcefn set_checkpoint(&mut self, height: u32, hash: BlockHash)
fn set_checkpoint(&mut self, height: u32, hash: BlockHash)
Insert a checkpoint into the wallet.
It’s advised to use this only when recovering a wallet with a birthday.
fn make_signed_p2a_cpfp( &mut self, tx: &Transaction, fees: MakeCpfpFees, ) -> Result<Transaction, CpfpInternalError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.