Class InvoiceRequest


  • public class InvoiceRequest
    extends Object
    An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`]. An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request specifies these such that its recipient can send an invoice for payment. [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice [`Offer`]: crate::offers::offer::Offer
    • Method Detail

      • chains

        public byte[][] chains()
        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.
      • metadata

        public Option_CVec_u8ZZ metadata()
        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`.
      • amount

        @Nullable
        public Amount amount()
        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
      • description

        public PrintableString description()
        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.
      • offer_features

        public OfferFeatures offer_features()
        Features pertaining to the offer.
      • absolute_expiry

        public Option_u64Z absolute_expiry()
        Duration since the Unix epoch when an invoice should no longer be requested. If `None`, the offer does not expire.
      • issuer

        @Nullable
        public PrintableString issuer()
        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
      • paths

        public BlindedPath[] paths()
        Paths to the recipient originating from publicly reachable nodes. Blinded paths provide recipient privacy by obfuscating its node id.
      • supported_quantity

        public Quantity supported_quantity()
        The quantity of items supported.
      • signing_pubkey

        public byte[] signing_pubkey()
        The public key used by the recipient to sign invoices.
      • payer_metadata

        public byte[] payer_metadata()
        An unpredictable series of bytes, typically containing information about the derivation of [`payer_id`]. [`payer_id`]: Self::payer_id
      • chain

        public byte[] chain()
        A chain from [`Offer::chains`] that the offer is valid for.
      • amount_msats

        public Option_u64Z amount_msats()
        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
      • invoice_request_features

        public InvoiceRequestFeatures invoice_request_features()
        Features pertaining to requesting an invoice.
      • quantity

        public Option_u64Z quantity()
        The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
      • payer_id

        public byte[] payer_id()
        A possibly transient pubkey used to sign the invoice request.
      • payer_note

        @Nullable
        public PrintableString payer_note()
        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
      • signature

        public byte[] signature()
        Signature of the invoice request using [`payer_id`]. [`payer_id`]: Self::payer_id
      • verify

        public Result_VerifiedInvoiceRequestNoneZ verify​(ExpandedKey key)
        Verifies that the request was for an offer created using the given key. Returns the verified request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request if they could be extracted from the metadata. [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
      • write

        public byte[] write()
        Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read