|
|
@@ -13,7 +13,8 @@ def arg_parser(client):
|
|
|
parser.add_argument("-i", "--info", action='store_true', help="Request info from daemon")
|
|
|
parser.add_argument("-s", "--stop", action='store_true', help="Send a stop signal to the daemon")
|
|
|
parser.add_argument("-n", "--new", action='store_true', help="Generate a new wallet")
|
|
|
- parser.add_argument("-hi", "--hello", action='store_true', help="Say hello")
|
|
|
+ parser.add_argument("-o", "--hello", action='store_true', help="Say hello")
|
|
|
+ parser.add_argument("-c", "--cash", action='store_true', help="Create a new cashier wallet")
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
if args.key:
|
|
|
@@ -53,6 +54,13 @@ def arg_parser(client):
|
|
|
except Exception:
|
|
|
raise
|
|
|
|
|
|
+ if args.cash:
|
|
|
+ try:
|
|
|
+ print("Cash was entered")
|
|
|
+ client.new_cashier_wallet(client.payload)
|
|
|
+ except Exception:
|
|
|
+ raise
|
|
|
+
|
|
|
|
|
|
# TODO: refactor into async
|
|
|
class DarkClient:
|
|
|
@@ -102,6 +110,14 @@ class DarkClient:
|
|
|
wallet = self.__request(payload)
|
|
|
print(wallet)
|
|
|
|
|
|
+ def new_cashier_wallet(self, payload):
|
|
|
+ payload['method'] = "new_cashier_wallet"
|
|
|
+ payload['jsonrpc'] = "2.0"
|
|
|
+ payload['id'] = "0"
|
|
|
+ wallet = self.__request(payload)
|
|
|
+ print(wallet)
|
|
|
+
|
|
|
+
|
|
|
def __request(self, payload):
|
|
|
response = requests.post(self.url, json=payload).json()
|
|
|
# print something better
|