+ * Returns the [`TaggedHash`] of the invoice to sign.
+ */
+ public tagged_hash(): TaggedHash {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_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.
+ *
+ * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
+ *
+ * [`Offer::chains`]: crate::offers::offer::Offer::chains
+ */
+ public offer_chains(): Option_CVec_ThirtyTwoBytesZZ {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_offer_chains(this.ptr);
+ const ret_hu_conv: Option_CVec_ThirtyTwoBytesZZ = Option_CVec_ThirtyTwoBytesZZ.constr_from_ptr(ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
+ * invoice originated from an offer.
+ *
+ * From [`InvoiceRequest::chain`] or [`Refund::chain`].
+ *
+ * [`offer_chains`]: Self::offer_chains
+ * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
+ */
+ public chain(): Uint8Array {
+ const ret: number = bindings.UnsignedBolt12Invoice_chain(this.ptr);
+ const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
+ return ret_conv;
+ }
+
+ /**
+ * Opaque bytes set by the originating [`Offer`].
+ *
+ * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
+ * if the [`Offer`] did not set it.
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
+ */
+ public metadata(): Option_CVec_u8ZZ {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_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.
+ *
+ * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
+ * the [`Offer`] did not set it.
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`Offer::amount`]: crate::offers::offer::Offer::amount
+ *
+ * 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.UnsignedBolt12Invoice_amount(this.ptr);
+ const ret_hu_conv: Amount = new Amount(null, ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Features pertaining to the originating [`Offer`].
+ *
+ * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
+ * [`Refund`].
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public offer_features(): OfferFeatures {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_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;
+ }
+
+ /**
+ * A complete description of the purpose of the originating offer or refund.
+ *
+ * From [`Offer::description`] or [`Refund::description`].
+ *
+ * [`Offer::description`]: crate::offers::offer::Offer::description
+ */
+ public description(): PrintableString {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_description(this.ptr);
+ const ret_hu_conv: PrintableString = new PrintableString(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.
+ *
+ * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
+ *
+ * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
+ */
+ public absolute_expiry(): Option_u64Z {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_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 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 issuer(): PrintableString {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_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.
+ *
+ * From [`Offer::paths`] or [`Refund::paths`].
+ *
+ * [`Offer::paths`]: crate::offers::offer::Offer::paths
+ */
+ public message_paths(): BlindedPath[] {
+ const ret: number = bindings.UnsignedBolt12Invoice_message_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.
+ *
+ * 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 supported_quantity(): Quantity {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_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;
+ }
+
+ /**
+ * An unpredictable series of bytes from the payer.
+ *
+ * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
+ */
+ public payer_metadata(): Uint8Array {
+ const ret: number = bindings.UnsignedBolt12Invoice_payer_metadata(this.ptr);
+ const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
+ return ret_conv;
+ }
+
+ /**
+ * Features pertaining to requesting an invoice.
+ *
+ * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
+ */
+ public invoice_request_features(): InvoiceRequestFeatures {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_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 items requested or refunded for.
+ *
+ * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
+ */
+ public quantity(): Option_u64Z {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_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 or to send an invoice for a
+ * refund in case there are no [`message_paths`].
+ *
+ * [`message_paths`]: Self::message_paths
+ */
+ public payer_id(): Uint8Array {
+ const ret: number = bindings.UnsignedBolt12Invoice_payer_id(this.ptr);
+ const ret_conv: Uint8Array = bindings.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 payer_note(): PrintableString {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_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;
+ }
+
+ /**
+ * Duration since the Unix epoch when the invoice was created.
+ */
+ public created_at(): bigint {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_created_at(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
+ * should no longer be paid.
+ */
+ public relative_expiry(): bigint {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_relative_expiry(this.ptr);
+ return ret;
+ }
+
+ /**
+ * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
+ */
+ public payment_hash(): Uint8Array {
+ const ret: number = bindings.UnsignedBolt12Invoice_payment_hash(this.ptr);
+ const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
+ return ret_conv;
+ }
+
+ /**
+ * The minimum amount required for a successful payment of the invoice.
+ */
+ public amount_msats(): bigint {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_amount_msats(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Features pertaining to paying an invoice.
+ */
+ public invoice_features(): Bolt12InvoiceFeatures {
+ const ret: bigint = bindings.UnsignedBolt12Invoice_invoice_features(this.ptr);
+ const ret_hu_conv: Bolt12InvoiceFeatures = new Bolt12InvoiceFeatures(null, ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * The public key corresponding to the key used to sign the invoice.