IncomingPayment

data class IncomingPayment(preimage: ByteVector32, origin: IncomingPayment.Origin, received: IncomingPayment.Received?, createdAt: Long) : WalletPayment

An incoming payment received by this node. At first it is in a pending state, then will become either a success (if we receive a matching payment) or a failure (if the payment request expires).

Parameters

preimage

payment preimage, which acts as a proof-of-payment for the payer.

origin

origin of a payment (normal, swap, etc).

received

funds received for this payment, null if no funds have been received yet.

createdAt

absolute time in milliseconds since UNIX epoch when the payment request was generated.

Constructors

IncomingPayment
Link copied to clipboard
common
fun IncomingPayment(preimage: ByteVector32, origin: IncomingPayment.Origin)
IncomingPayment
Link copied to clipboard
common
fun IncomingPayment(preimage: ByteVector32, origin: IncomingPayment.Origin, received: IncomingPayment.Received?, createdAt: Long = currentTimestampMillis())

Types

Origin
Link copied to clipboard
common
sealed class Origin
Received
Link copied to clipboard
common
data class Received(receivedWith: Set<IncomingPayment.ReceivedWith>, receivedAt: Long)
ReceivedWith
Link copied to clipboard
common
sealed class ReceivedWith

Functions

completedAt
Link copied to clipboard
common
fun completedAt(): Long

Absolute time in milliseconds since UNIX epoch when the payment was completed.

isExpired
Link copied to clipboard
common
fun isExpired(): Boolean

A payment expires if its origin is Origin.Invoice and its invoice has expired. Origin.KeySend or Origin.SwapIn do not expire.

Properties

amount
Link copied to clipboard
common
open override val amount: MilliSatoshi

Total amount actually received for this payment after applying the fees. If someone sent you 500 and the fee was 10, this amount will be 490.

createdAt
Link copied to clipboard
common
val createdAt: Long
fees
Link copied to clipboard
common
open override val fees: MilliSatoshi

Total fees paid to receive this payment.

origin
Link copied to clipboard
common
val origin: IncomingPayment.Origin
paymentHash
Link copied to clipboard
common
val paymentHash: ByteVector32
preimage
Link copied to clipboard
common
val preimage: ByteVector32
received
Link copied to clipboard
common
val received: IncomingPayment.Received?