#!/usr/bin/env pyston3 import argparse import os import logging import sys sys.path.insert(0, os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) import mango # nopep8 parser = argparse.ArgumentParser(description="Creates a new wallet and private key, and saves it to a file.") parser.add_argument("--id-file", type=str, default="id.json", help="file containing the JSON-formatted wallet private key") parser.add_argument("--overwrite", action="store_true", default=False, help="overwrite the ID file, if it exists (use with care!)") args = parser.parse_args() logging.getLogger().setLevel(args.log_level) logging.warning(mango.WARNING_DISCLAIMER_TEXT) new_wallet = mango.Wallet.create() new_wallet.save(args.id_file, args.overwrite) print(f"Wallet for address {new_wallet.address} created in file: '{args.id_file}'.")