chore: clean-up rebase left overs
This commit is contained in:
parent
828e4a78d1
commit
6c332ce0c5
3 changed files with 2 additions and 35 deletions
|
|
@ -4,8 +4,8 @@ from typing import List, Optional
|
||||||
from lnbits.helpers import urlsafe_short_hash
|
from lnbits.helpers import urlsafe_short_hash
|
||||||
|
|
||||||
from . import db
|
from . import db
|
||||||
from .helpers import derive_address, parse_key
|
from .helpers import derive_address
|
||||||
from .models import Address, Config, Mempool, WalletAccount
|
from .models import Address, Config, WalletAccount
|
||||||
|
|
||||||
##########################WALLETS####################
|
##########################WALLETS####################
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,16 +27,6 @@ class WalletAccount(BaseModel):
|
||||||
return cls(**dict(row))
|
return cls(**dict(row))
|
||||||
|
|
||||||
|
|
||||||
### TODO: fix statspay dependcy and remove
|
|
||||||
class Mempool(BaseModel):
|
|
||||||
user: str
|
|
||||||
endpoint: str
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_row(cls, row: Row) -> "Mempool":
|
|
||||||
return cls(**dict(row))
|
|
||||||
|
|
||||||
|
|
||||||
class Address(BaseModel):
|
class Address(BaseModel):
|
||||||
id: str
|
id: str
|
||||||
address: str
|
address: str
|
||||||
|
|
|
||||||
|
|
@ -17,19 +17,16 @@ from lnbits.extensions.watchonly import watchonly_ext
|
||||||
from .crud import (
|
from .crud import (
|
||||||
create_config,
|
create_config,
|
||||||
create_fresh_addresses,
|
create_fresh_addresses,
|
||||||
create_mempool,
|
|
||||||
create_watch_wallet,
|
create_watch_wallet,
|
||||||
delete_addresses_for_wallet,
|
delete_addresses_for_wallet,
|
||||||
delete_watch_wallet,
|
delete_watch_wallet,
|
||||||
get_addresses,
|
get_addresses,
|
||||||
get_config,
|
get_config,
|
||||||
get_fresh_address,
|
get_fresh_address,
|
||||||
get_mempool,
|
|
||||||
get_watch_wallet,
|
get_watch_wallet,
|
||||||
get_watch_wallets,
|
get_watch_wallets,
|
||||||
update_address,
|
update_address,
|
||||||
update_config,
|
update_config,
|
||||||
update_mempool,
|
|
||||||
update_watch_wallet,
|
update_watch_wallet,
|
||||||
)
|
)
|
||||||
from .helpers import parse_key
|
from .helpers import parse_key
|
||||||
|
|
@ -372,23 +369,3 @@ async def api_get_config(w: WalletTypeInfo = Depends(get_key_type)):
|
||||||
if not config:
|
if not config:
|
||||||
config = await create_config(user=w.wallet.user)
|
config = await create_config(user=w.wallet.user)
|
||||||
return config.dict()
|
return config.dict()
|
||||||
|
|
||||||
|
|
||||||
#############################MEMPOOL##########################
|
|
||||||
|
|
||||||
### TODO: fix statspay dependcy and remove
|
|
||||||
@watchonly_ext.put("/api/v1/mempool")
|
|
||||||
async def api_update_mempool(
|
|
||||||
endpoint: str = Query(...), w: WalletTypeInfo = Depends(require_admin_key)
|
|
||||||
):
|
|
||||||
mempool = await update_mempool(**{"endpoint": endpoint}, user=w.wallet.user)
|
|
||||||
return mempool.dict()
|
|
||||||
|
|
||||||
|
|
||||||
### TODO: fix statspay dependcy and remove
|
|
||||||
@watchonly_ext.get("/api/v1/mempool")
|
|
||||||
async def api_get_mempool(w: WalletTypeInfo = Depends(require_admin_key)):
|
|
||||||
mempool = await get_mempool(w.wallet.user)
|
|
||||||
if not mempool:
|
|
||||||
mempool = await create_mempool(user=w.wallet.user)
|
|
||||||
return mempool.dict()
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue