|
@@ -12,6 +12,7 @@ def arg_parser(client):
|
|
|
parser.add_argument("-k", "--key", action='store_true', help="Generate a new keypair")
|
|
parser.add_argument("-k", "--key", action='store_true', help="Generate a new keypair")
|
|
|
parser.add_argument("-i", "--info", action='store_true', help="Request info from daemon")
|
|
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("-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("-hi", "--hello", action='store_true', help="Say hello")
|
|
|
args = parser.parse_args()
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
@@ -22,6 +23,13 @@ def arg_parser(client):
|
|
|
except Exception:
|
|
except Exception:
|
|
|
raise
|
|
raise
|
|
|
|
|
|
|
|
|
|
+ if args.new:
|
|
|
|
|
+ try:
|
|
|
|
|
+ print("Attemping to generate a new wallet...")
|
|
|
|
|
+ client.new_wallet(client.payload)
|
|
|
|
|
+ except Exception:
|
|
|
|
|
+ raise
|
|
|
|
|
+
|
|
|
if args.info:
|
|
if args.info:
|
|
|
try:
|
|
try:
|
|
|
print("Info was entered")
|
|
print("Info was entered")
|
|
@@ -86,6 +94,13 @@ class DarkClient:
|
|
|
payload['id'] = "0"
|
|
payload['id'] = "0"
|
|
|
hello = self.__request(payload)
|
|
hello = self.__request(payload)
|
|
|
print(hello)
|
|
print(hello)
|
|
|
|
|
+
|
|
|
|
|
+ def new_wallet(self, payload):
|
|
|
|
|
+ payload['method'] = "new_wallet"
|
|
|
|
|
+ payload['jsonrpc'] = "2.0"
|
|
|
|
|
+ payload['id'] = "0"
|
|
|
|
|
+ wallet = self.__request(payload)
|
|
|
|
|
+ print(wallet)
|
|
|
|
|
|
|
|
def __request(self, payload):
|
|
def __request(self, payload):
|
|
|
response = requests.post(self.url, json=payload).json()
|
|
response = requests.post(self.url, json=payload).json()
|