+ private Bolt11InvoicePayment(long ptr, bindings.LDKPaymentPurpose.Bolt11InvoicePayment obj) {
+ super(null, ptr);
+ long payment_preimage = obj.payment_preimage;
+ org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_preimage);
+ if (payment_preimage_hu_conv != null) { payment_preimage_hu_conv.ptrs_to.add(this); };
+ this.payment_preimage = payment_preimage_hu_conv;
+ this.payment_secret = obj.payment_secret;
+ }
+ }
+ /**
+ * A payment for a BOLT 12 [`Offer`].
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ */
+ public final static class Bolt12OfferPayment extends PaymentPurpose {
+ /**
+ * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
+ * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
+ * when seen in [`Event::PaymentClaimed`].
+ *
+ * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+ */
+ public final org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage;
+ /**
+ * The secret used to authenticate the sender to the recipient, preventing a number of
+ * de-anonymization attacks while routing a payment.
+ *
+ * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
+ */
+ public final byte[] payment_secret;
+ /**
+ * The context of the payment such as information about the corresponding [`Offer`] and
+ * [`InvoiceRequest`].
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ */
+ public final org.ldk.structs.Bolt12OfferContext payment_context;
+ private Bolt12OfferPayment(long ptr, bindings.LDKPaymentPurpose.Bolt12OfferPayment obj) {
+ super(null, ptr);
+ long payment_preimage = obj.payment_preimage;
+ org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_preimage);
+ if (payment_preimage_hu_conv != null) { payment_preimage_hu_conv.ptrs_to.add(this); };
+ this.payment_preimage = payment_preimage_hu_conv;
+ this.payment_secret = obj.payment_secret;
+ long payment_context = obj.payment_context;
+ org.ldk.structs.Bolt12OfferContext payment_context_hu_conv = null; if (payment_context < 0 || payment_context > 4096) { payment_context_hu_conv = new org.ldk.structs.Bolt12OfferContext(null, payment_context); }
+ if (payment_context_hu_conv != null) { payment_context_hu_conv.ptrs_to.add(this); };
+ this.payment_context = payment_context_hu_conv;
+ }
+ }
+ /**
+ * A payment for a BOLT 12 [`Refund`].
+ *
+ * [`Refund`]: crate::offers::refund::Refund
+ */
+ public final static class Bolt12RefundPayment extends PaymentPurpose {
+ /**
+ * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
+ * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
+ * when seen in [`Event::PaymentClaimed`].
+ *
+ * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+ */
+ public final org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage;
+ /**
+ * The secret used to authenticate the sender to the recipient, preventing a number of
+ * de-anonymization attacks while routing a payment.
+ *
+ * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
+ */
+ public final byte[] payment_secret;
+ /**
+ * The context of the payment such as information about the corresponding [`Refund`].
+ *
+ * [`Refund`]: crate::offers::refund::Refund
+ */
+ public final org.ldk.structs.Bolt12RefundContext payment_context;
+ private Bolt12RefundPayment(long ptr, bindings.LDKPaymentPurpose.Bolt12RefundPayment obj) {