1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use std::str::FromStr;

/// Generate a key pair of private and public keys (use it anywhere you need
/// Ed25519 keys)
#[derive(Debug, Clone, clap::Parser)]
pub struct CliGenerateKeypair {
    #[clap(long)]
    pub master_seed_phrase: Option<String>,
    #[clap(long, default_value = "12")]
    pub new_master_seed_phrase_words_count: usize,
    #[clap(long, default_value = "m/44'/397'/0'")]
    pub seed_phrase_hd_path: crate::types::slip10::BIP32Path,
    #[clap(long, default_value = "plaintext")]
    pub format: crate::common::OutputFormat,
}

impl Default for CliGenerateKeypair {
    fn default() -> Self {
        Self {
            master_seed_phrase: None,
            new_master_seed_phrase_words_count: 12,
            seed_phrase_hd_path: crate::types::slip10::BIP32Path::from_str("m/44'/397'/0'")
                .unwrap(),
            format: crate::common::OutputFormat::Json,
        }
    }
}