2020-12-01 19:54:16 +00:00
|
|
|
from sqlite3 import Row
|
|
|
|
from typing import NamedTuple
|
|
|
|
|
|
|
|
class Wallets(NamedTuple):
|
|
|
|
id: str
|
|
|
|
user: str
|
|
|
|
masterpub: str
|
|
|
|
title: str
|
|
|
|
address_no: int
|
2020-12-04 09:59:42 +00:00
|
|
|
balance: int
|
2020-12-01 19:54:16 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def from_row(cls, row: Row) -> "Wallets":
|
|
|
|
return cls(**dict(row))
|
|
|
|
|
2020-12-04 09:59:42 +00:00
|
|
|
class Charges(NamedTuple):
|
2020-12-01 19:54:16 +00:00
|
|
|
id: str
|
|
|
|
user: str
|
2020-12-03 17:26:11 +00:00
|
|
|
wallet: str
|
|
|
|
title: str
|
2020-12-01 19:54:16 +00:00
|
|
|
address: str
|
|
|
|
time_to_pay: str
|
|
|
|
amount: int
|
2020-12-04 09:59:42 +00:00
|
|
|
balance: int
|
2020-12-01 19:54:16 +00:00
|
|
|
time: int
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def from_row(cls, row: Row) -> "Payments":
|
|
|
|
return cls(**dict(row))
|
|
|
|
|
|
|
|
class Mempool(NamedTuple):
|
|
|
|
user: str
|
|
|
|
endpoint: str
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def from_row(cls, row: Row) -> "Mempool":
|
|
|
|
return cls(**dict(row))
|