Liking cljdoc? Tell your friends :D

dk.simongray.podcast.profile.payments

The record of the listener's payments in a profile, so that a payment that went to the wallet isn't sent again, on this device or another.

Each payment to a recipient is an entry under its id, as value.recipients/pay! gives it, and the last write wins:

{:status   :paid     ; or :sending, :failed or :skipped
 :sats     50
 :address  "ann@example.org" :type "lnaddress" :name "Ann"
 :preimage "…"  :proven? true  :invoice "lnbc…"
 :error    :value/wallet-silent  ; the id of the diagnostic
 :removed? false}

Record a payment as :sending just before it goes to the wallet, and again with what the wallet answered. One that is still :sending after a crash, or on another device after a sync, may be paid, so ask the wallet rather than sending it again.

The record of the listener's payments in a profile, so that a payment
that went to the wallet isn't sent again, on this device or another.

Each payment to a recipient is an entry under its id, as
value.recipients/pay! gives it, and the last write wins:

    {:status   :paid     ; or :sending, :failed or :skipped
     :sats     50
     :address  "ann@example.org" :type "lnaddress" :name "Ann"
     :preimage "…"  :proven? true  :invoice "lnbc…"
     :error    :value/wallet-silent  ; the id of the diagnostic
     :removed? false}

Record a payment as :sending just before it goes to the wallet, and
again with what the wallet answered. One that is still :sending after a
crash, or on another device after a sync, may be paid, so ask the
wallet rather than sending it again.
raw docstring

forgetclj/s

(forget profile ids at)

Take the payments ids out of the record of profile at at, e.g. the old ones, leaving tombstones until every device has seen them.

Take the payments `ids` out of the record of `profile` at `at`, e.g.
the old ones, leaving tombstones until every device has seen them.
sourceraw docstring

paymentsclj/s

(payments profile)

The recorded payments of profile, as a map of id to entry, without those forgotten.

The recorded payments of `profile`, as a map of id to entry, without
those forgotten.
sourceraw docstring

recordclj/s

(record profile {:keys [id] :as entry} at)

Record the entry of a payment in profile at at, under its :id, as value.recipients/pay! gives it, to its :sending-fn and in its result. The entry can have the :action, :feed-guid and :item-guid of the payment too.

Record the `entry` of a payment in `profile` at `at`, under its :id, as
value.recipients/pay! gives it, to its :sending-fn and in its result.
The entry can have the :action, :feed-guid and :item-guid of the
payment too.
sourceraw docstring

unsettledclj/s

(unsettled profile)

The ids of the payments of profile that went to the wallet with no answer recorded. Don't send them again, but ask the wallet whether it paid, e.g. with nwc/lookup-invoice, or tell the listener.

The ids of the payments of `profile` that went to the wallet with no
answer recorded. Don't send them again, but ask the wallet whether it
paid, e.g. with nwc/lookup-invoice, or tell the listener.
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