From 5cda49f996dded1569d39f79d02fa91f053d619c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sat, 23 Nov 2024 11:19:36 +0100 Subject: [PATCH] Add derive_extended_private_key to DirectSecp256k1HdWallet (#5167) --- .../validator-client/src/signing/direct_wallet.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/client-libs/validator-client/src/signing/direct_wallet.rs b/common/client-libs/validator-client/src/signing/direct_wallet.rs index daeb4bc447..12af8b485f 100644 --- a/common/client-libs/validator-client/src/signing/direct_wallet.rs +++ b/common/client-libs/validator-client/src/signing/direct_wallet.rs @@ -98,6 +98,13 @@ impl DirectSecp256k1HdWallet { Ok((private_key, public_key)) } + pub fn derive_extended_private_key( + &self, + hd_path: &DerivationPath, + ) -> Result { + Ok(XPrv::derive_from_path(self.seed, hd_path)?) + } + pub fn try_derive_accounts(&self) -> Result, DirectSecp256k1HdWalletError> { let mut accounts = Vec::with_capacity(self.accounts.len()); for derivation_info in &self.accounts {