diff --git a/static/js/tpos.js b/static/js/tpos.js index 3e770f0..a6c103c 100644 --- a/static/js/tpos.js +++ b/static/js/tpos.js @@ -103,7 +103,7 @@ window.app = Vue.createApp({ } }, computed: { - amount: function () { + amount() { if (!this.stack.length) return 0.0 if (this.currency == 'sats') return Number(this.stack.join('')) return ( @@ -111,34 +111,34 @@ window.app = Vue.createApp({ (this.currency == 'sats' ? 1 : 0.01) ) }, - amountFormatted: function () { + amountFormatted() { return this.formatAmount(this.amount, this.currency) }, totalFormatted() { return this.formatAmount(this.total, this.currency) }, - amountWithTipFormatted: function () { + amountWithTipFormatted() { return this.formatAmount(this.amount + this.tipAmount, this.currency) }, - sat: function () { + sat() { if (!this.exchangeRate) return 0 return Math.ceil(this.amount * this.exchangeRate) }, - totalSat: function () { + totalSat() { if (!this.exchangeRate) return 0 return Math.ceil(this.total * this.exchangeRate) }, - tipAmountSat: function () { + tipAmountSat() { if (!this.exchangeRate) return 0 return Math.ceil(this.tipAmount * this.exchangeRate) }, - tipAmountFormatted: function () { + tipAmountFormatted() { return LNbits.utils.formatSat(this.tipAmountSat) }, - fsat: function () { + fsat() { return LNbits.utils.formatSat(this.sat) }, - totalfsat: function () { + totalfsat() { return LNbits.utils.formatSat(this.totalSat) }, roundToSugestion() { @@ -656,10 +656,9 @@ window.app = Vue.createApp({ Quasar.Loading.hide() } else { LNbits.api - .request('GET', `/tpos/api/v1/rate/${this.currency}`) + .request('GET', `/api/v1/rate/${this.currency}`) .then(response => { this.exchangeRate = response.data.rate - console.log(this.exchangeRate) Quasar.Loading.hide() }) .catch(e => console.error(e)) diff --git a/views_api.py b/views_api.py index 2957e8c..945e076 100644 --- a/views_api.py +++ b/views_api.py @@ -15,7 +15,6 @@ require_admin_key, require_invoice_key, ) -from lnbits.utils.exchange_rates import get_fiat_rate_satoshis from lnurl import decode as decode_lnurl from .crud import ( @@ -104,7 +103,6 @@ async def api_tpos_delete( "/api/v1/tposs/{tpos_id}/invoices", status_code=HTTPStatus.CREATED ) async def api_tpos_create_invoice(tpos_id: str, data: CreateTposInvoice) -> dict: - tpos = await get_tpos(tpos_id) if not tpos: @@ -337,16 +335,6 @@ async def api_tpos_create_withdraw( return {**lnurlcharge.dict(), **{"lnurl": lnurlcharge.lnurl(request)}} -@tpos_api_router.get("/api/v1/rate/{currency}", status_code=HTTPStatus.OK) -async def api_check_fiat_rate(currency): - try: - rate = await get_fiat_rate_satoshis(currency) - except AssertionError: - rate = None - - return {"rate": rate} - - @tpos_api_router.put("/api/v1/tposs/{tpos_id}/items", status_code=HTTPStatus.CREATED) async def api_tpos_create_items( data: CreateUpdateItemData,