Liking cljdoc? Tell your friends :D

dk.simongray.podcast.value.bolt11

The invoices of BOLT 11, as far as an app that pays needs to read them: the network and the amount, the payment hash, the expiry, and the proof of payment.

An invoice is the text that a Lightning address or a wallet gives, e.g. lnbc2500u1…, and a wallet pays it. None of these functions checks the signature, since the wallet does when it pays. BOLT 11 is at https://github.com/lightning/bolts/blob/master/11-payment-encoding.md

The invoices of BOLT 11, as far as an app that pays needs to read them:
the network and the amount, the payment hash, the expiry, and the proof
of payment.

An invoice is the text that a Lightning address or a wallet gives, e.g.
lnbc2500u1…, and a wallet pays it. None of these functions checks the
signature, since the wallet does when it pays. BOLT 11 is at
https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
raw docstring

expired?clj/s

(expired? invoice at)

Whether the BOLT 11 invoice has expired at the instant at, since a wallet refuses to pay it then. An invoice that doesn't read counts as expired.

Whether the BOLT 11 `invoice` has expired at the instant `at`, since a
wallet refuses to pay it then. An invoice that doesn't read counts as
expired.
sourceraw docstring

expires-atclj/s

(expires-at invoice)

The instant at which the BOLT 11 invoice expires, from its timestamp and its field x, or nil for a text that isn't an invoice that reads.

The instant at which the BOLT 11 `invoice` expires, from its timestamp
and its field x, or nil for a text that isn't an invoice that reads.
sourceraw docstring

invoice-amountclj/s

(invoice-amount invoice)

The network and the amount of the BOLT 11 invoice from the part before its data, as a map of :network and :msat, or nil for text that isn't an invoice. An invoice of any amount has no :msat.

The amount is in millisatoshis. It starts with no zero, and a pico amount must end in 0, as BOLT 11 requires. After the amount come a 1 and the data, which are six or more characters of Bech32.

The network and the amount of the BOLT 11 `invoice` from the part
before its data, as a map of :network and :msat, or nil for text that
isn't an invoice. An invoice of any amount has no :msat.

The amount is in millisatoshis. It starts with no zero, and a pico amount
must end in 0, as BOLT 11 requires. After the amount come a 1 and the
data, which are six or more characters of Bech32.
sourceraw docstring

payment-hashclj/s

(payment-hash invoice)

The payment hash of the BOLT 11 invoice, as hexadecimal text of 32 bytes, or nil for a text that isn't an invoice with one payment hash.

The hash is the tagged field p, with 52 numbers of five bits and zero bits to pad, as the section Tagged Fields of BOLT 11 defines it. The reader checks the checksum of the invoice.

The payment hash of the BOLT 11 `invoice`, as hexadecimal text of 32
bytes, or nil for a text that isn't an invoice with one payment hash.

The hash is the tagged field p, with 52 numbers of five bits and zero
bits to pad, as the section Tagged Fields of BOLT 11 defines it. The
reader checks the checksum of the invoice.
sourceraw docstring

proves?clj/s

(proves? preimage invoice)

Whether preimage is the proof that somebody paid the BOLT 11 invoice: its SHA-256 is the payment hash of the invoice.

A wallet gets the preimage from the recipient when the payment arrives, and no one can guess it. The preimage is hexadecimal text of 32 bytes. It's false for another text, and for an invoice without a payment hash that reads.

Whether `preimage` is the proof that somebody paid the BOLT 11
`invoice`: its SHA-256 is the payment hash of the invoice.

A wallet gets the preimage from the recipient when the payment arrives,
and no one can guess it. The `preimage` is hexadecimal text of 32
bytes. It's false for another text, and for an invoice without a
payment hash that reads.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close