Skip to main content

Module zap

Module zap 

Source
Expand description

Zap message handlers for Avestruz.

Zapping a note opens a view of its own: how much, and a word to go with it. The author’s Lightning address is then asked for an invoice, which shows as a QR code for a wallet to scan; this client holds no money and pays nothing itself.

While the invoice is on show the relays are listened to for the receipt the author’s wallet service publishes once it is paid. When it comes the view says so, and the note’s count has it. The listening stops when the view is left.

Anyone can zap. With a secret key the zap is the account’s; without one the request is signed with a key made for it, and the zap is anonymous.

Constants§

DEFAULT_ZAP_SATS 🔒
What the amount field starts at, in sats.
MAX_AMOUNT_DIGITS 🔒
How long an amount may be typed, in digits, and a comment, in characters.
MAX_COMMENT_CHARS 🔒

Functions§

wallet_address 🔒
What a wallet scans to pay bolt11: the invoice as a lightning: address, in capitals, which a QR code holds in fewer modules.
zap_error_text 🔒
Why there is no invoice, in the user’s language.