2022-10-06 22:19:30 +01:00
|
|
|
import asyncio
|
2022-01-21 21:23:32 +00:00
|
|
|
from fastapi import APIRouter
|
|
|
|
|
|
|
|
from lnbits.db import Database
|
2022-10-06 17:10:15 +01:00
|
|
|
from lnbits.tasks import catch_everything_and_restart
|
2022-10-07 23:57:28 +01:00
|
|
|
from lnbits.helpers import template_renderer
|
2022-01-21 21:23:32 +00:00
|
|
|
|
|
|
|
db = Database("ext_lnurldevice")
|
|
|
|
|
|
|
|
lnurldevice_ext: APIRouter = APIRouter(prefix="/lnurldevice", tags=["lnurldevice"])
|
|
|
|
|
|
|
|
|
|
|
|
def lnurldevice_renderer():
|
|
|
|
return template_renderer(["lnbits/extensions/lnurldevice/templates"])
|
|
|
|
|
2022-10-07 23:18:57 +01:00
|
|
|
|
2022-10-06 17:10:15 +01:00
|
|
|
from .tasks import wait_for_paid_invoices
|
2022-01-21 21:23:32 +00:00
|
|
|
from .lnurl import * # noqa
|
|
|
|
from .views import * # noqa
|
|
|
|
from .views_api import * # noqa
|
2022-10-06 17:10:15 +01:00
|
|
|
|
2022-10-07 23:18:57 +01:00
|
|
|
|
2022-10-06 17:10:15 +01:00
|
|
|
def lnurldevice_start():
|
|
|
|
loop = asyncio.get_event_loop()
|
|
|
|
loop.create_task(catch_everything_and_restart(wait_for_paid_invoices))
|