Function encodeHdPrivateKey
- encode
Hd Private Key<ThrowErrors>(keyParameters, __namedParameters?): ThrowErrors extends true
? HdPrivateKeyEncodeResult
: string | HdPrivateKeyEncodeResult Type Parameters
Parameters
keyParameters: DecodedHdKey<HdPrivateNodeValid>
A valid HD private node and the network for which to encode the key.
__namedParameters: {
crypto?: {
sha256: {
hash: ((input) => Uint8Array) & ((input) => Uint8Array);
};
};
throwErrors?: ThrowErrors;
} = {}Optionalcrypto?: {
sha256: {
hash: ((input) => Uint8Array) & ((input) => Uint8Array);
};
}An optional object containing an implementation of sha256 to use.
sha256: {
hash: ((input) => Uint8Array) & ((input) => Uint8Array);
}hash: ((input) => Uint8Array) & ((input) => Uint8Array)
OptionalthrowErrors?: ThrowErrors If
true, this function will throw anErrorwhen the provided HD node has adepthexceeding the maximum depth that can be encoded using the BIP32 serialization format rather than returning the error as a string (defaults totrue).
Returns ThrowErrors extends true
? HdPrivateKeyEncodeResult
: string | HdPrivateKeyEncodeResult
Generated using TypeDoc

Encode an HD private key (as defined by BIP32) given a valid HdPrivateNode and network.
Note that this function defaults to throwing encoding errors. To handle errors in a type-safe way, set
throwErrorstofalse.