add txid and tx hex

This commit is contained in:
Uthpala Heenatigala
2023-01-06 00:34:24 +01:00
parent 57d345c149
commit 810b3a1a84
4 changed files with 55 additions and 6 deletions
+15 -1
View File
@@ -5,7 +5,8 @@ from . import db
from .models import (
Token,
LnToBtcSwap,
BtcToLnSwap
BtcToLnSwap,
UpdateLnToBtcSwap
)
@@ -83,6 +84,19 @@ async def save_ln_to_btc(
)
async def update_ln_to_btc(data: UpdateLnToBtcSwap) -> str:
await db.execute(
"""
UPDATE deezy.ln_to_btc_swap
SET txid = ?, tx_hex = ?
WHERE bolt11_invoice = ?
""",
(data.txid, data.tx_hex, data.bolt11_invoice),
)
return data.txid
async def save_btc_to_ln(
data: BtcToLnSwap,
) -> BtcToLnSwap: