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); }
23 internal long clone_ptr() {
24 long ret = bindings.UnsignedInvoiceRequest_clone_ptr(this.ptr);
30 * Creates a copy of the UnsignedInvoiceRequest
32 public UnsignedInvoiceRequest clone() {
33 long ret = bindings.UnsignedInvoiceRequest_clone(this.ptr);
35 if (ret >= 0 && ret <= 4096) { return null; }
36 org.ldk.structs.UnsignedInvoiceRequest ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedInvoiceRequest(null, ret); }
37 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
42 * Returns the [`TaggedHash`] of the invoice to sign.
44 public TaggedHash tagged_hash() {
45 long ret = bindings.UnsignedInvoiceRequest_tagged_hash(this.ptr);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 org.ldk.structs.TaggedHash ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TaggedHash(null, ret); }
49 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
54 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
55 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
56 * for the selected chain.
58 public byte[][] chains() {
59 long ret = bindings.UnsignedInvoiceRequest_chains(this.ptr);
61 if (ret >= 0 && ret <= 4096) { return null; }
62 int ret_conv_8_len = InternalUtils.getArrayLength(ret);
63 byte[][] ret_conv_8_arr = new byte[ret_conv_8_len][];
64 for (int i = 0; i < ret_conv_8_len; i++) {
65 long ret_conv_8 = InternalUtils.getU64ArrayElem(ret, i);
66 byte[] ret_conv_8_conv = InternalUtils.decodeUint8Array(ret_conv_8);
67 ret_conv_8_arr[i] = ret_conv_8_conv;
69 bindings.free_buffer(ret);
70 return ret_conv_8_arr;
74 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
75 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
77 public Option_CVec_u8ZZ metadata() {
78 long ret = bindings.UnsignedInvoiceRequest_metadata(this.ptr);
80 if (ret >= 0 && ret <= 4096) { return null; }
81 org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret);
82 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
87 * The minimum amount required for a successful payment of a single item.
89 public Option_AmountZ amount() {
90 long ret = bindings.UnsignedInvoiceRequest_amount(this.ptr);
92 if (ret >= 0 && ret <= 4096) { return null; }
93 org.ldk.structs.Option_AmountZ ret_hu_conv = org.ldk.structs.Option_AmountZ.constr_from_ptr(ret);
94 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
99 * A complete description of the purpose of the payment. Intended to be displayed to the user
100 * but with the caveat that it has not been verified in any way.
102 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
104 public PrintableString description() {
105 long ret = bindings.UnsignedInvoiceRequest_description(this.ptr);
107 if (ret >= 0 && ret <= 4096) { return null; }
108 org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); }
109 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
114 * Features pertaining to the offer.
116 public OfferFeatures offer_features() {
117 long ret = bindings.UnsignedInvoiceRequest_offer_features(this.ptr);
119 if (ret >= 0 && ret <= 4096) { return null; }
120 org.ldk.structs.OfferFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferFeatures(null, ret); }
121 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
126 * Duration since the Unix epoch when an invoice should no longer be requested.
128 * If `None`, the offer does not expire.
130 public Option_u64Z absolute_expiry() {
131 long ret = bindings.UnsignedInvoiceRequest_absolute_expiry(this.ptr);
133 if (ret >= 0 && ret <= 4096) { return null; }
134 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
135 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
140 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
141 * displayed to the user but with the caveat that it has not been verified in any way.
143 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
145 public PrintableString issuer() {
146 long ret = bindings.UnsignedInvoiceRequest_issuer(this.ptr);
148 if (ret >= 0 && ret <= 4096) { return null; }
149 org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); }
150 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
155 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
156 * recipient privacy by obfuscating its node id.
158 public BlindedPath[] paths() {
159 long ret = bindings.UnsignedInvoiceRequest_paths(this.ptr);
161 if (ret >= 0 && ret <= 4096) { return null; }
162 int ret_conv_13_len = InternalUtils.getArrayLength(ret);
163 BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len];
164 for (int n = 0; n < ret_conv_13_len; n++) {
165 long ret_conv_13 = InternalUtils.getU64ArrayElem(ret, n);
166 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); }
167 if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.AddLast(this); };
168 ret_conv_13_arr[n] = ret_conv_13_hu_conv;
170 bindings.free_buffer(ret);
171 return ret_conv_13_arr;
175 * The quantity of items supported.
177 public Quantity supported_quantity() {
178 long ret = bindings.UnsignedInvoiceRequest_supported_quantity(this.ptr);
180 if (ret >= 0 && ret <= 4096) { return null; }
181 org.ldk.structs.Quantity ret_hu_conv = org.ldk.structs.Quantity.constr_from_ptr(ret);
182 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
187 * The public key used by the recipient to sign invoices.
189 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
191 public byte[] signing_pubkey() {
192 long ret = bindings.UnsignedInvoiceRequest_signing_pubkey(this.ptr);
194 if (ret >= 0 && ret <= 4096) { return null; }
195 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
200 * An unpredictable series of bytes, typically containing information about the derivation of
203 * [`payer_id`]: Self::payer_id
205 public byte[] payer_metadata() {
206 long ret = bindings.UnsignedInvoiceRequest_payer_metadata(this.ptr);
208 if (ret >= 0 && ret <= 4096) { return null; }
209 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
214 * A chain from [`Offer::chains`] that the offer is valid for.
216 public byte[] chain() {
217 long ret = bindings.UnsignedInvoiceRequest_chain(this.ptr);
219 if (ret >= 0 && ret <= 4096) { return null; }
220 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
225 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
226 * must be greater than or equal to [`Offer::amount`], converted if necessary.
228 * [`chain`]: Self::chain
230 public Option_u64Z amount_msats() {
231 long ret = bindings.UnsignedInvoiceRequest_amount_msats(this.ptr);
233 if (ret >= 0 && ret <= 4096) { return null; }
234 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
235 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
240 * Features pertaining to requesting an invoice.
242 public InvoiceRequestFeatures invoice_request_features() {
243 long ret = bindings.UnsignedInvoiceRequest_invoice_request_features(this.ptr);
245 if (ret >= 0 && ret <= 4096) { return null; }
246 org.ldk.structs.InvoiceRequestFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFeatures(null, ret); }
247 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
252 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
254 public Option_u64Z quantity() {
255 long ret = bindings.UnsignedInvoiceRequest_quantity(this.ptr);
257 if (ret >= 0 && ret <= 4096) { return null; }
258 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
259 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
264 * A possibly transient pubkey used to sign the invoice request.
266 public byte[] payer_id() {
267 long ret = bindings.UnsignedInvoiceRequest_payer_id(this.ptr);
269 if (ret >= 0 && ret <= 4096) { return null; }
270 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
275 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
278 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
280 public PrintableString payer_note() {
281 long ret = bindings.UnsignedInvoiceRequest_payer_note(this.ptr);
283 if (ret >= 0 && ret <= 4096) { return null; }
284 org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); }
285 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
290 * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
292 public byte[] write() {
293 long ret = bindings.UnsignedInvoiceRequest_write(this.ptr);
295 if (ret >= 0 && ret <= 4096) { return null; }
296 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);