Interface IPaymentStorage
- Namespace
- NArk.Abstractions.Payments
- Assembly
- NArk.Abstractions.dll
Persistence for outbound payments.
public interface IPaymentStorage
Methods
GetPayments(string[]?, string[]?, ArkPaymentStatus[]?, ArkPaymentMethod[]?, string[]?, string[]?, string?, int?, int?, CancellationToken)
Query payments with explicit filter parameters.
Task<IReadOnlyCollection<ArkPayment>> GetPayments(string[]? walletIds = null, string[]? paymentIds = null, ArkPaymentStatus[]? statuses = null, ArkPaymentMethod[]? methods = null, string[]? intentTxIds = null, string[]? swapIds = null, string? searchText = null, int? skip = null, int? take = null, CancellationToken cancellationToken = default)
Parameters
walletIdsstring[]Filter by wallet IDs. If null, all wallets.
paymentIdsstring[]Filter by payment IDs. If null, no filter.
statusesArkPaymentStatus[]Filter by status. If null, all statuses.
methodsArkPaymentMethod[]Filter by payment method. If null, all methods.
intentTxIdsstring[]Filter by linked intent tx IDs. If null, no filter.
swapIdsstring[]Filter by linked swap IDs. If null, no filter.
searchTextstringSearch text across PaymentId, Recipient. 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
SavePayment(ArkPayment, CancellationToken)
Save or update a payment.
Task SavePayment(ArkPayment payment, CancellationToken cancellationToken = default)
Parameters
paymentArkPaymentcancellationTokenCancellationToken
Returns
UpdatePaymentStatus(string, string, ArkPaymentStatus, string?, string?, CancellationToken)
Update the status of a payment.
Task<bool> UpdatePaymentStatus(string walletId, string paymentId, ArkPaymentStatus status, string? failReason = null, string? onchainTxId = null, CancellationToken cancellationToken = default)
Parameters
walletIdstringpaymentIdstringstatusArkPaymentStatusfailReasonstringonchainTxIdstringcancellationTokenCancellationToken
Returns
Events
PaymentChanged
event EventHandler<ArkPayment>? PaymentChanged