lnbits-legend/lnbits/extensions/cashu/__init__.py

29 lines
702 B
Python
Raw Normal View History

2022-09-16 13:20:42 +01:00
import asyncio
from fastapi import APIRouter
from lnbits.db import Database
from lnbits.helpers import template_renderer
from lnbits.tasks import catch_everything_and_restart
2022-09-29 20:42:13 +02:00
from cashu.mint.router import router as cashu_router
2022-09-16 13:20:42 +01:00
db = Database("ext_cashu")
2022-09-29 20:42:13 +02:00
cashu_ext: APIRouter = APIRouter(prefix="/cashu", tags=["cashu"])
cashu_ext.include_router(router=cashu_router)
2022-09-16 13:20:42 +01:00
def cashu_renderer():
return template_renderer(["lnbits/extensions/cashu/templates"])
from .tasks import wait_for_paid_invoices
from .views import * # noqa
from .views_api import * # noqa
def cashu_start():
loop = asyncio.get_event_loop()
loop.create_task(catch_everything_and_restart(wait_for_paid_invoices))