remove the need for nostrclient
This commit is contained in:
parent
642cad9ed8
commit
bf6659bbbd
6 changed files with 29 additions and 45 deletions
20
tasks.py
20
tasks.py
|
|
@ -12,16 +12,12 @@ from websocket import WebSocketApp
|
|||
from lnbits.settings import settings
|
||||
from .crud import get_pay_link
|
||||
from threading import Thread
|
||||
from . import nostrclient_present, nostr_privatekey
|
||||
from . import nostr_privatekey
|
||||
from typing import List
|
||||
import time
|
||||
|
||||
if nostrclient_present:
|
||||
try:
|
||||
from ..nostrclient.nostr.event import Event
|
||||
from ..nostrclient.nostr.key import PrivateKey, PublicKey
|
||||
except ImportError:
|
||||
nostrclient_present = False
|
||||
from .nostr.event import Event
|
||||
from .nostr.key import PrivateKey, PublicKey
|
||||
|
||||
|
||||
async def wait_for_paid_invoices():
|
||||
|
|
@ -77,7 +73,7 @@ async def on_invoice_paid(payment: Payment):
|
|||
|
||||
# NIP-57
|
||||
nostr = payment.extra.get("nostr")
|
||||
if nostrclient_present and nostr:
|
||||
if nostr:
|
||||
|
||||
event_json = json.loads(nostr)
|
||||
|
||||
|
|
@ -117,10 +113,10 @@ async def on_invoice_paid(payment: Payment):
|
|||
# list of all threads for these websockets
|
||||
wsts: List[Thread] = []
|
||||
|
||||
# send zap via nostrclient
|
||||
ws, wst = send_zap(f"ws://localhost:{settings.port}/nostrclient/api/v1/relay")
|
||||
wss += [ws]
|
||||
wsts += [wst]
|
||||
# # send zap via nostrclient
|
||||
# ws, wst = send_zap(f"ws://localhost:{settings.port}/nostrclient/api/v1/relay")
|
||||
# wss += [ws]
|
||||
# wsts += [wst]
|
||||
|
||||
# send zap receipt to relays in zap request
|
||||
relays = get_tag(event_json, "relays")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue