hdkeychain: expose extended key's version and child index
This commit is contained in:
parent
b2bf7f89d6
commit
d8c8794021
1 changed files with 11 additions and 0 deletions
|
@ -179,6 +179,12 @@ func (k *ExtendedKey) Depth() uint8 {
|
||||||
return k.depth
|
return k.depth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Version returns the extended key's hardened derivation version. This can be
|
||||||
|
// used to identify the extended key's type.
|
||||||
|
func (k *ExtendedKey) Version() []byte {
|
||||||
|
return k.version
|
||||||
|
}
|
||||||
|
|
||||||
// ParentFingerprint returns a fingerprint of the parent extended key from which
|
// ParentFingerprint returns a fingerprint of the parent extended key from which
|
||||||
// this one was derived.
|
// this one was derived.
|
||||||
func (k *ExtendedKey) ParentFingerprint() uint32 {
|
func (k *ExtendedKey) ParentFingerprint() uint32 {
|
||||||
|
@ -329,6 +335,11 @@ func (k *ExtendedKey) Child(i uint32) (*ExtendedKey, error) {
|
||||||
k.depth+1, i, isPrivate), nil
|
k.depth+1, i, isPrivate), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ChildIndex returns the child index used to derive the extended key.
|
||||||
|
func (k *ExtendedKey) ChildIndex() uint32 {
|
||||||
|
return k.childNum
|
||||||
|
}
|
||||||
|
|
||||||
// Neuter returns a new extended public key from this extended private key. The
|
// Neuter returns a new extended public key from this extended private key. The
|
||||||
// same extended key will be returned unaltered if it is already an extended
|
// same extended key will be returned unaltered if it is already an extended
|
||||||
// public key.
|
// public key.
|
||||||
|
|
Loading…
Reference in a new issue