Beispiel #1
0
    """
    wallet = Wallet(wallet_path=ctx.obj.wallet_path)
    _print_addresses(ctx, wallet.address_items, ctx.obj.wallet_dir)


@qrl.command(name='wallet_gen')
@click.pass_context
@click.option(
    '--height',
    default=config.dev.xmss_tree_height,
    help=
    'XMSS tree height. The resulting tree will be good for 2^height signatures'
)
@click.option(
    '--hash_function',
    type=click.Choice(list(hash_functions.keys())),
    default='shake128',
    help='Hash function used to build the XMSS tree [default=shake128]')
@click.option('--encrypt',
              default=False,
              is_flag=True,
              help='Encrypts important fields with AES')
def wallet_gen(ctx, height, hash_function, encrypt):
    """
    Generates a new wallet with one address
    """
    wallet = Wallet(wallet_path=ctx.obj.wallet_path)
    if len(wallet.address_items) > 0:
        click.echo("Wallet already exists")
        return
Beispiel #2
0
@qrl.command()
@click.pass_context
def wallet_ls(ctx):
    """
    Lists available wallets
    """
    wallet = Wallet(wallet_path=ctx.obj.wallet_path)
    _print_addresses(ctx, wallet.address_items, ctx.obj.wallet_dir)


@qrl.command()
@click.pass_context
@click.option('--height', default=config.dev.xmss_tree_height,
              help='XMSS tree height. The resulting tree will be good for 2^height signatures')
@click.option('--hash_function', type=click.Choice(list(hash_functions.keys())), default='shake128',
              help='Hash function used to build the XMSS tree [default=shake128]')
@click.option('--encrypt', default=False, is_flag=True, help='Encrypts important fields with AES')
def wallet_gen(ctx, height, hash_function, encrypt):
    """
    Generates a new wallet with one address
    """
    wallet = Wallet(wallet_path=ctx.obj.wallet_path)
    if len(wallet.address_items) > 0:
        click.echo("Wallet already exists")
        return

    wallet.add_new_address(height, hash_function)

    _print_addresses(ctx, wallet.address_items, config.user.wallet_dir)