Merge pull request #4 from lnbits/latest-fastapi
fix for latest fastapi
This commit is contained in:
commit
f11ddfb808
2 changed files with 4 additions and 3 deletions
|
|
@ -59,14 +59,14 @@ class WithdrawLink(BaseModel):
|
|||
"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:
|
||||
url = req.url_for(
|
||||
name="withdraw.api_lnurl_callback", unique_hash=self.unique_hash
|
||||
)
|
||||
return LnurlWithdrawResponse(
|
||||
callback=ClearnetUrl(url, scheme="https"),
|
||||
callback=ClearnetUrl(str(url), scheme="https"),
|
||||
k1=self.k1,
|
||||
minWithdrawable=MilliSatoshi(self.min_withdrawable * 1000),
|
||||
maxWithdrawable=MilliSatoshi(self.max_withdrawable * 1000),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from http import HTTPStatus
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import Depends, HTTPException, Query, Request
|
||||
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl
|
||||
|
|
@ -66,7 +67,7 @@ async def api_link_retrieve(
|
|||
async def api_link_create_or_update(
|
||||
req: Request,
|
||||
data: CreateWithdrawData,
|
||||
link_id: str = Query(None),
|
||||
link_id: Optional[str] = None,
|
||||
wallet: WalletTypeInfo = Depends(require_admin_key),
|
||||
):
|
||||
if data.uses > 250:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue