From 021aa6e1683d14afb1456c0c2ee713553dde572d Mon Sep 17 00:00:00 2001 From: Patrick Mulligan Date: Sat, 14 Feb 2026 15:39:46 -0500 Subject: [PATCH] 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 --- lamassu-next/apps/machine/src/services/lightning.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lamassu-next/apps/machine/src/services/lightning.ts b/lamassu-next/apps/machine/src/services/lightning.ts index 1602372..f522bba 100644 --- a/lamassu-next/apps/machine/src/services/lightning.ts +++ b/lamassu-next/apps/machine/src/services/lightning.ts @@ -791,8 +791,11 @@ function createATMServices( lightningPub: LightningPubClient, clink: CLINKClient, _identity: MachineIdentity, - _onPaymentSuccess: (preimage: string) => void + onPaymentSuccess: (preimage: string) => void ): ATMServices { + // Store callback for LNURL-withdraw polling to use + const onPaymentCallback = onPaymentSuccess + return { /** * Generate an ndebit URI for cash-in