+ long via_channel_id = obj.via_channel_id;
+ org.ldk.structs.Option_ThirtyTwoBytesZ via_channel_id_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(via_channel_id);
+ if (via_channel_id_hu_conv != null) { via_channel_id_hu_conv.ptrs_to.add(this); };
+ this.via_channel_id = via_channel_id_hu_conv;
+ long via_user_channel_id = obj.via_user_channel_id;
+ org.ldk.structs.Option_U128Z via_user_channel_id_hu_conv = org.ldk.structs.Option_U128Z.constr_from_ptr(via_user_channel_id);
+ if (via_user_channel_id_hu_conv != null) { via_user_channel_id_hu_conv.ptrs_to.add(this); };
+ this.via_user_channel_id = via_user_channel_id_hu_conv;
+ long claim_deadline = obj.claim_deadline;
+ org.ldk.structs.Option_u32Z claim_deadline_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(claim_deadline);
+ if (claim_deadline_hu_conv != null) { claim_deadline_hu_conv.ptrs_to.add(this); };
+ this.claim_deadline = claim_deadline_hu_conv;
+ }
+ }
+ /**
+ * Indicates a payment has been claimed and we've received money!
+ *
+ * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
+ * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
+ * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
+ * [`Event::PaymentClaimable`] event.
+ *
+ * # Note
+ * LDK will not stop an inbound payment from being paid multiple times, so multiple
+ * `PaymentClaimable` events may be generated for the same payment. If you then call
+ * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
+ * multiple `PaymentClaimed` events.
+ *
+ * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+ */
+ public final static class PaymentClaimed extends Event {
+ /**
+ * The node that received the payment.
+ * This is useful to identify payments which were received via [phantom nodes].
+ * This field will always be filled in when the event was generated by LDK versions
+ * 0.0.113 and above.
+ *
+ * [phantom nodes]: crate::sign::PhantomKeysManager
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ @Nullable public final byte[] receiver_node_id;
+ /**
+ * The payment hash of the claimed payment. Note that LDK will not stop you from
+ * registering duplicate payment hashes for inbound payments.
+ */
+ public final byte[] payment_hash;
+ /**
+ * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
+ * invoice amount.
+ */
+ public final long amount_msat;
+ /**
+ * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
+ * spontaneous payment.
+ */
+ public final org.ldk.structs.PaymentPurpose purpose;
+ /**
+ * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
+ * to LDK version 0.0.117.
+ */
+ public final ClaimedHTLC[] htlcs;
+ /**
+ * The sender-intended sum total of all the MPP parts. This will be `None` for events
+ * serialized prior to LDK version 0.0.117.
+ */
+ public final org.ldk.structs.Option_u64Z sender_intended_total_msat;
+ private PaymentClaimed(long ptr, bindings.LDKEvent.PaymentClaimed obj) {
+ super(null, ptr);
+ this.receiver_node_id = obj.receiver_node_id;
+ this.payment_hash = obj.payment_hash;
+ this.amount_msat = obj.amount_msat;
+ long purpose = obj.purpose;
+ org.ldk.structs.PaymentPurpose purpose_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(purpose);
+ if (purpose_hu_conv != null) { purpose_hu_conv.ptrs_to.add(this); };
+ this.purpose = purpose_hu_conv;
+ long[] htlcs = obj.htlcs;
+ int htlcs_conv_13_len = htlcs.length;
+ ClaimedHTLC[] htlcs_conv_13_arr = new ClaimedHTLC[htlcs_conv_13_len];
+ for (int n = 0; n < htlcs_conv_13_len; n++) {
+ long htlcs_conv_13 = htlcs[n];
+ org.ldk.structs.ClaimedHTLC htlcs_conv_13_hu_conv = null; if (htlcs_conv_13 < 0 || htlcs_conv_13 > 4096) { htlcs_conv_13_hu_conv = new org.ldk.structs.ClaimedHTLC(null, htlcs_conv_13); }
+ if (htlcs_conv_13_hu_conv != null) { htlcs_conv_13_hu_conv.ptrs_to.add(this); };
+ htlcs_conv_13_arr[n] = htlcs_conv_13_hu_conv;
+ }
+ this.htlcs = htlcs_conv_13_arr;
+ long sender_intended_total_msat = obj.sender_intended_total_msat;
+ org.ldk.structs.Option_u64Z sender_intended_total_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(sender_intended_total_msat);
+ if (sender_intended_total_msat_hu_conv != null) { sender_intended_total_msat_hu_conv.ptrs_to.add(this); };
+ this.sender_intended_total_msat = sender_intended_total_msat_hu_conv;
+ }
+ }
+ /**
+ * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
+ * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
+ * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
+ *
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`Refund`]: crate::offers::refund::Refund
+ */
+ public final static class InvoiceRequestFailed extends Event {
+ /**
+ * The `payment_id` to have been associated with payment for the requested invoice.
+ */
+ public final byte[] payment_id;
+ private InvoiceRequestFailed(long ptr, bindings.LDKEvent.InvoiceRequestFailed obj) {
+ super(null, ptr);
+ this.payment_id = obj.payment_id;