Class ArkadeSwapIntentMonitoringService
- Namespace
- NArk.ArkadeIntents.Services
- Assembly
- NArk.ArkadeIntents.dll
Reactive glue that turns covenant-VTXO changes into swap-status transitions. It opens no
subscription of its own: the pending swaps' covenant scripts reach the shared
VtxoSynchronizationService via IArkadeIntentStorage (which is the
IActiveScriptsProvider), and this service simply reacts to
VtxosChanged and writes the new status back to storage. All change
notification lives on the storage (SwapsChanged).
public sealed class ArkadeSwapIntentMonitoringService : IHostedService
- Inheritance
-
ArkadeSwapIntentMonitoringService
- Implements
- Inherited Members
Remarks
A spent covenant VTXO means the solver fulfilled the swap; a swept one means it expired and the deposit is recoverable. Only in-flight swaps transition — UpdateStatus(string, ArkadeSwapIntentStatus, string?, CancellationToken) ignores terminal and Cancelling swaps, so a swap moved to Cancelling before its cancel-spend is never read as a fill.
Constructors
ArkadeSwapIntentMonitoringService(IVtxoStorage, IArkadeIntentStorage, IClientTransport, TimeProvider?, ILogger<ArkadeSwapIntentMonitoringService>?)
Creates the monitor.
public ArkadeSwapIntentMonitoringService(IVtxoStorage vtxoStorage, IArkadeIntentStorage intentStorage, IClientTransport transport, TimeProvider? time = null, ILogger<ArkadeSwapIntentMonitoringService>? logger = null)
Parameters
vtxoStorageIVtxoStorageThe chain view the covenant VTXOs change in.
intentStorageIArkadeIntentStorageThe swaps to transition, and the race guard on writing them.
transportIClientTransportWhere the spending transaction is fetched from, to prove a fill.
timeTimeProviderClock for the timelock comparisons; defaults to the system clock.
loggerILogger<ArkadeSwapIntentMonitoringService>Optional logger.
Methods
StartAsync(CancellationToken)
Triggered when the application host is ready to start the service.
public Task StartAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenIndicates that the start process has been aborted.
Returns
StopAsync(CancellationToken)
Triggered when the application host is performing a graceful shutdown.
public Task StopAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenIndicates that the shutdown process should no longer be graceful.