chore: get the extension started
This commit is contained in:
parent
94ce670866
commit
9b6b1e87b9
4 changed files with 36 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ nostrmarket_static_files = [
|
|||
]
|
||||
|
||||
|
||||
def market_renderer():
|
||||
def nostrmarket_renderer():
|
||||
return template_renderer(["lnbits/extensions/nostrmarket/templates"])
|
||||
|
||||
|
||||
|
|
|
|||
33
tasks.py
Normal file
33
tasks.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import asyncio
|
||||
import json
|
||||
import threading
|
||||
|
||||
import httpx
|
||||
import websocket
|
||||
from loguru import logger
|
||||
|
||||
from lnbits.core.models import Payment
|
||||
from lnbits.helpers import url_for
|
||||
from lnbits.tasks import register_invoice_listener
|
||||
|
||||
|
||||
|
||||
async def wait_for_paid_invoices():
|
||||
invoice_queue = asyncio.Queue()
|
||||
register_invoice_listener(invoice_queue)
|
||||
|
||||
while True:
|
||||
payment = await invoice_queue.get()
|
||||
await on_invoice_paid(payment)
|
||||
|
||||
|
||||
async def on_invoice_paid(payment: Payment) -> None:
|
||||
if payment.extra.get("tag") != "market":
|
||||
return
|
||||
|
||||
print("### on_invoice_paid")
|
||||
|
||||
|
||||
async def subscribe_nostrclient_ws():
|
||||
print("### subscribe_nostrclient_ws")
|
||||
|
||||
3
views.py
3
views.py
|
|
@ -1,7 +1,8 @@
|
|||
import json
|
||||
from http import HTTPStatus
|
||||
|
||||
from fastapi import Depends, Request, HTMLResponse
|
||||
from fastapi import Depends, Request
|
||||
from starlette.responses import HTMLResponse
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from loguru import logger
|
||||
|
||||
|
|
|
|||
0
views_api.py
Normal file
0
views_api.py
Normal file
Loading…
Add table
Add a link
Reference in a new issue