lightning-kmp
lightning-kmp copied to clipboard
Clean up payment events
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?).
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.