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
walletIdsstring[]Filter by wallet IDs. If null/empty, all wallets.
intentTxIdsstring[]Filter by intent transaction IDs. If null/empty, no filter.
intentIdsstring[]Filter by intent IDs. If null/empty, no filter.
containingInputsOutPoint[]Filter to intents containing any of these input outpoints. If null/empty, no filter.
statesArkIntentState[]Filter by intent states. If null/empty, all states.
validAtDateTimeOffset?Filter to intents valid at this time. If null, no time filter.
searchTextstringSearch text across IntentId, BatchId, CommitmentTransactionId. If null, no text search.
skipint?Number of records to skip (for pagination). If null, no skip.
takeint?Number of records to take (for pagination). If null, no limit.
cancellationTokenCancellationTokenCancellation token.
Returns
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
walletIdstringThe wallet ID to get locked outpoints for
cancellationTokenCancellationTokenCancellation 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
walletIdstringintentArkIntentcancellationTokenCancellationToken
Returns
Events
IntentChanged
Raised when an intent is saved or its state changes.
event EventHandler<ArkIntent>? IntentChanged