+ /**
+ * Returns the [`TaggedHash`] of the invoice to sign.
+ */
+ public tagged_hash(): TaggedHash {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_tagged_hash(this.ptr);
+ const ret_hu_conv: TaggedHash = new TaggedHash(null, ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
+ * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
+ * for the selected chain.
+ */
+ public chains(): Uint8Array[] {
+ const ret: number = bindings.UnsignedInvoiceRequest_chains(this.ptr);
+ const ret_conv_12_len: number = bindings.getArrayLength(ret);
+ const ret_conv_12_arr: Uint8Array[] = new Array(ret_conv_12_len).fill(null);
+ for (var m = 0; m < ret_conv_12_len; m++) {
+ const ret_conv_12: number = bindings.getU32ArrayElem(ret, m);
+ const ret_conv_12_conv: Uint8Array = bindings.decodeUint8Array(ret_conv_12);
+ ret_conv_12_arr[m] = ret_conv_12_conv;
+ }
+ bindings.freeWasmMemory(ret)
+ return ret_conv_12_arr;
+ }
+
+ /**
+ * Opaque bytes set by the originator. Useful for authentication and validating fields since it
+ * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
+ */
+ public metadata(): Option_CVec_u8ZZ {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_metadata(this.ptr);
+ const ret_hu_conv: Option_CVec_u8ZZ = Option_CVec_u8ZZ.constr_from_ptr(ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * The minimum amount required for a successful payment of a single item.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public amount(): Amount {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_amount(this.ptr);
+ const ret_hu_conv: Amount = new Amount(null, ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * A complete description of the purpose of the payment. Intended to be displayed to the user
+ * but with the caveat that it has not been verified in any way.
+ */
+ public description(): PrintableString {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_description(this.ptr);
+ const ret_hu_conv: PrintableString = new PrintableString(null, ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Features pertaining to the offer.
+ */
+ public offer_features(): OfferFeatures {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_offer_features(this.ptr);
+ const ret_hu_conv: OfferFeatures = new OfferFeatures(null, ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Duration since the Unix epoch when an invoice should no longer be requested.
+ *
+ * If `None`, the offer does not expire.
+ */
+ public absolute_expiry(): Option_u64Z {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_absolute_expiry(this.ptr);
+ const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
+ * displayed to the user but with the caveat that it has not been verified in any way.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public issuer(): PrintableString {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_issuer(this.ptr);
+ const ret_hu_conv: PrintableString = new PrintableString(null, ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
+ * recipient privacy by obfuscating its node id.
+ */
+ public paths(): BlindedPath[] {
+ const ret: number = bindings.UnsignedInvoiceRequest_paths(this.ptr);
+ const ret_conv_13_len: number = bindings.getArrayLength(ret);
+ const ret_conv_13_arr: BlindedPath[] = new Array(ret_conv_13_len).fill(null);
+ for (var n = 0; n < ret_conv_13_len; n++) {
+ const ret_conv_13: bigint = bindings.getU64ArrayElem(ret, n);
+ const ret_conv_13_hu_conv: BlindedPath = new BlindedPath(null, ret_conv_13);
+ CommonBase.add_ref_from(ret_conv_13_hu_conv, this);
+ ret_conv_13_arr[n] = ret_conv_13_hu_conv;
+ }
+ bindings.freeWasmMemory(ret)
+ return ret_conv_13_arr;
+ }
+
+ /**
+ * The quantity of items supported.
+ */
+ public supported_quantity(): Quantity {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_supported_quantity(this.ptr);
+ const ret_hu_conv: Quantity = new Quantity(null, ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * The public key used by the recipient to sign invoices.
+ */
+ public signing_pubkey(): Uint8Array {
+ const ret: number = bindings.UnsignedInvoiceRequest_signing_pubkey(this.ptr);
+ const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
+ return ret_conv;
+ }
+
+ /**
+ * An unpredictable series of bytes, typically containing information about the derivation of
+ * [`payer_id`].
+ *
+ * [`payer_id`]: Self::payer_id
+ */
+ public payer_metadata(): Uint8Array {
+ const ret: number = bindings.UnsignedInvoiceRequest_payer_metadata(this.ptr);
+ const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
+ return ret_conv;
+ }
+
+ /**
+ * A chain from [`Offer::chains`] that the offer is valid for.
+ */
+ public chain(): Uint8Array {
+ const ret: number = bindings.UnsignedInvoiceRequest_chain(this.ptr);
+ const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
+ return ret_conv;
+ }
+
+ /**
+ * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
+ * must be greater than or equal to [`Offer::amount`], converted if necessary.
+ *
+ * [`chain`]: Self::chain
+ */
+ public amount_msats(): Option_u64Z {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_amount_msats(this.ptr);
+ const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Features pertaining to requesting an invoice.
+ */
+ public invoice_request_features(): InvoiceRequestFeatures {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_invoice_request_features(this.ptr);
+ const ret_hu_conv: InvoiceRequestFeatures = new InvoiceRequestFeatures(null, ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
+ */
+ public quantity(): Option_u64Z {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_quantity(this.ptr);
+ const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * A possibly transient pubkey used to sign the invoice request.
+ */
+ public payer_id(): Uint8Array {
+ const ret: number = bindings.UnsignedInvoiceRequest_payer_id(this.ptr);
+ const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
+ return ret_conv;
+ }
+
+ /**
+ * A payer-provided note which will be seen by the recipient and reflected back in the invoice
+ * response.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public payer_note(): PrintableString {
+ const ret: bigint = bindings.UnsignedInvoiceRequest_payer_note(this.ptr);
+ const ret_hu_conv: PrintableString = new PrintableString(null, ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
+ */
+ public write(): Uint8Array {
+ const ret: number = bindings.UnsignedInvoiceRequest_write(this.ptr);
+ const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
+ return ret_conv;
+ }
+