mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-20 10:39:59 +01:00
Still have broken watchonly, but addresses added
This commit is contained in:
parent
da20588c84
commit
81326b2368
@ -2,7 +2,7 @@ from typing import List, Optional, Union
|
||||
|
||||
#from lnbits.db import open_ext_db
|
||||
from . import db
|
||||
from .models import Wallets, Charges, Mempool
|
||||
from .models import Wallets, Addresses, Mempool
|
||||
|
||||
from lnbits.helpers import urlsafe_short_hash
|
||||
|
||||
|
@ -17,19 +17,14 @@ async def m001_initial(db):
|
||||
|
||||
await db.execute(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS charges (
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
user TEXT,
|
||||
title TEXT,
|
||||
CREATE TABLE IF NOT EXISTS addresses (
|
||||
address TEXT NOT NULL PRIMARY KEY,
|
||||
wallet TEXT NOT NULL,
|
||||
address TEXT NOT NULL,
|
||||
time_to_pay INTEGER,
|
||||
amount INTEGER,
|
||||
balance INTEGER DEFAULT 0,
|
||||
time TIMESTAMP NOT NULL DEFAULT (strftime('%s', 'now'))
|
||||
amount INTEGER NOT NULL
|
||||
);
|
||||
"""
|
||||
)
|
||||
|
||||
await db.execute(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS mempool (
|
||||
|
@ -13,25 +13,19 @@ class Wallets(NamedTuple):
|
||||
def from_row(cls, row: Row) -> "Wallets":
|
||||
return cls(**dict(row))
|
||||
|
||||
class Charges(NamedTuple):
|
||||
id: str
|
||||
user: str
|
||||
wallet: str
|
||||
title: str
|
||||
address: str
|
||||
time_to_pay: str
|
||||
amount: int
|
||||
balance: int
|
||||
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))
|
||||
|
||||
class Addresses(NamedTuple):
|
||||
address: str
|
||||
wallet: str
|
||||
amount: int
|
||||
|
||||
@classmethod
|
||||
def from_row(cls, row: Row) -> "Addresses":
|
||||
return cls(**dict(row))
|
@ -14,10 +14,8 @@ from .crud import (
|
||||
get_watch_wallets,
|
||||
update_watch_wallet,
|
||||
delete_watch_wallet,
|
||||
create_charge,
|
||||
get_charge,
|
||||
get_charges,
|
||||
delete_charge,
|
||||
get_fresh_address,
|
||||
get_addresses,
|
||||
create_mempool,
|
||||
update_mempool,
|
||||
get_mempool,
|
||||
|
Loading…
Reference in New Issue
Block a user