feat: add extension-settings instead of environs (#28)
* feat: add extension-settings instead of environs
This commit is contained in:
parent
257f5d34d2
commit
f2e419e18d
10 changed files with 230 additions and 130 deletions
11
lnurl.py
11
lnurl.py
|
|
@ -1,3 +1,4 @@
|
|||
import json
|
||||
from http import HTTPStatus
|
||||
from urllib.parse import urlparse
|
||||
|
||||
|
|
@ -8,8 +9,11 @@ from starlette.exceptions import HTTPException
|
|||
from lnbits.core.services import create_invoice
|
||||
from lnbits.utils.exchange_rates import get_fiat_rate_satoshis
|
||||
|
||||
from . import lnurlp_ext, nostr_publickey
|
||||
from .crud import increment_pay_link
|
||||
from . import lnurlp_ext
|
||||
from .crud import (
|
||||
get_or_create_lnurlp_settings,
|
||||
increment_pay_link,
|
||||
)
|
||||
|
||||
|
||||
@lnurlp_ext.get(
|
||||
|
|
@ -145,6 +149,7 @@ async def api_lnurl_response(request: Request, link_id, lnaddress=False):
|
|||
params["commentAllowed"] = link.comment_chars
|
||||
|
||||
if link.zaps:
|
||||
settings = await get_or_create_lnurlp_settings()
|
||||
params["allowsNostr"] = True
|
||||
params["nostrPubkey"] = nostr_publickey.hex()
|
||||
params["nostrPubkey"] = settings.public_key
|
||||
return params
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue