mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-13 11:35:56 +01:00
formatting
This commit is contained in:
parent
cef6382e7a
commit
341e8aa3e4
4 changed files with 16 additions and 18 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue