feat: add basic NIP20 response
This commit is contained in:
parent
30150c4561
commit
fbae6d6c88
2 changed files with 28 additions and 15 deletions
|
|
@ -62,6 +62,10 @@ class NostrEvent(BaseModel):
|
|||
if not valid_signature:
|
||||
raise ValueError(f"Invalid signature: '{self.sig}' for event '{self.id}'")
|
||||
|
||||
|
||||
def serialize_response(self, subscription_id):
|
||||
return [NostrEventType.EVENT, subscription_id, dict(self)]
|
||||
|
||||
@classmethod
|
||||
def from_row(cls, row: Row) -> "NostrEvent":
|
||||
return cls(**dict(row))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue