This repository has been archived on 2020-12-03. You can view files and clone it, but cannot push or open issues or pull requests.
2020-11-13 20:18:16 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2020-11-17 03:11:07 +01:00
|
|
|
import sys
|
|
|
|
sys.path.insert(1, 'libs')
|
|
|
|
from paylib import *
|
2020-11-15 09:12:37 +01:00
|
|
|
|
2020-11-17 03:11:07 +01:00
|
|
|
# Get args
|
2020-11-14 18:47:42 +01:00
|
|
|
try:
|
2020-11-15 09:12:37 +01:00
|
|
|
recipient = sys.argv[1]
|
|
|
|
amount = int(sys.argv[2])
|
|
|
|
if len(sys.argv) > 3:
|
|
|
|
comment = sys.argv[3]
|
|
|
|
else:
|
|
|
|
comment = ""
|
2020-11-17 03:11:07 +01:00
|
|
|
except Exception as e:
|
|
|
|
print(str(e))
|
|
|
|
sys.exit(1)
|
2020-11-15 09:12:37 +01:00
|
|
|
|
|
|
|
# Execute workflow
|
2020-11-17 03:11:07 +01:00
|
|
|
## Generate TX document from server and check it
|
|
|
|
returnGen = sendGenDoc(recipient, amount, comment)
|
|
|
|
docIsOK = checkTXDoc(returnGen, recipient, amount, comment)
|
|
|
|
|
|
|
|
# Confirm TX document is ok, sign and send it
|
|
|
|
if docIsOK:
|
|
|
|
returnSigned = signDoc(returnGen)
|
|
|
|
sendTXDoc(returnSigned)
|
2020-11-13 20:18:16 +01:00
|
|
|
|