Merge pull request #1116 from lnbits/add/add_tpos_last_tx_list

Add the ability to check for last (5) transactions
This commit is contained in:
Vlad Stan
2022-11-18 13:13:55 +02:00
committed by GitHub
3 changed files with 106 additions and 1 deletions
+18
View File
@@ -229,6 +229,24 @@ async def get_wallet_payment(
return Payment.from_row(row) if row else None
async def get_latest_payments_by_extension(ext_name: str, ext_id: str, limit: int = 5):
rows = await db.fetchall(
f"""
SELECT * FROM apipayments
WHERE pending = 'false'
AND extra LIKE ?
AND extra LIKE ?
ORDER BY time DESC LIMIT {limit}
""",
(
f"%{ext_name}%",
f"%{ext_id}%",
),
)
return rows
async def get_payments(
*,
wallet_id: Optional[str] = None,