'Import a private key.'

@command('wp')
def importprivkey(self, privkey, password=None):

    if (not self.wallet.can_import_privkey()):
        return 'Error:    This    type    of    wallet    cannot    import    private    keys.    Try    to    create    a    new    wallet    with    that    key.'
    try:
        addr = self.wallet.import_key(privkey, password)
        out = ('Keypair    imported:    ' + addr)
    except BaseException as e:
        out = ('Error:    ' + str(e))
    return out
