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:
@@ -256,7 +256,10 @@ new Vue({
|
||||
},
|
||||
balance: 0,
|
||||
credit: 0,
|
||||
newName: ''
|
||||
update: {
|
||||
name: null,
|
||||
currency: null
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -717,16 +720,12 @@ new Vue({
|
||||
}
|
||||
})
|
||||
},
|
||||
updateWalletName: function () {
|
||||
let newName = this.newName
|
||||
let adminkey = this.g.wallet.adminkey
|
||||
if (!newName || !newName.length) return
|
||||
updateWallet: function (data) {
|
||||
LNbits.api
|
||||
.request('PUT', '/api/v1/wallet/' + newName, adminkey, {})
|
||||
.request('PATCH', '/api/v1/wallet', this.g.wallet.adminkey, data)
|
||||
.then(res => {
|
||||
this.newName = ''
|
||||
this.$q.notify({
|
||||
message: `Wallet named updated.`,
|
||||
message: `Wallet updated.`,
|
||||
type: 'positive',
|
||||
timeout: 3500
|
||||
})
|
||||
@@ -737,7 +736,6 @@ new Vue({
|
||||
)
|
||||
})
|
||||
.catch(err => {
|
||||
this.newName = ''
|
||||
LNbits.utils.notifyApiError(err)
|
||||
})
|
||||
},
|
||||
@@ -811,6 +809,9 @@ new Vue({
|
||||
this.fetchBalance()
|
||||
this.fetchPayments()
|
||||
|
||||
this.update.name = this.g.wallet.name
|
||||
this.update.currency = this.g.wallet.currency
|
||||
|
||||
LNbits.api
|
||||
.request('GET', '/api/v1/currencies')
|
||||
.then(response => {
|
||||
|
||||
Reference in New Issue
Block a user