feat: update to v1.0.0 (#30)
This commit is contained in:
parent
2bdbbb274d
commit
73054fd5ce
20 changed files with 2029 additions and 2132 deletions
13
models.py
13
models.py
|
|
@ -1,4 +1,3 @@
|
|||
from sqlite3 import Row
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
|
@ -23,6 +22,7 @@ class NostrPartialAccount(BaseModel):
|
|||
|
||||
class NostrAccount(BaseModel):
|
||||
pubkey: str
|
||||
relay_id: str
|
||||
sats: int = 0
|
||||
storage: int = 0
|
||||
paid_to_join: bool = False
|
||||
|
|
@ -36,8 +36,11 @@ class NostrAccount(BaseModel):
|
|||
|
||||
@classmethod
|
||||
def null_account(cls) -> "NostrAccount":
|
||||
return NostrAccount(pubkey="")
|
||||
return NostrAccount(pubkey="", relay_id="")
|
||||
|
||||
@classmethod
|
||||
def from_row(cls, row: Row) -> "NostrAccount":
|
||||
return cls(**dict(row))
|
||||
|
||||
class NostrEventTags(BaseModel):
|
||||
event_id: str
|
||||
name: str
|
||||
value: str
|
||||
extra: Optional[str] = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue