-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend_money.py
54 lines (42 loc) · 1.29 KB
/
send_money.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
45
46
47
48
49
50
51
52
53
54
import logging # This module is thread safe.
import csv
import config
"""
import time, os, sys
from datetime import date, timedelta
import steem
import ast
import random
"""
def list_load(listfile: object) -> object:
with open(listfile, 'r') as readstuff:
listvar = []
reader = csv.reader(readstuff)
for rows in reader:
v = rows[0]
listvar.append(v)
return listvar
# TODO:
def send_cash(amount):
if config.CURRENCY == "STEEM":
stat = config.STEEM_INSTANCE.transfer(config.to_ACCOUNT, amount, "STEEM", memo="mb", account=config.frm_ACCOUNT)
if config.CURRENCY == "SBD":
stat = config.STEEM_INSTANCE.transfer(config.to_ACCOUNT, amount, "SBD", memo="mb", account=config.frm_ACCOUNT)
return stat
if __name__ == '__main__':
stat = "ERR0R1"
while True:
try:
stat = send_cash(config.amount)
except TypeError as te:
stat = te.args[0]
if te.args[0] == "'NoneType' object is not iterable":
pass
except Exception as e:
logging.error(repr(e))
if stat != "ERR0R1":
logging.info(stat)
if stat['operations']:
break
if stat == "ERR0R1":
logging.error(stat)