@@ -407,7 +407,7 @@ impl<E: Curve> DirtyKeyInfo<E> {
407
407
}
408
408
409
409
#[ cfg( feature = "hd-wallets" ) ]
410
- impl < E : Curve > DirtyCoreKeyShare < E > {
410
+ impl < E : Curve > DirtyKeyInfo < E > {
411
411
/// Checks whether the key is HD-capable
412
412
pub fn is_hd_wallet ( & self ) -> bool {
413
413
self . chain_code . is_some ( )
@@ -441,6 +441,33 @@ impl<E: Curve> DirtyCoreKeyShare<E> {
441
441
}
442
442
}
443
443
444
+ #[ cfg( feature = "hd-wallets" ) ]
445
+ impl < E : Curve > DirtyCoreKeyShare < E > {
446
+ /// Checks whether the key is HD-capable
447
+ pub fn is_hd_wallet ( & self ) -> bool {
448
+ ( * * self ) . is_hd_wallet ( )
449
+ }
450
+
451
+ /// Returns extended public key, if HD support was enabled
452
+ pub fn extended_public_key ( & self ) -> Option < slip_10:: ExtendedPublicKey < E > > {
453
+ ( * * self ) . extended_public_key ( )
454
+ }
455
+
456
+ /// Derives child public key, if it's HD key
457
+ pub fn derive_child_public_key < ChildIndex > (
458
+ & self ,
459
+ derivation_path : impl IntoIterator < Item = ChildIndex > ,
460
+ ) -> Result <
461
+ slip_10:: ExtendedPublicKey < E > ,
462
+ HdError < <ChildIndex as TryInto < slip_10:: NonHardenedIndex > >:: Error > ,
463
+ >
464
+ where
465
+ slip_10:: NonHardenedIndex : TryFrom < ChildIndex > ,
466
+ {
467
+ ( * * self ) . derive_child_public_key ( derivation_path)
468
+ }
469
+ }
470
+
444
471
impl < E : Curve > CoreKeyShare < E > {
445
472
/// Returns amount of key co-holders
446
473
pub fn n ( & self ) -> u16 {
0 commit comments