fix(machine): wire up LNURL-withdraw completion callback

The onPaymentSuccess callback was passed to createATMServices but never
used, causing LNURL-withdraw claims to go undetected. Store the callback
so startLnurlCompletionPolling can trigger it when a withdrawal completes.

Refs: #24

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Patrick Mulligan 2026-02-14 15:39:46 -05:00
commit 021aa6e168

View file

@ -791,8 +791,11 @@ function createATMServices(
lightningPub: LightningPubClient, lightningPub: LightningPubClient,
clink: CLINKClient, clink: CLINKClient,
_identity: MachineIdentity, _identity: MachineIdentity,
_onPaymentSuccess: (preimage: string) => void onPaymentSuccess: (preimage: string) => void
): ATMServices { ): ATMServices {
// Store callback for LNURL-withdraw polling to use
const onPaymentCallback = onPaymentSuccess
return { return {
/** /**
* Generate an ndebit URI for cash-in * Generate an ndebit URI for cash-in