Class VtxoSynchronizationService
public class VtxoSynchronizationService : IAsyncDisposable
- Inheritance
-
VtxoSynchronizationService
- Implements
- Inherited Members
Constructors
VtxoSynchronizationService(IVtxoStorage, IClientTransport, IEnumerable<IActiveScriptsProvider>, IWalletStorage?)
public VtxoSynchronizationService(IVtxoStorage vtxoStorage, IClientTransport arkClientTransport, IEnumerable<IActiveScriptsProvider> activeScriptsProviders, IWalletStorage? walletStorage = null)
Parameters
vtxoStorageIVtxoStoragearkClientTransportIClientTransportactiveScriptsProvidersIEnumerable<IActiveScriptsProvider>walletStorageIWalletStorage
VtxoSynchronizationService(IEnumerable<IActiveScriptsProvider>, IVtxoStorage, IClientTransport, ILogger<VtxoSynchronizationService>, IWalletStorage?)
public VtxoSynchronizationService(IEnumerable<IActiveScriptsProvider> activeScriptsProviders, IVtxoStorage vtxoStorage, IClientTransport arkClientTransport, ILogger<VtxoSynchronizationService> logger, IWalletStorage? walletStorage = null)
Parameters
activeScriptsProvidersIEnumerable<IActiveScriptsProvider>vtxoStorageIVtxoStoragearkClientTransportIClientTransportloggerILogger<VtxoSynchronizationService>walletStorageIWalletStorage
Fields
LastFullPollAtMetadataKey
Metadata key on Metadata where the
per-wallet "last successful full-set poll" timestamp is stored.
Cold-start catch-up reads MIN across wallets; routine polls
write the same StartedAt to every wallet on success.
public const string LastFullPollAtMetadataKey = "vtxo.lastFullPollAt"
Field Value
Properties
ListenedScripts
The scripts the subscription stream is currently subscribed to (for debugging/observability). The 5-second safety-net poll always operates on a freshly-derived active set, independent of this value.
public IReadOnlySet<string> ListenedScripts { get; }
Property Value
Methods
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
Returns
- ValueTask
A task that represents the asynchronous dispose operation.
PollScriptsForVtxos(IReadOnlySet<string>, DateTimeOffset?, CancellationToken)
On-demand polling for specific scripts, optionally restricted to VTXOs updated
after the given timestamp. Use an after value with a small
buffer (e.g. UtcNow - 5 minutes) for post-operation catch-up to avoid
re-fetching the full VTXO history of scripts that already have many entries.
public Task<int> PollScriptsForVtxos(IReadOnlySet<string> scripts, DateTimeOffset? after, CancellationToken cancellationToken = default)
Parameters
scriptsIReadOnlySet<string>Contract scripts to poll.
afterDateTimeOffset?Optional lower bound on VTXO last-update timestamp.
nullreturns everything.cancellationTokenCancellationTokenCancellation token.
Returns
PollScriptsForVtxos(IReadOnlySet<string>, CancellationToken)
On-demand polling for specific scripts. Use this to poll inactive contract scripts or any other scripts that aren't actively tracked.
public Task<int> PollScriptsForVtxos(IReadOnlySet<string> scripts, CancellationToken cancellationToken = default)
Parameters
scriptsIReadOnlySet<string>cancellationTokenCancellationToken
Returns
StartAsync(CancellationToken)
public Task StartAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationToken