Handle missing monstr dependency

This commit is contained in:
thePR0M3TH3AN committed 2025-06-29 21:34:28 -04:00
1 parent c1d9ed8501
commit 65244adf57
2 files changed
+15 -2

No files matched your search

+10 -1
View File
@@ -3,7 +3,16 @@
import time
import logging
import traceback
from monstr.event.event import Event
try:
from monstr.event.event import Event
except ImportError: # pragma: no cover - optional dependency
class Event: # minimal placeholder for type hints when monstr is absent
id: str
created_at: int
content: str
# Instantiate the logger
logger = logging.getLogger(__name__)
+5 -1
View File
@@ -23,7 +23,11 @@ import traceback
from typing import Union
from bip_utils import Bip39SeedGenerator
from local_bip85.bip85 import BIP85
from monstr.encrypt import Keys
try:
from monstr.encrypt import Keys
except ImportError: # Fall back to local coincurve implementation
from nostr.coincurve_keys import Keys
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.backends import default_backend