pub struct VtxoList { /* private fields */ }Implementations§
Source§impl VtxoList
impl VtxoList
pub fn new(dust: Amount, virtual_tx_outpoints: Vec<VirtualTxOutPoint>) -> Self
pub fn all(&self) -> impl Iterator<Item = &VirtualTxOutPoint>
pub fn all_unspent(&self) -> impl Iterator<Item = &VirtualTxOutPoint>
Sourcepub fn could_exit_unilaterally(
&self,
) -> impl Iterator<Item = &VirtualTxOutPoint>
pub fn could_exit_unilaterally( &self, ) -> impl Iterator<Item = &VirtualTxOutPoint>
VTXOs that are in a state that allows for unilateral exit.
This does not mean that the VTXOs are readily spendable on-chain, just that their ancestor chain can still be published.
Sourcepub fn spendable_offchain(&self) -> impl Iterator<Item = &VirtualTxOutPoint>
pub fn spendable_offchain(&self) -> impl Iterator<Item = &VirtualTxOutPoint>
VTXOs that can be spent in an offchain transaction.
Sourcepub fn spendable_offchain_at<'a, F>(
&'a self,
server_info: &'a Info,
now_unix_secs: i64,
server_pk_for_script: F,
) -> impl Iterator<Item = &'a VirtualTxOutPoint> + 'a
pub fn spendable_offchain_at<'a, F>( &'a self, server_info: &'a Info, now_unix_secs: i64, server_pk_for_script: F, ) -> impl Iterator<Item = &'a VirtualTxOutPoint> + 'a
VTXOs that can be spent in an offchain transaction at now_unix_secs.
This excludes otherwise-spendable VTXOs minted under a deprecated signer whose cooperative-sign window has closed. Those VTXOs cannot be forfeited by the server anymore; they become usable again only after they expire and move into the recovery path.
Sourcepub fn pending_recovery_due_to_signer_at<'a, F>(
&'a self,
server_info: &'a Info,
now_unix_secs: i64,
server_pk_for_script: F,
) -> impl Iterator<Item = &'a VirtualTxOutPoint> + 'a
pub fn pending_recovery_due_to_signer_at<'a, F>( &'a self, server_info: &'a Info, now_unix_secs: i64, server_pk_for_script: F, ) -> impl Iterator<Item = &'a VirtualTxOutPoint> + 'a
Otherwise-spendable VTXOs blocked only by a deprecated signer’s closed cooperative-sign window. These remain wallet funds, but they are pending recovery until expiry.
Sourcepub fn batch_settleable_at<'a, F>(
&'a self,
server_info: &'a Info,
now_unix_secs: i64,
server_pk_for_script: F,
) -> impl Iterator<Item = &'a VirtualTxOutPoint> + 'a
pub fn batch_settleable_at<'a, F>( &'a self, server_info: &'a Info, now_unix_secs: i64, server_pk_for_script: F, ) -> impl Iterator<Item = &'a VirtualTxOutPoint> + 'a
Unspent VTXOs that may be included in a cooperative batch settlement at now_unix_secs.
Recoverable VTXOs are always safe: they no longer need a server forfeit signature. Healthy VTXOs still need that signature, so VTXOs under an expired deprecated signer are excluded.
pub fn pre_confirmed(&self) -> impl Iterator<Item = &VirtualTxOutPoint>
pub fn confirmed(&self) -> impl Iterator<Item = &VirtualTxOutPoint>
Sourcepub fn recoverable(&self) -> impl Iterator<Item = &VirtualTxOutPoint>
pub fn recoverable(&self) -> impl Iterator<Item = &VirtualTxOutPoint>
Returns the list of recoverable VTXOs
A VTXO is recoverable if it:
- has expired;
- was swept already; or
- is sub-dust.
Sourcepub fn exit_ready(
&self,
now: Duration,
explorer_utxos: Vec<ExplorerUtxo>,
vtxos: HashMap<ScriptBuf, Vtxo>,
) -> impl Iterator<Item = &VirtualTxOutPoint>
pub fn exit_ready( &self, now: Duration, explorer_utxos: Vec<ExplorerUtxo>, vtxos: HashMap<ScriptBuf, Vtxo>, ) -> impl Iterator<Item = &VirtualTxOutPoint>
VTXOs that are already on-chain and can be spent unilaterally (the exit path is active).