6 namespace org { namespace ldk { namespace structs {
10 * A semantically valid [`InvoiceRequest`] that hasn't been signed.
14 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
15 * such, it may include unknown, odd TLV records.
17 public class UnsignedInvoiceRequest : CommonBase {
18 internal UnsignedInvoiceRequest(object _dummy, long ptr) : base(ptr) { }
19 ~UnsignedInvoiceRequest() {
20 if (ptr != 0) { bindings.UnsignedInvoiceRequest_free(ptr); }
24 * Returns the [`TaggedHash`] of the invoice to sign.
26 public TaggedHash tagged_hash() {
27 long ret = bindings.UnsignedInvoiceRequest_tagged_hash(this.ptr);
29 if (ret >= 0 && ret <= 4096) { return null; }
30 org.ldk.structs.TaggedHash ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TaggedHash(null, ret); }
31 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
36 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
37 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
38 * for the selected chain.
40 public byte[][] chains() {
41 long ret = bindings.UnsignedInvoiceRequest_chains(this.ptr);
43 if (ret >= 0 && ret <= 4096) { return null; }
44 int ret_conv_8_len = InternalUtils.getArrayLength(ret);
45 byte[][] ret_conv_8_arr = new byte[ret_conv_8_len][];
46 for (int i = 0; i < ret_conv_8_len; i++) {
47 long ret_conv_8 = InternalUtils.getU64ArrayElem(ret, i);
48 byte[] ret_conv_8_conv = InternalUtils.decodeUint8Array(ret_conv_8);
49 ret_conv_8_arr[i] = ret_conv_8_conv;
51 bindings.free_buffer(ret);
52 return ret_conv_8_arr;
56 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
57 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
59 public Option_CVec_u8ZZ metadata() {
60 long ret = bindings.UnsignedInvoiceRequest_metadata(this.ptr);
62 if (ret >= 0 && ret <= 4096) { return null; }
63 org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret);
64 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
69 * The minimum amount required for a successful payment of a single item.
71 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
73 public Amount amount() {
74 long ret = bindings.UnsignedInvoiceRequest_amount(this.ptr);
76 if (ret >= 0 && ret <= 4096) { return null; }
77 org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); }
78 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
83 * A complete description of the purpose of the payment. Intended to be displayed to the user
84 * but with the caveat that it has not been verified in any way.
86 public PrintableString description() {
87 long ret = bindings.UnsignedInvoiceRequest_description(this.ptr);
89 if (ret >= 0 && ret <= 4096) { return null; }
90 org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); }
91 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
96 * Features pertaining to the offer.
98 public OfferFeatures offer_features() {
99 long ret = bindings.UnsignedInvoiceRequest_offer_features(this.ptr);
101 if (ret >= 0 && ret <= 4096) { return null; }
102 org.ldk.structs.OfferFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferFeatures(null, ret); }
103 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
108 * Duration since the Unix epoch when an invoice should no longer be requested.
110 * If `None`, the offer does not expire.
112 public Option_u64Z absolute_expiry() {
113 long ret = bindings.UnsignedInvoiceRequest_absolute_expiry(this.ptr);
115 if (ret >= 0 && ret <= 4096) { return null; }
116 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
117 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
122 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
123 * displayed to the user but with the caveat that it has not been verified in any way.
125 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
127 public PrintableString issuer() {
128 long ret = bindings.UnsignedInvoiceRequest_issuer(this.ptr);
130 if (ret >= 0 && ret <= 4096) { return null; }
131 org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); }
132 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
137 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
138 * recipient privacy by obfuscating its node id.
140 public BlindedPath[] paths() {
141 long ret = bindings.UnsignedInvoiceRequest_paths(this.ptr);
143 if (ret >= 0 && ret <= 4096) { return null; }
144 int ret_conv_13_len = InternalUtils.getArrayLength(ret);
145 BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len];
146 for (int n = 0; n < ret_conv_13_len; n++) {
147 long ret_conv_13 = InternalUtils.getU64ArrayElem(ret, n);
148 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); }
149 if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.AddLast(this); };
150 ret_conv_13_arr[n] = ret_conv_13_hu_conv;
152 bindings.free_buffer(ret);
153 return ret_conv_13_arr;
157 * The quantity of items supported.
159 public Quantity supported_quantity() {
160 long ret = bindings.UnsignedInvoiceRequest_supported_quantity(this.ptr);
162 if (ret >= 0 && ret <= 4096) { return null; }
163 org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); }
164 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
169 * The public key used by the recipient to sign invoices.
171 public byte[] signing_pubkey() {
172 long ret = bindings.UnsignedInvoiceRequest_signing_pubkey(this.ptr);
174 if (ret >= 0 && ret <= 4096) { return null; }
175 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
180 * An unpredictable series of bytes, typically containing information about the derivation of
183 * [`payer_id`]: Self::payer_id
185 public byte[] payer_metadata() {
186 long ret = bindings.UnsignedInvoiceRequest_payer_metadata(this.ptr);
188 if (ret >= 0 && ret <= 4096) { return null; }
189 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
194 * A chain from [`Offer::chains`] that the offer is valid for.
196 public byte[] chain() {
197 long ret = bindings.UnsignedInvoiceRequest_chain(this.ptr);
199 if (ret >= 0 && ret <= 4096) { return null; }
200 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
205 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
206 * must be greater than or equal to [`Offer::amount`], converted if necessary.
208 * [`chain`]: Self::chain
210 public Option_u64Z amount_msats() {
211 long ret = bindings.UnsignedInvoiceRequest_amount_msats(this.ptr);
213 if (ret >= 0 && ret <= 4096) { return null; }
214 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
215 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
220 * Features pertaining to requesting an invoice.
222 public InvoiceRequestFeatures invoice_request_features() {
223 long ret = bindings.UnsignedInvoiceRequest_invoice_request_features(this.ptr);
225 if (ret >= 0 && ret <= 4096) { return null; }
226 org.ldk.structs.InvoiceRequestFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFeatures(null, ret); }
227 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
232 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
234 public Option_u64Z quantity() {
235 long ret = bindings.UnsignedInvoiceRequest_quantity(this.ptr);
237 if (ret >= 0 && ret <= 4096) { return null; }
238 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
239 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
244 * A possibly transient pubkey used to sign the invoice request.
246 public byte[] payer_id() {
247 long ret = bindings.UnsignedInvoiceRequest_payer_id(this.ptr);
249 if (ret >= 0 && ret <= 4096) { return null; }
250 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
255 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
258 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
260 public PrintableString payer_note() {
261 long ret = bindings.UnsignedInvoiceRequest_payer_note(this.ptr);
263 if (ret >= 0 && ret <= 4096) { return null; }
264 org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); }
265 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
270 * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
272 public byte[] write() {
273 long ret = bindings.UnsignedInvoiceRequest_write(this.ptr);
275 if (ret >= 0 && ret <= 4096) { return null; }
276 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);