-
released this
2026-06-21 15:26:14 +00:00 | 0 commits to main since this releaseAdds an optional
extra(JSON) field to a withdraw link. When the link
is claimed, thatextrais merged onto the payout payment'sextra, so
a caller can tag the resulting payment with metadata an external listener
keys on — the link is the only place to attach it (the customer-facing
LNURL-withdraw payout otherwise carries just{tag, withdrawal_link_id}).Motivating use: bitSpire cash-in settlements. The operator's spirekeeper
listener fires acash_insettlement (fee split to the platform) only on
an outbound payment stampedsource=bitspire; before this there was no
way to stamp an LNURL-withdraw payout, so cash-ins never settled. bitSpire
now creates the cash-in link for the NET amount with
extra={source, type:cash_in, principal_sats, fee_sats, ...}and the
settlement fires on claim.- models:
extra: dict | Noneon CreateWithdrawData + WithdrawLink.
LNbits' db layer (de)serializes dict columns to/from JSON natively
(same as Payment.extra) — no per-field validator needed. - migrations_fork.py:
withdraw_link.extra TEXTunderwithdraw_fork,
keeping the upstream-tracked migrations.py byte-identical for clean
rebases (aiolabs/lnbits#8 pattern). - views_lnurl:
extra={**(link.extra or {}), "tag": ..., "withdrawal_link_id": ...}
— the withdraw extension's own keys are written last so a caller cannot
clobber them.
Verified end-to-end on the dev stack: a stamped link's payout carries the
merged extra and drives a spirekeeper cash_in settlement + super-fee payout.Downloads
-
Source code (ZIP)
3 downloads
-
Source code (TAR.GZ)
1 download
- models: