This commit is contained in:
callebtc
2022-09-13 21:36:18 +03:00
parent 075fb57093
commit f2228e6a38
16 changed files with 251 additions and 131 deletions

View File

@@ -1,6 +1,7 @@
from pydantic import BaseModel
from typing import List
from sqlite3 import Row
from typing import List
from pydantic import BaseModel
class BasePoint(BaseModel):
@@ -27,6 +28,22 @@ class Proof(BaseModel):
)
class Invoice(BaseModel):
amount: int
pr: str
hash: str
issued: bool = False
@classmethod
def from_row(cls, row: Row):
return cls(
amount=int(row[0]),
pr=str(row[1]),
hash=str(row[2]),
issued=bool(row[3]),
)
class MintPayload(BaseModel):
amount: int
B_: BasePoint