Table of Contents

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

vtxoStorage IVtxoStorage

The chain view the covenant VTXOs change in.

intentStorage IArkadeIntentStorage

The swaps to transition, and the race guard on writing them.

transport IClientTransport

Where the spending transaction is fetched from, to prove a fill.

time TimeProvider

Clock for the timelock comparisons; defaults to the system clock.

logger ILogger<ArkadeSwapIntentMonitoringService>

Optional logger.

Methods

StartAsync(CancellationToken)

Triggered when the application host is ready to start the service.

public Task StartAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Indicates that the start process has been aborted.

Returns

Task

A Task that represents the asynchronous Start operation.

StopAsync(CancellationToken)

Triggered when the application host is performing a graceful shutdown.

public Task StopAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Indicates that the shutdown process should no longer be graceful.

Returns

Task

A Task that represents the asynchronous Stop operation.