UNPKG

libnexa-ts

Version:

A pure and powerful Nexa SDK library.

50 lines 2.13 kB
import { Networkish } from '../common/types'; export default class HDKeyUtils { static readonly Hardened = 2147483648; static readonly MaxIndex: number; static readonly RootElementAlias: string[]; static readonly VersionSize = 4; static readonly DepthSize = 1; static readonly ParentFingerPrintSize = 4; static readonly ChildIndexSize = 4; static readonly ChainCodeSize = 32; static readonly CheckSumSize = 4; static readonly DataSize = 78; static readonly SerializedByteSize = 82; static readonly VersionStart = 0; static readonly VersionEnd: number; static readonly DepthStart: number; static readonly DepthEnd: number; static readonly ParentFingerPrintStart: number; static readonly ParentFingerPrintEnd: number; static readonly ChildIndexStart: number; static readonly ChildIndexEnd: number; static readonly ChainCodeStart: number; static readonly ChainCodeEnd: number; /** * Util function that splits a string path into a derivation index array. * It will return null if the string path is malformed. * It does not validate if indexes are in bounds. * * @param path */ static getDerivationIndexes(path: string): number[] | null; private static _validateNetwork; /** * Verifies that a given serialized hd key in base58 with checksum format * is valid. * * @param data - the serialized hd key * @param network - optional, if present, checks that the network provided matches the network serialized. */ static isValidSerialized(data: Uint8Array | string, network?: Networkish, isPrivate?: boolean): boolean; /** * Checks what's the error that causes the validation of a serialized public key * in base58 with checksum to fail. * * @param data - the serialized hd key * @param network - optional, if present, checks that the network provided matches the network serialized. */ static getSerializedError(data: string | Uint8Array, network?: Networkish, isPrivate?: boolean): Error | null; } //# sourceMappingURL=hdkey.utils.d.ts.map