fix: lnurlp, withdraw
This commit is contained in:
@@ -1,34 +1,48 @@
|
||||
import asyncio
|
||||
|
||||
from fastapi import APIRouter, FastAPI
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from starlette.routing import Mount
|
||||
|
||||
from lnbits.db import Database
|
||||
from lnbits.helpers import template_renderer
|
||||
from lnbits.tasks import catch_everything_and_restart
|
||||
|
||||
db = Database("ext_lnurlp")
|
||||
|
||||
lnurlp_static_files = [
|
||||
{
|
||||
"path": "/lnurlp/static",
|
||||
"app": StaticFiles(directory="lnbits/extensions/lnurlp/static"),
|
||||
"name": "lnurlp_static",
|
||||
}
|
||||
]
|
||||
|
||||
lnurlp_ext: APIRouter = APIRouter(
|
||||
prefix="/lnurlp",
|
||||
static_folder="static",
|
||||
tags=["lnurlp"]
|
||||
# "lnurlp", __name__, static_folder="static", template_folder="templates"
|
||||
)
|
||||
|
||||
def lnurlp_renderer():
|
||||
return template_renderer(
|
||||
[
|
||||
"lnbits/extensions/lnticket/templates",
|
||||
"lnbits/extensions/lnurlp/templates",
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
from .views_api import * # noqa
|
||||
from .views import * # noqa
|
||||
from .tasks import wait_for_paid_invoices
|
||||
|
||||
def lnurlp_start():
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.create_task(catch_everything_and_restart(wait_for_paid_invoices))
|
||||
|
||||
|
||||
@lnurlp_ext.on_event("startup")
|
||||
def _do_it():
|
||||
register_listeners()
|
||||
|
||||
# from .lnurl import * # noqa
|
||||
# from .tasks import register_listeners
|
||||
|
||||
# from lnbits.tasks import record_async
|
||||
|
||||
|
||||
Reference in New Issue
Block a user