IncomingPaymentsDb

interface IncomingPaymentsDb

Functions

addAndReceivePayment
Link copied to clipboard
common
abstract suspend fun addAndReceivePayment(preimage: ByteVector32, origin: IncomingPayment.Origin, receivedWith: Set<IncomingPayment.ReceivedWith>, createdAt: Long = currentTimestampMillis(), receivedAt: Long = currentTimestampMillis())

Simultaneously add and receive a payment. Use this method when receiving a spontaneous payment, for example a swap-in payment.

addIncomingPayment
Link copied to clipboard
common
abstract suspend fun addIncomingPayment(preimage: ByteVector32, origin: IncomingPayment.Origin, createdAt: Long = currentTimestampMillis())

Add a new expected incoming payment (not yet received).

getIncomingPayment
Link copied to clipboard
common
abstract suspend fun getIncomingPayment(paymentHash: ByteVector32): IncomingPayment?

Get information about an incoming payment (paid or not) for the given payment hash, if any.

listExpiredPayments
Link copied to clipboard
common
abstract suspend fun listExpiredPayments(fromCreatedAt: Long = 0, toCreatedAt: Long = currentTimestampMillis()): List<IncomingPayment>

List expired unpaid normal payments created within specified time range (with the most recent payments first).

listIncomingPayments
Link copied to clipboard
common
abstract suspend fun listIncomingPayments(count: Int, skip: Int, filters: Set<PaymentTypeFilter> = setOf()): List<IncomingPayment>

List incoming payments (with the most recent payments first).

listReceivedPayments
Link copied to clipboard
common
abstract suspend fun listReceivedPayments(count: Int, skip: Int, filters: Set<PaymentTypeFilter> = setOf()): List<IncomingPayment>

List received payments (with most recent payments first).

receivePayment
Link copied to clipboard
common
abstract suspend fun receivePayment(paymentHash: ByteVector32, receivedWith: Set<IncomingPayment.ReceivedWith>, receivedAt: Long = currentTimestampMillis())

Mark an incoming payment as received (paid). Note that this function assumes that there is a matching payment request in the DB, otherwise it will be a no-op.

removeIncomingPayment
Link copied to clipboard
common
abstract suspend fun removeIncomingPayment(paymentHash: ByteVector32): Boolean

Remove a pending incoming payment.

updateNewChannelReceivedWithChannelId
Link copied to clipboard
common
abstract suspend fun updateNewChannelReceivedWithChannelId(paymentHash: ByteVector32, channelId: ByteVector32)

Update the channel id of the payments parts that have been received with a new channel, for a given payment hash. If there is no payments for this payment hash, or if the payment has not received any payment parts yet, then this method is a no-op.

Inheritors

PaymentsDb
Link copied to clipboard