diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2023-10-22 17:56:01 +0000 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2023-10-22 17:56:01 +0000 |
| commit | 1388ce8c4c2215ed029414d71833eab4b9bc8dc2 (patch) | |
| tree | 93bbd822db9f7ddcf548f65e23fdbdf39db4d136 /src/hdk/path.rs | |
| parent | ca758736f76d9c32d7e5df44e270bf2879a1b86c (diff) | |
Add Support for Genereting Mnemonic for Vanity Address
Diffstat (limited to 'src/hdk/path.rs')
| -rw-r--r-- | src/hdk/path.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/hdk/path.rs b/src/hdk/path.rs index 0d05110..333381c 100644 --- a/src/hdk/path.rs +++ b/src/hdk/path.rs @@ -13,7 +13,12 @@ pub struct Path { } impl Path { - /// Returns an iterator + /// Creates the default Ethereum HD path for the specified account index. + pub fn for_index(index: usize) -> Self { + format!("m/44'/60'/0'/0/{index}").parse().unwrap() + } + + /// Returns an iterator over the path components. pub fn components(&self) -> impl Iterator<Item = Component> + '_ { self.components.iter().copied() } |
