diff --git a/apps/machine/src/stores/atm.ts b/apps/machine/src/stores/atm.ts index 46ac786..5060beb 100644 --- a/apps/machine/src/stores/atm.ts +++ b/apps/machine/src/stores/atm.ts @@ -271,7 +271,7 @@ export const useAtmStore = defineStore('atm', () => { persistTransaction({ txid: ctx.txid, type: isCashInTx ? 'cash_in' : 'cash_out', - fiatCents: ctx.fiatAmount, + fiatCents: ctx.fiatCents, sats: ctx.satsAmount, bills, }) @@ -626,7 +626,7 @@ export const useAtmStore = defineStore('atm', () => { } // Calculate what the new sats amount would be - const newFiatCents = ctx.fiatAmount + denomination * 100 + const newFiatCents = ctx.fiatCents + denomination * 100 const newFiatUnits = newFiatCents / 100 const grossSats = Math.floor(newFiatUnits * ctx.exchangeRate) const fee = Math.floor(grossSats * ctx.feePercent) @@ -846,7 +846,7 @@ export const useAtmStore = defineStore('atm', () => { } // Calculate if this bill would exceed available balance - const newFiatCents = ctx.fiatAmount + denomination * 100 + const newFiatCents = ctx.fiatCents + denomination * 100 const newFiatUnits = newFiatCents / 100 const grossSats = Math.floor(newFiatUnits * ctx.exchangeRate) const fee = Math.floor(grossSats * ctx.feePercent) diff --git a/apps/machine/src/views/CashInView.vue b/apps/machine/src/views/CashInView.vue index 56a59d0..b26752b 100644 --- a/apps/machine/src/views/CashInView.vue +++ b/apps/machine/src/views/CashInView.vue @@ -119,7 +119,7 @@ function canAcceptBill(denomination: number): boolean { const ctx = context.value if (!ctx) return false if (ctx.availableBalance <= 0 || ctx.exchangeRate === 0) return true - const newFiatCents = ctx.fiatAmount + denomination * 100 + const newFiatCents = ctx.fiatCents + denomination * 100 const grossSats = Math.floor((newFiatCents / 100) * ctx.exchangeRate) const fee = Math.floor(grossSats * ctx.feePercent) return grossSats - fee <= ctx.availableBalance @@ -214,7 +214,7 @@ const isProcessing = computed(() => atmStore.isPayingInvoice)
- {{ atmStore.fiatSymbol }}{{ (context.fiatAmount / 100).toFixed(2) }} + {{ atmStore.fiatSymbol }}{{ (context.fiatCents / 100).toFixed(2) }}
{{ formatSats(context.satsAmount) }} sats @@ -322,7 +322,7 @@ const isProcessing = computed(() => atmStore.isPayingInvoice) {{ formatSats(context?.satsAmount || 0) }} sats
- {{ atmStore.fiatSymbol }}{{ ((context?.fiatAmount || 0) / 100).toFixed(2) }} + {{ atmStore.fiatSymbol }}{{ ((context?.fiatCents || 0) / 100).toFixed(2) }}
@@ -388,7 +388,7 @@ const isProcessing = computed(() => atmStore.isPayingInvoice)Your {{ atmStore.fiatSymbol - }}{{ context ? (context.fiatAmount / 100).toLocaleString() : '' }} has been accepted and + }}{{ context ? (context.fiatCents / 100).toLocaleString() : '' }} has been accepted and cannot be returned. Please scan the QR code to receive your Bitcoin.