track fiat value of payments (#1789)

* save fiat_amounts on payment creation

* show fiat amount in frontend

* add lnbits_default_accounting_currency

* extract fiat calculation logic into service

* move all currency conversions to calc_fiat_amounts

move all conversion logic into create_invoice so extensions can benefit aswell

* show user-defined and wallet-defined currency in frontend

* remove sat from fiat units

* make bundle

* improve tests

* debug log
This commit is contained in:
jackstar12
2023-08-28 11:00:59 +01:00
committed by GitHub
parent 7a37e72915
commit 2623e9247a
14 changed files with 233 additions and 42 deletions
+5 -2
View File
@@ -178,7 +178,8 @@ window.LNbits = {
id: data.id,
name: data.name,
adminkey: data.adminkey,
inkey: data.inkey
inkey: data.inkey,
currency: data.currency
}
newWallet.msat = data.balance_msat
newWallet.sat = Math.round(data.balance_msat / 1000)
@@ -203,7 +204,9 @@ window.LNbits = {
extra: data.extra,
wallet_id: data.wallet_id,
webhook: data.webhook,
webhook_status: data.webhook_status
webhook_status: data.webhook_status,
fiat_amount: data.fiat_amount,
fiat_currency: data.fiat_currency
}
obj.date = Quasar.utils.date.formatDate(