diff --git a/models.py b/models.py index 49421a7..6b4ba0e 100644 --- a/models.py +++ b/models.py @@ -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), diff --git a/views_api.py b/views_api.py index 525796c..25df3c3 100644 --- a/views_api.py +++ b/views_api.py @@ -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: