Table of Contents

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

walletIds string[]

Filter by wallet IDs. If null, all wallets.

paymentIds string[]

Filter by payment IDs. If null, no filter.

statuses ArkPaymentStatus[]

Filter by status. If null, all statuses.

methods ArkPaymentMethod[]

Filter by payment method. If null, all methods.

intentTxIds string[]

Filter by linked intent tx IDs. If null, no filter.

swapIds string[]

Filter by linked swap IDs. If null, no filter.

searchText string

Search text across PaymentId, Recipient. 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<ArkPayment>>

SavePayment(ArkPayment, CancellationToken)

Save or update a payment.

Task SavePayment(ArkPayment payment, CancellationToken cancellationToken = default)

Parameters

payment ArkPayment
cancellationToken CancellationToken

Returns

Task

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

walletId string
paymentId string
status ArkPaymentStatus
failReason string
onchainTxId string
cancellationToken CancellationToken

Returns

Task<bool>

Events

PaymentChanged

event EventHandler<ArkPayment>? PaymentChanged

Event Type

EventHandler<ArkPayment>