The RSS Payment Metadata of the podcast namespace: what a payment to a Lightning address is for. The comment of the payment tells it, and a URL that the comment names.
A payment to a Lightning address carries only a short comment, which has the action, a URL and the start of the message:
rss::payment::boost https://… Great episode!
The URL answers with the header x-rss-payment, which holds the whole payment as JSON. A payment is the map of dk.simongray.podcast.value.
The sender writes the metadata, and the page at the URL is public. So the metadata is a claim, not what the node received.
The RSS Payment Metadata of the podcast namespace: what a payment to a
Lightning address is for. The comment of the payment tells it, and a URL
that the comment names.
A payment to a Lightning address carries only a short comment, which
has the action, a URL and the start of the message:
rss::payment::boost https://… Great episode!
The URL answers with the header x-rss-payment, which holds the whole
payment as JSON. A payment is the map of dk.simongray.podcast.value.
The sender writes the metadata, and the page at the URL is public. So
the metadata is a claim, not what the node received.The limits of a fetch of metadata that its options don't set: the seconds that the request can take, and the size of an answer in bytes. The header holds the metadata, so the answer needs no body.
The limits of a fetch of metadata that its options don't set: the seconds that the request can take, and the size of an answer in bytes. The header holds the metadata, so the answer needs no body.
(fetch! url)(fetch! url opts)Fetch the metadata at url with opts, and read the header
x-rss-payment of the answer. On the JVM it gives the payment, and in
ClojureScript a promise of it.
Take url from the comment of the payment. When the metadata doesn't
come, the result has a diagnostic under :error. The opts are these:
The sender of the payment chooses the URL. So the request carries a guard as its :allow-pred, which lets nothing go to a private network. To reach your own network, give (constantly true) as :allow-pred. A browser reads the header only when the server exposes it with CORS.
Fetch the metadata at `url` with `opts`, and read the header x-rss-payment of the answer. On the JVM it gives the payment, and in ClojureScript a promise of it. Take `url` from the comment of the payment. When the metadata doesn't come, the result has a diagnostic under :error. The `opts` are these: - the limits of default-limits - :allow-pred, which URLs the request can go to - :send, a function that sends a request map in place of client/send! The sender of the payment chooses the URL. So the request carries a guard as its :allow-pred, which lets nothing go to a private network. To reach your own network, give (constantly true) as :allow-pred. A browser reads the header only when the server exposes it with CORS.
(format-comment payment url)(format-comment {:keys [action message] :as payment} url max-length)The comment of a payment to a Lightning address that names the metadata
of payment at url, at most max-length characters long, as
JavaScript counts them.
The comment has the form that the docstring of this namespace shows.
Give the :comment-length of the terms of the address as max-length.
The message of the payment is cut to fit, and it ends in an ellipsis
when it's cut. The comment is nil when url isn't an http or https
URL, or when the comment doesn't fit without the message.
The comment of a payment to a Lightning address that names the metadata of `payment` at `url`, at most `max-length` characters long, as JavaScript counts them. The comment has the form that the docstring of this namespace shows. Give the :comment-length of the terms of the address as `max-length`. The message of the payment is cut to fit, and it ends in an ellipsis when it's cut. The comment is nil when `url` isn't an http or https URL, or when the comment doesn't fit without the message.
(format-header payment)The value of the header x-rss-payment for payment: its record as
JSON, URI-encoded as encodeURIComponent does.
The value of the header x-rss-payment for `payment`: its record as JSON, URI-encoded as encodeURIComponent does.
(parse-comment s)What the comment s of a payment tells about its metadata, as a map of
:action, :url and :message, or nil when s doesn't start with prefix.
The message is the start of the message of the payment, and the metadata at the URL holds all of it. Fountain wrote the text undefined in place of no message, so that text counts as none.
What the comment `s` of a payment tells about its metadata, as a map of :action, :url and :message, or nil when `s` doesn't start with prefix. The message is the start of the message of the payment, and the metadata at the URL holds all of it. Fountain wrote the text undefined in place of no message, so that text counts as none.
(parse-header s)The payment that the value s of the header x-rss-payment describes:
JSON, URI-encoded, or as it is.
The fields of the metadata become the keys of a payment, and the other fields keep their names. The report tells what the reader forgave. A header that holds no JSON object reads as no payment.
The payment that the value `s` of the header x-rss-payment describes: JSON, URI-encoded, or as it is. The fields of the metadata become the keys of a payment, and the other fields keep their names. The report tells what the reader forgave. A header that holds no JSON object reads as no payment.
The start of the comment of a payment that names its metadata.
The start of the comment of a payment that names its metadata.
(record {:keys [action] :as payment})The metadata of payment as a map with the string keys of the JSON, to
write as JSON.
The keys of the payment become these:
Give the :timestamp of the payment, which the metadata holds.
The metadata of `payment` as a map with the string keys of the JSON, to write as JSON. The keys of the payment become these: - :action becomes action, boost when it's absent - :msat and :total-msat become value_msat and value_msat_total, and :sats and :total-sats count in sats in their place - :usd becomes value_usd - an instant becomes ISO 8601 text, and any other key its snake_case Give the :timestamp of the payment, which the metadata holds.
(request url)The request for the metadata at url. It asks for two bytes of the page,
since the header holds the metadata.
The request for the metadata at `url`. It asks for two bytes of the page, since the header holds the metadata.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |