Table of Contents

Interface IIntentStorage

Namespace
NArk.Abstractions.Intents
Assembly
NArk.Abstractions.dll

Persistence for Arkade intents.

public interface IIntentStorage

Methods

GetIntents(string[]?, string[]?, string[]?, OutPoint[]?, ArkIntentState[]?, DateTimeOffset?, string?, int?, int?, CancellationToken)

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

Task<IReadOnlyCollection<ArkIntent>> GetIntents(string[]? walletIds = null, string[]? intentTxIds = null, string[]? intentIds = null, OutPoint[]? containingInputs = null, ArkIntentState[]? states = null, DateTimeOffset? validAt = null, string? searchText = null, int? skip = null, int? take = null, CancellationToken cancellationToken = default)

Parameters

walletIds string[]

Filter by wallet IDs. If null/empty, all wallets.

intentTxIds string[]

Filter by intent transaction IDs. If null/empty, no filter.

intentIds string[]

Filter by intent IDs. If null/empty, no filter.

containingInputs OutPoint[]

Filter to intents containing any of these input outpoints. If null/empty, no filter.

states ArkIntentState[]

Filter by intent states. If null/empty, all states.

validAt DateTimeOffset?

Filter to intents valid at this time. If null, no time filter.

searchText string

Search text across IntentId, BatchId, CommitmentTransactionId. 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<ArkIntent>>

GetLockedVtxoOutpoints(string, CancellationToken)

Gets outpoints of VTXOs that are locked by pending intents. Used for balance calculations to exclude locked VTXOs from available balance.

Task<IReadOnlyCollection<OutPoint>> GetLockedVtxoOutpoints(string walletId, CancellationToken cancellationToken = default)

Parameters

walletId string

The wallet ID to get locked outpoints for

cancellationToken CancellationToken

Cancellation token

Returns

Task<IReadOnlyCollection<OutPoint>>

Collection of outpoints locked by pending intents

SaveIntent(string, ArkIntent, CancellationToken)

Inserts or updates an intent record.

Task SaveIntent(string walletId, ArkIntent intent, CancellationToken cancellationToken = default)

Parameters

walletId string
intent ArkIntent
cancellationToken CancellationToken

Returns

Task

Events

IntentChanged

Raised when an intent is saved or its state changes.

event EventHandler<ArkIntent>? IntentChanged

Event Type

EventHandler<ArkIntent>