fix: bump lnurl its not callback_url now, its just url (#3312)

This commit is contained in:
dni ⚡
2025-08-18 09:18:11 +02:00
committed by GitHub
parent 0ba81ec719
commit c24d2f24cf
5 changed files with 16 additions and 13 deletions
+7 -3
View File
@@ -12,7 +12,9 @@ from lnbits.settings import settings
from lnbits.utils.exchange_rates import fiat_amount_as_satoshis
async def get_pr_from_lnurl(lnurl: str, amount_msat: int) -> str:
async def get_pr_from_lnurl(
lnurl: str, amount_msat: int, comment: str | None = None
) -> str:
res = await handle(lnurl, user_agent=settings.user_agent, timeout=10)
if isinstance(res, LnurlErrorResponse):
raise LnurlResponseException(res.reason)
@@ -22,7 +24,8 @@ async def get_pr_from_lnurl(lnurl: str, amount_msat: int) -> str:
)
res2 = await execute_pay_request(
res,
msat=str(amount_msat),
msat=amount_msat,
comment=comment,
user_agent=settings.user_agent,
timeout=10,
)
@@ -48,7 +51,8 @@ async def fetch_lnurl_pay_request(data: CreateLnurlPayment) -> LnurlPayActionRes
return await execute_pay_request(
data.res,
msat=str(amount_msat),
msat=amount_msat,
comment=data.comment,
user_agent=settings.user_agent,
timeout=10,
)
+4 -4
View File
@@ -134,12 +134,12 @@ async def api_payment_pay_with_nfc(
payment_request: str,
lnurl_data: CreateLnurlWithdraw,
) -> LnurlErrorResponse | LnurlSuccessResponse:
if not lnurl_data.lnurl_w.lud17:
return LnurlErrorResponse(reason="LNURL-withdraw lud17 not provided.")
try:
res = await lnurl_handle(
lnurl_data.lnurl_w.callback_url, user_agent=settings.user_agent, timeout=10
)
url = lnurl_data.lnurl_w.lud17
res = await lnurl_handle(url, user_agent=settings.user_agent, timeout=10)
except (LnurlResponseException, Exception) as exc:
logger.warning(exc)
return LnurlErrorResponse(reason=str(exc))
if not isinstance(res, LnurlWithdrawResponse):