feat(machine): Bolt Card (NFC) tap-to-pay on cash-out #83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/boltcard-nfc-cashout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Sell-bitcoin (cash-out) can now be paid by tapping a Bolt Card instead of scanning the invoice QR. The ATM already generates a BOLT11 for the amount; a tap makes the ATM the LNURL-withdrawing party and pulls payment for that same invoice — settlement flows through the existing invoice watcher, so the state machine is unchanged.
Validated end-to-end on the batm3: tap → NTAG424 NDEF read → LNURL-withdraw → invoice paid →
dispensingCash(and it correctly declined a daily-limit card, surfacing the real LNURL error).How it fits
services.pcscd.enable+ a polkit rule authorizing the sandboxedbitspireuser.nfc-pcscnative addon (@pokusew/pcsclite) is rebuilt against Electron headers likebetter-sqlite3, withCPATH/LIBRARY_PATHpointing at nixpkgspcsclite(itsbinding.gyphardcodes Debian paths) andpcsclite.libinbuildInputsso autoPatchelf wires the RPATH.E104→ ReadBinary) and extract thelnurlw://…?p=…&c=…voucher (fresh SUN p/c per tap), forward onnfc:card-tapped. Lazy/guarded — a missing reader just reportsunavailable; the QR path is never affected.executeLnurlWithdraw(LUD-03) — GET the voucher, POST our invoice to the callback. Node fetch to avoid renderer CORS.displayingInvoicesubscribes to taps and calls the executor; "Tap Card or Scan" UI + live reader/processing/declined status.Reliability notes (from on-hardware testing)
E104— a first attempt with0004gave "not a Bolt Card" (NTAG424 usesE104).Tests
executeLnurlWithdraw— 12 tests (scheme mapping, two-step happy path, ERROR/decline/over-limit, network failure).Scope note
pcscd/reader config is in
batm3.nix(the reader is batm3 hardware). The renderer/driver/executor are model-agnostic and no-op without a reader.🤖 Generated with Claude Code