mirror of
https://github.com/aljazceru/python-nostr.git
synced 2025-12-19 15:24:19 +01:00
21 lines
525 B
Python
21 lines
525 B
Python
class ClientMessageType:
|
|
EVENT = "EVENT"
|
|
REQUEST = "REQ"
|
|
CLOSE = "CLOSE"
|
|
AUTH = "AUTH"
|
|
|
|
class RelayMessageType:
|
|
EVENT = "EVENT"
|
|
NOTICE = "NOTICE"
|
|
END_OF_STORED_EVENTS = "EOSE"
|
|
AUTH = "AUTH"
|
|
|
|
@staticmethod
|
|
def is_valid(type: str) -> bool:
|
|
if type == RelayMessageType.EVENT or \
|
|
type == RelayMessageType.NOTICE or \
|
|
type == RelayMessageType.END_OF_STORED_EVENTS or \
|
|
type == RelayMessageType.AUTH:
|
|
return True
|
|
return False
|