forked from lnbits/myextension
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
27 lines (25 loc) · 1.12 KB
/
Copy pathutils.py
File metadata and controls
27 lines (25 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from lnbits.extensions.withdraw.crud import get_withdraw_link
async def get_withdraw_link_info(withdraw_id: str):
try:
withdraw_link = await get_withdraw_link(withdraw_id)
if withdraw_link:
return {
"id": withdraw_link.id,
"title": withdraw_link.title,
"min_withdrawable": withdraw_link.min_withdrawable,
"max_withdrawable": withdraw_link.max_withdrawable,
"uses": withdraw_link.uses,
"wait_time": withdraw_link.wait_time,
"is_unique": withdraw_link.is_unique,
"unique_hash": withdraw_link.unique_hash,
"k1": withdraw_link.k1,
"open_time": withdraw_link.open_time,
"used": withdraw_link.used,
"usescsv": withdraw_link.usescsv,
"webhook_url": withdraw_link.webhook_url,
"custom_url": withdraw_link.custom_url
}
else:
return {"error": "Withdraw link not found"}
except Exception as e:
return {"error": f"Error fetching withdraw link: {str(e)}"}