@main.command()<EOL>@click.pass_context<EOL>@onlineChain<EOL>@click.argument("<STR_LIT:key>", nargs=-<NUM_LIT:1>)<EOL>@unlockWallet<EOL>def addkey(ctx, key):
if not key:<EOL><INDENT>while True:<EOL><INDENT>key = click.prompt(<EOL>"<STR_LIT>",<EOL>hide_input=True,<EOL>show_default=False,<EOL>default="<STR_LIT>",<EOL>)<EOL>if not key or key == "<STR_LIT>":<EOL><INDENT>break<EOL><DEDENT>try:<EOL><INDENT>ctx.peerplays.wallet.addPrivateKey(key)<EOL><DEDENT>except Exception as e:<EOL><INDENT>click.echo(str(e))<EOL>continue<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for k in key:<EOL><INDENT>try:<EOL><INDENT>ctx.peerplays.wallet.addPrivateKey(k)<EOL><DEDENT>except Exception as e:<EOL><INDENT>click.echo(str(e))<EOL><DEDENT><DEDENT><DEDENT>installedKeys = ctx.peerplays.wallet.getPublicKeys()<EOL>if len(installedKeys) == <NUM_LIT:1>:<EOL><INDENT>name = ctx.peerplays.wallet.getAccountFromPublicKey(installedKeys[<NUM_LIT:0>])<EOL>if name:  <EOL><INDENT>account = Account(name, peerplays_instance=ctx.peerplays)<EOL>click.echo("<STR_LIT:=>" * <NUM_LIT:30>)<EOL>click.echo("<STR_LIT>" % account["<STR_LIT:name>"])<EOL>click.echo()<EOL>click.echo("<STR_LIT>")<EOL>click.echo("<STR_LIT>")<EOL>click.echo("<STR_LIT:=>" * <NUM_LIT:30>)<EOL>ctx.blockchain.config["<STR_LIT>"] = account["<STR_LIT:name>"]<EOL><DEDENT><DEDENT>
Add a private key to the wallet