[−][src]Crate lightning_invoice
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:
- For parsing use
str::parse::<Invoice>(&self)
(see the docs ofimpl FromStr for Invoice
) - For constructing invoices use the
InvoiceBuilder
- For serializing invoices use the
Display
/ToString
traits
Modules
constants | Tag constants as specified in BOLT11 |
Structs
Description | Description string |
ExpiryTime | Positive duration that defines when (relatively to the timestamp) in the future the invoice expires |
Invoice | Represents a syntactically and semantically correct lightning BOLT11 invoice. |
InvoiceBuilder | Builder for |
MinFinalCltvExpiry |
|
PayeePubKey | Payee public key |
PositiveTimestamp | A timestamp that refers to a date after 1 January 1970 which means its representation as UNIX timestamp is positive. |
RawDataPart | Data of the |
RawHrp | Data of the |
RawInvoice | Represents an syntactically correct Invoice for a payment on the lightning network, but without the signature information. De- and encoding should not lead to information loss but may lead to different hashes. |
Route | Private routing information |
RouteHop | Node on a private route |
Sha256 | SHA-256 hash |
Signature | Recoverable signature |
SignedRawInvoice | Represents a signed |
Enums
CreationError | Errors that may occur when constructing a new |
Currency | Enum representing the crypto currencies (or networks) supported by this library |
Fallback | Fallback address in case no LN payment is possible |
InvoiceDescription | 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. |
ParseError | 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. |
ParseOrSemanticError | 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. |
RawTaggedField | Tagged field which may have an unknown tag |
SemanticError | Errors that may occur when converting a |
SiPrefix | SI prefixes for the human readable part |
SignOrCreationError | When signing using a fallible method either an user-supplied |
TaggedField | Tagged field with known tag |
Functions
check_platform | Call this function on startup to ensure that all assumptions about the platform are valid. |