Class VirtualTxService
Fetches, stores, and prunes virtual transaction data for VTXOs. Virtual txs form the tree of pre-signed transactions from commitment tx to VTXO leaf. This data is required for unilateral exit (broadcasting the chain to claim funds on-chain).
public class VirtualTxService
- Inheritance
-
VirtualTxService
- Inherited Members
Constructors
VirtualTxService(IClientTransport, IVirtualTxStorage, IVtxoChainProofProvider, ILogger<VirtualTxService>?)
Fetches, stores, and prunes virtual transaction data for VTXOs. Virtual txs form the tree of pre-signed transactions from commitment tx to VTXO leaf. This data is required for unilateral exit (broadcasting the chain to claim funds on-chain).
public VirtualTxService(IClientTransport transport, IVirtualTxStorage storage, IVtxoChainProofProvider proofProvider, ILogger<VirtualTxService>? logger = null)
Parameters
transportIClientTransportstorageIVirtualTxStorageproofProviderIVtxoChainProofProviderloggerILogger<VirtualTxService>
Methods
EnsureHexPopulatedAsync(OutPoint, CancellationToken)
public Task EnsureHexPopulatedAsync(OutPoint vtxoOutpoint, CancellationToken cancellationToken = default)
Parameters
vtxoOutpointOutPointcancellationTokenCancellationToken
Returns
FetchAndStoreBranchAsync(OutPoint, VirtualTxMode, CancellationToken)
Fetch and store the virtual tx branch for a VTXO. In Lite mode, stores only txids and expiry. In Full mode, also fetches and stores raw tx hex.
public Task FetchAndStoreBranchAsync(OutPoint vtxoOutpoint, VirtualTxMode mode = VirtualTxMode.Full, CancellationToken cancellationToken = default)
Parameters
vtxoOutpointOutPointmodeVirtualTxModecancellationTokenCancellationToken
Returns
IsBranchBroadcastReadyAsync(OutPoint, CancellationToken)
True when every off-chain row of the VTXO's stored branch is fully signed — i.e. broadcastable from storage alone, with no operator refetch. Commitment rows are on-chain anchors and are skipped. Returns false when the branch is missing, has a null-hex off-chain row, or still holds a sig-less template.
public Task<bool> IsBranchBroadcastReadyAsync(OutPoint vtxoOutpoint, CancellationToken cancellationToken = default)
Parameters
vtxoOutpointOutPointcancellationTokenCancellationToken
Returns
PruneForSpentVtxosAsync(IReadOnlyCollection<OutPoint>, CancellationToken)
Prune virtual tx data for spent VTXOs. Removes branch entries, then cleans up orphaned VirtualTx rows.
public Task PruneForSpentVtxosAsync(IReadOnlyCollection<OutPoint> spentOutpoints, CancellationToken cancellationToken = default)
Parameters
spentOutpointsIReadOnlyCollection<OutPoint>cancellationTokenCancellationToken