mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-26 11:56:16 +02:00
formatting
This commit is contained in:
@@ -1,14 +1,6 @@
|
||||
from fastapi import Query
|
||||
from lnurl import (
|
||||
LnurlErrorResponse,
|
||||
LnurlPayActionResponse,
|
||||
LnurlPayResponse,
|
||||
)
|
||||
from lnurl.models import (
|
||||
LightningInvoice,
|
||||
ClearnetUrl,
|
||||
MilliSatoshi
|
||||
)
|
||||
from lnurl import LnurlErrorResponse, LnurlPayActionResponse, LnurlPayResponse
|
||||
from lnurl.models import ClearnetUrl, LightningInvoice, MilliSatoshi
|
||||
from starlette.requests import Request
|
||||
|
||||
from lnbits.core.services import create_invoice
|
||||
@@ -34,7 +26,9 @@ async def lnurl_response(req: Request, item_id: int = Query(...)) -> dict:
|
||||
) * 1000
|
||||
|
||||
resp = LnurlPayResponse(
|
||||
callback=ClearnetUrl(req.url_for("offlineshop.lnurl_callback", item_id=item.id), scheme="https"),
|
||||
callback=ClearnetUrl(
|
||||
req.url_for("offlineshop.lnurl_callback", item_id=item.id), scheme="https"
|
||||
),
|
||||
minSendable=MilliSatoshi(price_msat),
|
||||
maxSendable=MilliSatoshi(price_msat),
|
||||
metadata=await item.lnurlpay_metadata(),
|
||||
|
@@ -6,7 +6,7 @@ from sqlite3 import Row
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from lnurl import encode as lnurl_encode
|
||||
from lnurl.models import UrlAction, Max144Str, ClearnetUrl
|
||||
from lnurl.models import ClearnetUrl, Max144Str, UrlAction
|
||||
from lnurl.types import LnurlPayMetadata
|
||||
from pydantic import BaseModel
|
||||
from starlette.requests import Request
|
||||
@@ -124,6 +124,11 @@ class Item(BaseModel):
|
||||
return None
|
||||
|
||||
return UrlAction(
|
||||
url=ClearnetUrl(req.url_for("offlineshop.confirmation_code", p=payment_hash), scheme="https"),
|
||||
description=Max144Str("Open to get the confirmation code for your purchase."),
|
||||
url=ClearnetUrl(
|
||||
req.url_for("offlineshop.confirmation_code", p=payment_hash),
|
||||
scheme="https",
|
||||
),
|
||||
description=Max144Str(
|
||||
"Open to get the confirmation code for your purchase."
|
||||
),
|
||||
)
|
||||
|
@@ -3,7 +3,7 @@ from datetime import datetime
|
||||
from http import HTTPStatus
|
||||
from typing import List
|
||||
|
||||
from fastapi import HTTPException, Request, Depends, Query
|
||||
from fastapi import Depends, HTTPException, Query, Request
|
||||
from starlette.responses import HTMLResponse
|
||||
|
||||
from lnbits.core.crud import get_standalone_payment
|
||||
|
@@ -1,10 +1,9 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
from fastapi import Query, Depends, Request, HTTPException, Response
|
||||
|
||||
from fastapi import Depends, HTTPException, Query, Request, Response
|
||||
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl
|
||||
from pydantic import BaseModel
|
||||
|
||||
from lnbits.decorators import WalletTypeInfo, get_key_type
|
||||
from lnbits.utils.exchange_rates import currencies
|
||||
|
Reference in New Issue
Block a user