-
Notifications
You must be signed in to change notification settings - Fork 4
/
manual_payouts.py
44 lines (36 loc) · 1.1 KB
/
manual_payouts.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
BitShares.org StakeMachine
Hung Payment Handler
BitShares Management Group Co. Ltd.
"""
# STANDARD PYTHON MODULES
from getpass import getpass
# STAKE BTS MODULES
from config import CUSTODIAN
from stake_bitshares import payment_parent
from utilities import munix_nonce, sql_db
def main():
"""
Handle hung payments with status "processing" due to insufficient funds
"""
print("\033c")
# read from database gather list of payments due
query = (
"SELECT amount, nominator, start, number, type FROM stakes "
+ "WHERE (type='base_amount' OR type='reward') AND due<? "
+ "AND status='processing'"
)
values = (munix_nonce(),)
payments_due = sql_db(query, values)
print(payments_due)
choice = input("\ny + Enter to make these payments, or just Enter to abort\n")
if choice == "y":
keys = {
"custodian": CUSTODIAN,
"password": getpass(
f"\nInput Pybitshares Password for {CUSTODIAN} and press ENTER:\n"
),
}
payment_parent(payments_due, keys)
if __name__ == "__main__":
main()