You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
event: expose PaidBolt12Invoice in PaymentSuccessful for proof of payment
Add the `bolt12_invoice` field to the `PaymentSuccessful` event,
enabling users to obtain proof of payment for BOLT12 transactions.
Problem:
After a successful BOLT12 payment, users had no way to access the
paid invoice data. This made it impossible to provide proof of
payment to third parties, who need both the payment preimage and
the original invoice to verify that sha256(preimage) matches the
invoice's payment_hash.
Solution:
Add `bolt12_invoice: Option<PaidBolt12Invoice>` to `PaymentSuccessful`.
With the UniFFI v0.29 upgrade now supporting objects in enum variants,
we can expose the proper `PaidBolt12Invoice` type across both native
Rust and FFI builds without cfg-gating the Event field.
For non-UniFFI builds, LDK's `PaidBolt12Invoice` is re-exported
directly. For UniFFI builds, a wrapper `PaidBolt12Invoice` enum is
defined in ffi/types.rs with `From` conversions and delegating
serialization. A minimal `StaticInvoice` FFI wrapper is also added
to support the `PaidBolt12Invoice::StaticInvoice` variant.
The FFI enum variants are named `Bolt12`/`Static` (rather than
`Bolt12Invoice`/`StaticInvoice`) to avoid Kotlin sealed class name
collisions where inner data classes would shadow top-level types.
TLV tag 7 is used for serialization, maintaining backward
compatibility: older readers silently skip the unknown odd tag,
and newer readers deserialize `None` from events without it.
Closes#757.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments