mirror of
https://gitlab.com/pulsechaincom/staking-deposit-cli.git
synced 2025-01-10 13:01:22 +00:00
35 lines
740 B
Python
35 lines
740 B
Python
|
import click
|
||
|
from typing import (
|
||
|
Tuple,
|
||
|
)
|
||
|
|
||
|
from key_handling.key_derivation.mnemonic import (
|
||
|
verify_mnemonic,
|
||
|
)
|
||
|
from utils.constants import (
|
||
|
WORD_LISTS_PATH,
|
||
|
)
|
||
|
|
||
|
|
||
|
def validate_mnemonic(mnemonic: str) -> str:
|
||
|
if verify_mnemonic(mnemonic, WORD_LISTS_PATH):
|
||
|
return mnemonic
|
||
|
else:
|
||
|
raise click.BadParameter('That is not a valid mnemonic in any language.')
|
||
|
|
||
|
|
||
|
@click.command()
|
||
|
@click.option(
|
||
|
'--mnemonic',
|
||
|
prompt='Please enter your mnemonic separated by spaces (" ").',
|
||
|
required=True,
|
||
|
type=str,
|
||
|
)
|
||
|
@click.option(
|
||
|
'--mnemonic-password',
|
||
|
type=str,
|
||
|
defualt='',
|
||
|
)
|
||
|
def existing_mnemonic(mnemonic: str, mnemonic_password: str) -> Tuple[str, str]:
|
||
|
return (mnemonic, mnemonic_password)
|