lnbits-legend/lnbits/extensions/watchonly/models.py

37 lines
705 B
Python
Raw Normal View History

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
balance: int
2020-12-01 19:54:16 +00:00
@classmethod
def from_row(cls, row: Row) -> "Wallets":
return cls(**dict(row))
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
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))