refactor: extract nostr to __init__

This commit is contained in:
Vlad Stan 2023-06-23 11:15:57 +03:00
parent e35dafe056
commit 99022f2b4a
4 changed files with 12 additions and 10 deletions

View file

@ -7,21 +7,13 @@ from loguru import logger
from lnbits.helpers import urlsafe_short_hash
from . import nostr
from .models import Event, Filter
from .nostr.client.client import NostrClient as NostrClientLib
from .nostr.filter import Filter as NostrFilter
from .nostr.filter import Filters as NostrFilters
from .nostr.message_pool import EndOfStoredEventsMessage, NoticeMessage
class NostrClient:
def __init__(self):
self.client: NostrClientLib = NostrClientLib(connect=False)
nostr = NostrClient()
class NostrRouter:
received_subscription_events: dict[str, list[Event]] = {}