diff --git a/lamassu-next/apps/machine/src/stores/atm.ts b/lamassu-next/apps/machine/src/stores/atm.ts index 0c805ed..f078a77 100644 --- a/lamassu-next/apps/machine/src/stores/atm.ts +++ b/lamassu-next/apps/machine/src/stores/atm.ts @@ -156,10 +156,23 @@ export const useAtmStore = defineStore('atm', () => { paymentReceived(preimage) }) - // Wire up offer request callback (for logging/debugging) + // Wire up offer request callback - send to state machine for cash-out flow services.onOfferRequest((request, sender) => { console.log('[ATM] Offer request from:', sender.slice(0, 16) + '...') console.log('[ATM] Amount requested:', request.amount_sats, 'sats') + + // Send to state machine if we're in the displayingNoffer state + if (nestedState.value === 'displayingNoffer') { + send({ + type: 'OFFER_REQUEST_RECEIVED', + request: { + eventId: request.offer || 'unknown', + payerPubkey: sender, + amountSats: request.amount_sats, + description: request.description, + }, + }) + } }) // Initialize state machine with real services diff --git a/lamassu-next/apps/machine/src/views/CashOutView.vue b/lamassu-next/apps/machine/src/views/CashOutView.vue index af22593..5d4eb70 100644 --- a/lamassu-next/apps/machine/src/views/CashOutView.vue +++ b/lamassu-next/apps/machine/src/views/CashOutView.vue @@ -25,13 +25,6 @@ watch( const nestedState = computed(() => atmStore.nestedState) const context = computed(() => atmStore.context) -// Available denominations for cash-out -const amounts = [20, 40, 60, 80, 100] - -function selectAmount(amount: number) { - atmStore.selectAmount(amount) -} - function cancel() { atmStore.cancel() } @@ -47,6 +40,10 @@ function skipReceipt() { function formatSats(sats: number): string { return sats.toLocaleString() } + +function formatFiat(cents: number): string { + return (cents / 100).toFixed(2) +}