mypy
This commit is contained in:
parent
ef456c66d7
commit
7f1a08e16a
2 changed files with 10 additions and 8 deletions
|
|
@ -23,7 +23,7 @@ async def get_btc_to_ln() -> List[BtcToLnSwap]:
|
||||||
return [BtcToLnSwap(**row) for row in rows]
|
return [BtcToLnSwap(**row) for row in rows]
|
||||||
|
|
||||||
|
|
||||||
async def get_token() -> Token:
|
async def get_token() -> Optional[Token]:
|
||||||
|
|
||||||
row = await db.fetchone(
|
row = await db.fetchone(
|
||||||
f"SELECT * FROM deezy.token ORDER BY created_at DESC",
|
f"SELECT * FROM deezy.token ORDER BY created_at DESC",
|
||||||
|
|
@ -75,6 +75,7 @@ async def save_ln_to_btc(
|
||||||
data.tx_hex,
|
data.tx_hex,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
async def update_ln_to_btc(data: UpdateLnToBtcSwap) -> str:
|
async def update_ln_to_btc(data: UpdateLnToBtcSwap) -> str:
|
||||||
|
|
@ -113,3 +114,4 @@ async def save_btc_to_ln(
|
||||||
data.signature,
|
data.signature,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
return
|
||||||
|
|
|
||||||
|
|
@ -20,46 +20,46 @@ from .models import BtcToLnSwap, LnToBtcSwap, Token, UpdateLnToBtcSwap
|
||||||
|
|
||||||
|
|
||||||
@deezy_ext.get("/api/v1/token")
|
@deezy_ext.get("/api/v1/token")
|
||||||
async def api_deezy():
|
async def api_deezy_get_token():
|
||||||
rows = await get_token()
|
rows = await get_token()
|
||||||
return rows
|
return rows
|
||||||
|
|
||||||
|
|
||||||
@deezy_ext.get("/api/v1/ln-to-btc")
|
@deezy_ext.get("/api/v1/ln-to-btc")
|
||||||
async def api_deezy():
|
async def api_deezy_get_ln_to_btc():
|
||||||
rows = await get_ln_to_btc()
|
rows = await get_ln_to_btc()
|
||||||
return rows
|
return rows
|
||||||
|
|
||||||
|
|
||||||
@deezy_ext.get("/api/v1/btc-to-ln")
|
@deezy_ext.get("/api/v1/btc-to-ln")
|
||||||
async def api_deezy():
|
async def api_deezy_get_btc_to_ln():
|
||||||
rows = await get_btc_to_ln()
|
rows = await get_btc_to_ln()
|
||||||
return rows
|
return rows
|
||||||
|
|
||||||
|
|
||||||
@deezy_ext.post("/api/v1/store-token")
|
@deezy_ext.post("/api/v1/store-token")
|
||||||
async def api_deezy(data: Token):
|
async def api_deezy_save_toke(data: Token):
|
||||||
await save_token(data)
|
await save_token(data)
|
||||||
|
|
||||||
return data.deezy_token
|
return data.deezy_token
|
||||||
|
|
||||||
|
|
||||||
@deezy_ext.post("/api/v1/store-ln-to-btc")
|
@deezy_ext.post("/api/v1/store-ln-to-btc")
|
||||||
async def api_deezy(data: LnToBtcSwap):
|
async def api_deezy_save_ln_to_btc(data: LnToBtcSwap):
|
||||||
response = await save_ln_to_btc(data)
|
response = await save_ln_to_btc(data)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
@deezy_ext.post("/api/v1/update-ln-to-btc")
|
@deezy_ext.post("/api/v1/update-ln-to-btc")
|
||||||
async def api_deezy(data: UpdateLnToBtcSwap):
|
async def api_deezy_update_ln_to_btc(data: UpdateLnToBtcSwap):
|
||||||
response = await update_ln_to_btc(data)
|
response = await update_ln_to_btc(data)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
@deezy_ext.post("/api/v1/store-btc-to-ln")
|
@deezy_ext.post("/api/v1/store-btc-to-ln")
|
||||||
async def api_deezy(data: BtcToLnSwap):
|
async def api_deezy_save_btc_to_ln(data: BtcToLnSwap):
|
||||||
response = await save_btc_to_ln(data)
|
response = await save_btc_to_ln(data)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue