mirror of
https://github.com/lnbits/lnbits.git
synced 2025-07-12 22:12:41 +02:00
mypy fixes, api, eclair
This commit is contained in:
@ -181,7 +181,7 @@ async def api_payments_create_invoice(data: CreateInvoiceData, wallet: Wallet):
|
|||||||
|
|
||||||
lnurl_response: Union[None, bool, str] = None
|
lnurl_response: Union[None, bool, str] = None
|
||||||
if data.lnurl_callback:
|
if data.lnurl_callback:
|
||||||
if "lnurl_balance_check" in data:
|
if hasattr(data, "lnurl_balance_check"):
|
||||||
assert (
|
assert (
|
||||||
data.lnurl_balance_check is not None
|
data.lnurl_balance_check is not None
|
||||||
), "lnurl_balance_check is required"
|
), "lnurl_balance_check is required"
|
||||||
@ -248,7 +248,7 @@ async def api_payments_pay_invoice(bolt11: str, wallet: Wallet):
|
|||||||
)
|
)
|
||||||
async def api_payments_create(
|
async def api_payments_create(
|
||||||
wallet: WalletTypeInfo = Depends(require_invoice_key),
|
wallet: WalletTypeInfo = Depends(require_invoice_key),
|
||||||
invoiceData: CreateInvoiceData = Body(...),
|
invoiceData = Body(...),
|
||||||
):
|
):
|
||||||
if invoiceData.out is True and wallet.wallet_type == 0:
|
if invoiceData.out is True and wallet.wallet_type == 0:
|
||||||
if not invoiceData.bolt11:
|
if not invoiceData.bolt11:
|
||||||
|
@ -9,7 +9,8 @@ import httpx
|
|||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
# mypy https://github.com/aaugustin/websockets/issues/940
|
# mypy https://github.com/aaugustin/websockets/issues/940
|
||||||
from websockets.client import connect
|
# from websockets.client import connect
|
||||||
|
from websockets import connect
|
||||||
from websockets.exceptions import (
|
from websockets.exceptions import (
|
||||||
ConnectionClosed,
|
ConnectionClosed,
|
||||||
ConnectionClosedError,
|
ConnectionClosedError,
|
||||||
|
Reference in New Issue
Block a user