lightning-kmp icon indicating copy to clipboard operation
lightning-kmp copied to clipboard

Clean up payment events

Open t-bast opened this issue 11 months ago • 1 comments

We have a PaymentSent event in NodeEvents.kt but we also have another one in Peer.kt that extends the SendPaymentResult sealed class and contains more cases (PaymentNotSent and OfferNotPaid). But those are emitted on a different event flow (_eventsFlow). We should re-work those to provide a unified payment event interface emitted on a single event flow (maybe an event flow dedicated to payments would make sense?).

t-bast avatar Feb 10 '25 15:02 t-bast

Also, payInvoice() and payOffer() should have twins that immediately answer with a paymentId and do not wait for the payment to occur. Callers would rely on events to find out about payment attempts.

pm47 avatar Feb 10 '25 15:02 pm47