From 1388ce8c4c2215ed029414d71833eab4b9bc8dc2 Mon Sep 17 00:00:00 2001 From: Nicholas Rodrigues Lordello Date: Sun, 22 Oct 2023 17:56:01 +0000 Subject: Add Support for Genereting Mnemonic for Vanity Address --- src/hdk/path.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/hdk/path.rs') 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 + '_ { self.components.iter().copied() } -- cgit v1.2.3