From cbc24a8fa557809285f3426738c0982c181eb2ec Mon Sep 17 00:00:00 2001 From: Ben Arc Date: Tue, 9 Nov 2021 22:25:20 +0000 Subject: [PATCH] Changed optional unit to sat --- lnbits/core/views/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index 6bbd9e5fc..d87afba9d 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -91,7 +91,7 @@ class CreateInvoiceData(BaseModel): out: Optional[bool] = True amount: int = Query(None, ge=1) memo: str = None - unit: Optional[str] = None + unit: Optional[str] = 'sat' description_hash: Optional[str] = None lnurl_callback: Optional[str] = None lnurl_balance_check: Optional[str] = None @@ -107,7 +107,7 @@ async def api_payments_create_invoice(data: CreateInvoiceData, wallet: Wallet): else: description_hash = b"" memo = data.memo - if not data.unit or data.unit == "sat": + if data.unit == 'sat': amount = data.amount else: price_in_sats = await fiat_amount_as_satoshis(data.amount, data.unit)