mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-20 10:39:59 +01:00
43 lines
755 B
Python
43 lines
755 B
Python
from sqlite3 import Row
|
|
|
|
from fastapi.param_functions import Query
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class CreateWallet(BaseModel):
|
|
masterpub: str = Query("")
|
|
title: str = Query("")
|
|
|
|
|
|
class Wallets(BaseModel):
|
|
id: str
|
|
user: str
|
|
masterpub: str
|
|
title: str
|
|
address_no: int
|
|
balance: int
|
|
|
|
@classmethod
|
|
def from_row(cls, row: Row) -> "Wallets":
|
|
return cls(**dict(row))
|
|
|
|
|
|
class Mempool(BaseModel):
|
|
user: str
|
|
endpoint: str
|
|
|
|
@classmethod
|
|
def from_row(cls, row: Row) -> "Mempool":
|
|
return cls(**dict(row))
|
|
|
|
|
|
class Addresses(BaseModel):
|
|
id: str
|
|
address: str
|
|
wallet: str
|
|
amount: int
|
|
|
|
@classmethod
|
|
def from_row(cls, row: Row) -> "Addresses":
|
|
return cls(**dict(row))
|