fix: use fiat code from env in command queue poller

The command poller hardcoded 'GTQ' as the currency for manual dispense
transactions. Now reads VITE_LAMASSU_FIAT_CODE from env, defaulting
to 'USD'.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Patrick Mulligan 2026-03-26 00:47:07 -04:00
commit 902c8ab6cb

View file

@ -396,6 +396,7 @@ function startCommandPoller(): void {
const result = await halInstance.dispenseCash(parsed.bills) const result = await halInstance.dispenseCash(parsed.bills)
const txid = `manual-${Date.now()}-${Math.random().toString(36).slice(2, 8)}` const txid = `manual-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`
const totalFiatCents = parsed.bills.reduce((s, b) => s + b.denomination * b.count * 100, 0) const totalFiatCents = parsed.bills.reduce((s, b) => s + b.denomination * b.count * 100, 0)
const fiatCode = process.env.VITE_LAMASSU_FIAT_CODE || 'USD'
recordTransaction({ recordTransaction({
txid, txid,
@ -406,7 +407,7 @@ function startCommandPoller(): void {
feeSats: 0, feeSats: 0,
feePercent: 0, feePercent: 0,
exchangeRate: 0, exchangeRate: 0,
currency: 'GTQ', currency: fiatCode,
bills: parsed.bills, bills: parsed.bills,
cassettes: result.cassettes, cassettes: result.cassettes,
error: result.error, error: result.error,