diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2022-01-09 20:48:49 +0100 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2022-01-09 20:48:49 +0100 |
| commit | 7988f75774317d3ab0fdc513df12ccc77ef0d315 (patch) | |
| tree | ddfe932803cde7289d553b46691455d491dfe1ae /src/cmd.rs | |
| parent | a51adad4672c443ebeb6c427ab37ba6c5694ecd8 (diff) | |
expose derive_index
Diffstat (limited to 'src/cmd.rs')
| -rw-r--r-- | src/cmd.rs | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -44,11 +44,10 @@ impl AccountOptions { /// Returns the private key for the specified account options. pub fn private_key(&self) -> Result<PrivateKey> { let seed = self.mnemonic.seed(&self.password); - let path = match &self.hd_path { - None => format!("m/44'/60'/0'/0/{}", self.account_index).parse(), - Some(hd_path) => hd_path.parse(), - }?; - hdk::derive(seed, &path) + match &self.hd_path { + None => hdk::derive_index(seed, self.account_index), + Some(hd_path) => hdk::derive(seed, &hd_path.parse()?), + } } } |
