mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-24 14:51:05 +01:00
22 lines
No EOL
439 B
Python
22 lines
No EOL
439 B
Python
from sqlite3 import Row
|
|
from typing import NamedTuple
|
|
|
|
class Charges(NamedTuple):
|
|
id: str
|
|
user: str
|
|
description: str
|
|
onchainwallet: str
|
|
onchainaddress: str
|
|
lnbitswallet: str
|
|
payment_request: str
|
|
payment_hash: str
|
|
webhook: str
|
|
time: str
|
|
amount: int
|
|
balance: int
|
|
paid: bool
|
|
timestamp: int
|
|
|
|
@classmethod
|
|
def from_row(cls, row: Row) -> "Payments":
|
|
return cls(**dict(row)) |