Table of Contents

Interface IVtxoStorage

Namespace
NArk.Abstractions.VTXOs
Assembly
NArk.Abstractions.dll

Persistence for VTXOs; also drives the active-script subscription via IActiveScriptsProvider.

public interface IVtxoStorage : IActiveScriptsProvider
Inherited Members

Methods

GetVtxos(IReadOnlyCollection<string>?, IReadOnlyCollection<OutPoint>?, string[]?, bool, string?, int?, int?, CancellationToken)

Query VTXOs with explicit filter parameters. Adding new parameters will cause compile errors for implementors, ensuring they handle new filters.

Task<IReadOnlyCollection<ArkVtxo>> GetVtxos(IReadOnlyCollection<string>? scripts = null, IReadOnlyCollection<OutPoint>? outpoints = null, string[]? walletIds = null, bool includeSpent = false, string? searchText = null, int? skip = null, int? take = null, CancellationToken cancellationToken = default)

Parameters

scripts IReadOnlyCollection<string>

Filter by script hex strings. If null, no script filter applied.

outpoints IReadOnlyCollection<OutPoint>

Filter by specific outpoints. If null, no outpoint filter applied.

walletIds string[]

Filter by wallet IDs (requires join with contracts). If null, no wallet filter.

includeSpent bool

Include spent VTXOs. Default: false (unspent only).

searchText string

Search text for TransactionId or Script. If null, no text search.

skip int?

Number of records to skip (for pagination). If null, no skip.

take int?

Number of records to take (for pagination). If null, no limit.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<IReadOnlyCollection<ArkVtxo>>

UpsertVtxo(ArkVtxo, CancellationToken)

Inserts or updates a VTXO. Returns true when a new record was created.

Task<bool> UpsertVtxo(ArkVtxo vtxo, CancellationToken cancellationToken = default)

Parameters

vtxo ArkVtxo
cancellationToken CancellationToken

Returns

Task<bool>

Events

VtxosChanged

Raised when a VTXO is inserted or updated.

event EventHandler<ArkVtxo>? VtxosChanged

Event Type

EventHandler<ArkVtxo>