+ /**
+ * Duration since the Unix epoch when an invoice should no longer be requested.
+ *
+ * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
+ *
+ * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
+ */
+ public Option_u64Z absolute_expiry() {
+ long ret = bindings.Bolt12Invoice_absolute_expiry(this.ptr);
+ GC.KeepAlive(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * The issuer of the offer or refund.
+ *
+ * From [`Offer::issuer`] or [`Refund::issuer`].
+ *
+ * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public PrintableString issuer() {
+ long ret = bindings.Bolt12Invoice_issuer(this.ptr);
+ GC.KeepAlive(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Paths to the recipient originating from publicly reachable nodes.
+ *
+ * From [`Offer::paths`] or [`Refund::paths`].
+ *
+ * [`Offer::paths`]: crate::offers::offer::Offer::paths
+ */
+ public BlindedPath[] message_paths() {
+ long ret = bindings.Bolt12Invoice_message_paths(this.ptr);
+ GC.KeepAlive(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ int ret_conv_13_len = InternalUtils.getArrayLength(ret);
+ BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len];
+ for (int n = 0; n < ret_conv_13_len; n++) {
+ long ret_conv_13 = InternalUtils.getU64ArrayElem(ret, n);
+ org.ldk.structs.BlindedPath ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.BlindedPath(null, ret_conv_13); }
+ if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.AddLast(this); };
+ ret_conv_13_arr[n] = ret_conv_13_hu_conv;
+ }
+ bindings.free_buffer(ret);
+ return ret_conv_13_arr;
+ }
+
+ /**
+ * The quantity of items supported.
+ *
+ * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
+ * [`Refund`].
+ *
+ * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public Quantity supported_quantity() {
+ long ret = bindings.Bolt12Invoice_supported_quantity(this.ptr);
+ GC.KeepAlive(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * An unpredictable series of bytes from the payer.
+ *
+ * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
+ */
+ public byte[] payer_metadata() {
+ long ret = bindings.Bolt12Invoice_payer_metadata(this.ptr);
+ GC.KeepAlive(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+ return ret_conv;
+ }
+
+ /**
+ * Features pertaining to requesting an invoice.
+ *
+ * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
+ */
+ public InvoiceRequestFeatures invoice_request_features() {
+ long ret = bindings.Bolt12Invoice_invoice_request_features(this.ptr);
+ GC.KeepAlive(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.InvoiceRequestFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFeatures(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * The quantity of items requested or refunded for.
+ *
+ * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
+ */
+ public Option_u64Z quantity() {
+ long ret = bindings.Bolt12Invoice_quantity(this.ptr);
+ GC.KeepAlive(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
+ * refund in case there are no [`message_paths`].
+ *
+ * [`message_paths`]: Self::message_paths
+ */
+ public byte[] payer_id() {
+ long ret = bindings.Bolt12Invoice_payer_id(this.ptr);
+ GC.KeepAlive(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+ return ret_conv;
+ }
+
+ /**
+ * A payer-provided note reflected back in the invoice.
+ *
+ * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public PrintableString payer_note() {
+ long ret = bindings.Bolt12Invoice_payer_note(this.ptr);
+ GC.KeepAlive(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+ return ret_hu_conv;
+ }
+