add nostr

This commit is contained in:
callebtc
2022-12-18 17:10:06 +01:00
parent 60487a14df
commit 1e38fe695f
31 changed files with 2039 additions and 1 deletions

15
nostr/message_type.py Normal file
View File

@@ -0,0 +1,15 @@
class ClientMessageType:
EVENT = "EVENT"
REQUEST = "REQ"
CLOSE = "CLOSE"
class RelayMessageType:
EVENT = "EVENT"
NOTICE = "NOTICE"
END_OF_STORED_EVENTS = "EOSE"
@staticmethod
def is_valid(type: str) -> bool:
if type == RelayMessageType.EVENT or type == RelayMessageType.NOTICE or type == RelayMessageType.END_OF_STORED_EVENTS:
return True
return False