6 namespace org { namespace ldk { namespace structs {
10 * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
11 * ways to respond depending on whether the signing keys were derived.
13 public class VerifiedInvoiceRequest : CommonBase {
14 internal VerifiedInvoiceRequest(object _dummy, long ptr) : base(ptr) { }
15 ~VerifiedInvoiceRequest() {
16 if (ptr != 0) { bindings.VerifiedInvoiceRequest_free(ptr); }
20 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
22 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
25 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
26 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
27 * [`respond_with`]: Self::respond_with
29 public Option_SecretKeyZ get_keys() {
30 long ret = bindings.VerifiedInvoiceRequest_get_keys(this.ptr);
32 if (ret >= 0 && ret <= 4096) { return null; }
33 org.ldk.structs.Option_SecretKeyZ ret_hu_conv = org.ldk.structs.Option_SecretKeyZ.constr_from_ptr(ret);
34 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
39 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
41 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
44 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
45 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
46 * [`respond_with`]: Self::respond_with
48 public void set_keys(org.ldk.structs.Option_SecretKeyZ val) {
49 bindings.VerifiedInvoiceRequest_set_keys(this.ptr, val.ptr);
52 if (this != null) { this.ptrs_to.AddLast(val); };
55 internal long clone_ptr() {
56 long ret = bindings.VerifiedInvoiceRequest_clone_ptr(this.ptr);
62 * Creates a copy of the VerifiedInvoiceRequest
64 public VerifiedInvoiceRequest clone() {
65 long ret = bindings.VerifiedInvoiceRequest_clone(this.ptr);
67 if (ret >= 0 && ret <= 4096) { return null; }
68 org.ldk.structs.VerifiedInvoiceRequest ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.VerifiedInvoiceRequest(null, ret); }
69 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
74 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
75 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
76 * for the selected chain.
78 public byte[][] chains() {
79 long ret = bindings.VerifiedInvoiceRequest_chains(this.ptr);
81 if (ret >= 0 && ret <= 4096) { return null; }
82 int ret_conv_8_len = InternalUtils.getArrayLength(ret);
83 byte[][] ret_conv_8_arr = new byte[ret_conv_8_len][];
84 for (int i = 0; i < ret_conv_8_len; i++) {
85 long ret_conv_8 = InternalUtils.getU64ArrayElem(ret, i);
86 byte[] ret_conv_8_conv = InternalUtils.decodeUint8Array(ret_conv_8);
87 ret_conv_8_arr[i] = ret_conv_8_conv;
89 bindings.free_buffer(ret);
90 return ret_conv_8_arr;
94 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
95 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
97 public Option_CVec_u8ZZ metadata() {
98 long ret = bindings.VerifiedInvoiceRequest_metadata(this.ptr);
100 if (ret >= 0 && ret <= 4096) { return null; }
101 org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret);
102 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
107 * The minimum amount required for a successful payment of a single item.
109 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
111 public Amount amount() {
112 long ret = bindings.VerifiedInvoiceRequest_amount(this.ptr);
114 if (ret >= 0 && ret <= 4096) { return null; }
115 org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); }
116 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
121 * A complete description of the purpose of the payment. Intended to be displayed to the user
122 * but with the caveat that it has not been verified in any way.
124 public PrintableString description() {
125 long ret = bindings.VerifiedInvoiceRequest_description(this.ptr);
127 if (ret >= 0 && ret <= 4096) { return null; }
128 org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); }
129 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
134 * Features pertaining to the offer.
136 public OfferFeatures offer_features() {
137 long ret = bindings.VerifiedInvoiceRequest_offer_features(this.ptr);
139 if (ret >= 0 && ret <= 4096) { return null; }
140 org.ldk.structs.OfferFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferFeatures(null, ret); }
141 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
146 * Duration since the Unix epoch when an invoice should no longer be requested.
148 * If `None`, the offer does not expire.
150 public Option_u64Z absolute_expiry() {
151 long ret = bindings.VerifiedInvoiceRequest_absolute_expiry(this.ptr);
153 if (ret >= 0 && ret <= 4096) { return null; }
154 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
155 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
160 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
161 * displayed to the user but with the caveat that it has not been verified in any way.
163 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
165 public PrintableString issuer() {
166 long ret = bindings.VerifiedInvoiceRequest_issuer(this.ptr);
168 if (ret >= 0 && ret <= 4096) { return null; }
169 org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); }
170 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
175 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
176 * recipient privacy by obfuscating its node id.
178 public BlindedPath[] paths() {
179 long ret = bindings.VerifiedInvoiceRequest_paths(this.ptr);
181 if (ret >= 0 && ret <= 4096) { return null; }
182 int ret_conv_13_len = InternalUtils.getArrayLength(ret);
183 BlindedPath[] ret_conv_13_arr = new BlindedPath[ret_conv_13_len];
184 for (int n = 0; n < ret_conv_13_len; n++) {
185 long ret_conv_13 = InternalUtils.getU64ArrayElem(ret, n);
186 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); }
187 if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.AddLast(this); };
188 ret_conv_13_arr[n] = ret_conv_13_hu_conv;
190 bindings.free_buffer(ret);
191 return ret_conv_13_arr;
195 * The quantity of items supported.
197 public Quantity supported_quantity() {
198 long ret = bindings.VerifiedInvoiceRequest_supported_quantity(this.ptr);
200 if (ret >= 0 && ret <= 4096) { return null; }
201 org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); }
202 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
207 * The public key used by the recipient to sign invoices.
209 public byte[] signing_pubkey() {
210 long ret = bindings.VerifiedInvoiceRequest_signing_pubkey(this.ptr);
212 if (ret >= 0 && ret <= 4096) { return null; }
213 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
218 * An unpredictable series of bytes, typically containing information about the derivation of
221 * [`payer_id`]: Self::payer_id
223 public byte[] payer_metadata() {
224 long ret = bindings.VerifiedInvoiceRequest_payer_metadata(this.ptr);
226 if (ret >= 0 && ret <= 4096) { return null; }
227 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
232 * A chain from [`Offer::chains`] that the offer is valid for.
234 public byte[] chain() {
235 long ret = bindings.VerifiedInvoiceRequest_chain(this.ptr);
237 if (ret >= 0 && ret <= 4096) { return null; }
238 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
243 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
244 * must be greater than or equal to [`Offer::amount`], converted if necessary.
246 * [`chain`]: Self::chain
248 public Option_u64Z amount_msats() {
249 long ret = bindings.VerifiedInvoiceRequest_amount_msats(this.ptr);
251 if (ret >= 0 && ret <= 4096) { return null; }
252 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
253 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
258 * Features pertaining to requesting an invoice.
260 public InvoiceRequestFeatures invoice_request_features() {
261 long ret = bindings.VerifiedInvoiceRequest_invoice_request_features(this.ptr);
263 if (ret >= 0 && ret <= 4096) { return null; }
264 org.ldk.structs.InvoiceRequestFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFeatures(null, ret); }
265 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
270 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
272 public Option_u64Z quantity() {
273 long ret = bindings.VerifiedInvoiceRequest_quantity(this.ptr);
275 if (ret >= 0 && ret <= 4096) { return null; }
276 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
277 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
282 * A possibly transient pubkey used to sign the invoice request.
284 public byte[] payer_id() {
285 long ret = bindings.VerifiedInvoiceRequest_payer_id(this.ptr);
287 if (ret >= 0 && ret <= 4096) { return null; }
288 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
293 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
296 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
298 public PrintableString payer_note() {
299 long ret = bindings.VerifiedInvoiceRequest_payer_note(this.ptr);
301 if (ret >= 0 && ret <= 4096) { return null; }
302 org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); }
303 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };