diff --git a/cashu/nostr/client/client.py b/cashu/nostr/client/client.py index 3cb77662..3af7303b 100644 --- a/cashu/nostr/client/client.py +++ b/cashu/nostr/client/client.py @@ -45,9 +45,9 @@ def __init__(self, private_key: str = "", relays: List[str] = [], connect=True): def connect(self): for relay in self.relays: self.relay_manager.add_relay(relay) - self.relay_manager.open_connections({ - "cert_reqs": ssl.CERT_NONE - }) # NOTE: This disables ssl certificate verification + self.relay_manager.open_connections( + {"cert_reqs": ssl.CERT_NONE} + ) # NOTE: This disables ssl certificate verification def close(self): self.relay_manager.close_connections() @@ -105,13 +105,15 @@ def dm(self, message: str, to_pubkey: PublicKey): self.relay_manager.publish_event(dm) def get_dm(self, sender_publickey: PublicKey, callback_func=None, filter_kwargs={}): - filters = Filters([ - Filter( - kinds=[EventKind.ENCRYPTED_DIRECT_MESSAGE], - pubkey_refs=[sender_publickey.hex()], - **filter_kwargs, - ) - ]) + filters = Filters( + [ + Filter( + kinds=[EventKind.ENCRYPTED_DIRECT_MESSAGE], + pubkey_refs=[sender_publickey.hex()], + **filter_kwargs, + ) + ] + ) subscription_id = os.urandom(4).hex() self.relay_manager.add_subscription(subscription_id, filters) diff --git a/cashu/nostr/event.py b/cashu/nostr/event.py index 6271e7ef..0ee7ad0b 100644 --- a/cashu/nostr/event.py +++ b/cashu/nostr/event.py @@ -77,18 +77,20 @@ def verify(self) -> bool: ) def to_message(self) -> str: - return json.dumps([ - ClientMessageType.EVENT, - { - "id": self.id, - "pubkey": self.public_key, - "created_at": self.created_at, - "kind": self.kind, - "tags": self.tags, - "content": self.content, - "sig": self.signature, - }, - ]) + return json.dumps( + [ + ClientMessageType.EVENT, + { + "id": self.id, + "pubkey": self.public_key, + "created_at": self.created_at, + "kind": self.kind, + "tags": self.tags, + "content": self.content, + "sig": self.signature, + }, + ] + ) @dataclass