Crate lightning_invoice

source ·
Expand description

This crate provides data structures to represent lightning BOLT11 invoices and functions to create, encode and decode these. If you just want to use the standard en-/decoding functionality this should get you started:

Re-exports§

Modules§

  • Tag constants as specified in BOLT11

Structs§

Enums§

  • Represents the description of an invoice which has to be either a directly included string or a hash of a description provided out of band.
  • Errors that indicate what is wrong with the invoice. They have some granularity for debug reasons, but should generally result in an “invalid BOLT11 invoice” message for the user.
  • Errors that may occur when converting a RawBolt11Invoice to a Bolt11Invoice. They relate to the requirements sections in BOLT #11
  • Errors that may occur when constructing a new RawBolt11Invoice or Bolt11Invoice
  • Enum representing the crypto currencies (or networks) supported by this library
  • Fallback address in case no LN payment is possible
  • Indicates that something went wrong while parsing or validating the invoice. Parsing errors should be mostly seen as opaque and are only there for debugging reasons. Semantic errors like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
  • Tagged field which may have an unknown tag
  • SI prefixes for the human readable part
  • When signing using a fallible method either an user-supplied SignError or a CreationError may occur.
  • Tagged field with known tag

Constants§