Merge pull request #4 from lnbits/latest-fastapi
Some checks failed
release github version / build (push) Has been cancelled

fix for latest fastapi
This commit is contained in:
dni ⚡ 2023-06-22 10:56:19 +02:00 committed by GitHub
commit 527d1c9ae1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -59,14 +59,14 @@ class WithdrawLink(BaseModel):
"withdraw.api_lnurl_response", unique_hash=self.unique_hash "withdraw.api_lnurl_response", unique_hash=self.unique_hash
) )
return lnurl_encode(url) return lnurl_encode(str(url))
def lnurl_response(self, req: Request) -> LnurlWithdrawResponse: def lnurl_response(self, req: Request) -> LnurlWithdrawResponse:
url = req.url_for( url = req.url_for(
name="withdraw.api_lnurl_callback", unique_hash=self.unique_hash name="withdraw.api_lnurl_callback", unique_hash=self.unique_hash
) )
return LnurlWithdrawResponse( return LnurlWithdrawResponse(
callback=ClearnetUrl(url, scheme="https"), callback=ClearnetUrl(str(url), scheme="https"),
k1=self.k1, k1=self.k1,
minWithdrawable=MilliSatoshi(self.min_withdrawable * 1000), minWithdrawable=MilliSatoshi(self.min_withdrawable * 1000),
maxWithdrawable=MilliSatoshi(self.max_withdrawable * 1000), maxWithdrawable=MilliSatoshi(self.max_withdrawable * 1000),

View file

@ -1,4 +1,5 @@
from http import HTTPStatus from http import HTTPStatus
from typing import Optional
from fastapi import Depends, HTTPException, Query, Request from fastapi import Depends, HTTPException, Query, Request
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl
@ -66,7 +67,7 @@ async def api_link_retrieve(
async def api_link_create_or_update( async def api_link_create_or_update(
req: Request, req: Request,
data: CreateWithdrawData, data: CreateWithdrawData,
link_id: str = Query(None), link_id: Optional[str] = None,
wallet: WalletTypeInfo = Depends(require_admin_key), wallet: WalletTypeInfo = Depends(require_admin_key),
): ):
if data.uses > 250: if data.uses > 250: