@@ -21,8 +21,8 @@ async def create_tpos(wallet_id: str, data: CreateTposData) -> TPoS:
21
21
tpos_id = urlsafe_short_hash ()
22
22
await db .execute (
23
23
"""
24
- INSERT INTO tpos.pos (id, wallet, name, currency, tip_options, tip_wallet, withdrawlimit, withdrawpin, withdrawamt, withdrawtime, withdrawbtwn)
25
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
24
+ INSERT INTO tpos.pos (id, wallet, name, currency, tip_options, tip_wallet, withdrawlimit, withdrawpin, withdrawamt, withdrawtime, withdrawbtwn, withdrawtimeopt, withdrawpindisabled )
25
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
26
26
""" ,
27
27
(
28
28
tpos_id ,
@@ -36,6 +36,8 @@ async def create_tpos(wallet_id: str, data: CreateTposData) -> TPoS:
36
36
0 ,
37
37
0 ,
38
38
data .withdrawbtwn ,
39
+ data .withdrawtimeopt ,
40
+ data .withdrawpindisabled ,
39
41
),
40
42
)
41
43
tpos = await get_tpos (tpos_id )
@@ -53,7 +55,9 @@ async def start_lnurlcharge(tpos_id: str):
53
55
assert tpos , f"TPoS with { tpos_id } not found!"
54
56
55
57
now = await get_current_timestamp ()
56
- withdraw_time_seconds = tpos .withdrawbtwn * 60
58
+ withdraw_time_seconds = (
59
+ tpos .withdrawbtwn * 60 if tpos .withdrawtimeopt != "secs" else tpos .withdrawbtwn
60
+ )
57
61
assert (
58
62
now - tpos .withdrawtime > withdraw_time_seconds
59
63
), f"Last withdraw was made too recently, please try again in { int (withdraw_time_seconds - (now - tpos .withdrawtime ))} secs"
@@ -105,7 +109,9 @@ async def update_tpos_withdraw(data: TPoS, tpos_id: str) -> TPoS:
105
109
# Calculate the time between withdrawals in seconds
106
110
now = await get_current_timestamp ()
107
111
time_elapsed = now - data .withdrawtime
108
- withdraw_time_seconds = data .withdrawbtwn * 60
112
+ withdraw_time_seconds = (
113
+ data .withdrawbtwn * 60 if data .withdrawtimeopt != "secs" else data .withdrawbtwn
114
+ )
109
115
110
116
logger .debug (f"Time between: { time_elapsed } seconds" )
111
117
0 commit comments