Function decodeHdKeyUnchecked

  • Decode a string following the HD key format as defined by BIP32, returning a node and a version. Decoding errors are returned as strings.

    This is a less strict variant of decodeHdKey; most applications should instead use decodeHdKey, or if the type of the key is known, either decodeHdPrivateKey or decodeHdPublicKey.

    Parameters

    • hdKey: string

      A BIP32 HD private key or HD public key.

    • __namedParameters: {
          crypto?: {
              secp256k1: {
                  validatePublicKey: ((publicKey) => boolean);
              };
              sha256: {
                  hash: ((input) => Uint8Array) & ((input) => Uint8Array);
              };
          };
      } = {}
      • Optional crypto?: {
            secp256k1: {
                validatePublicKey: ((publicKey) => boolean);
            };
            sha256: {
                hash: ((input) => Uint8Array) & ((input) => Uint8Array);
            };
        }

        An optional object containing an implementation of sha256 and a Secp256k1 validatePublicKey to use.

        • secp256k1: {
              validatePublicKey: ((publicKey) => boolean);
          }
          • validatePublicKey: ((publicKey) => boolean)
              • (publicKey): boolean
              • Parameters

                • publicKey: Uint8Array

                Returns boolean

        • sha256: {
              hash: ((input) => Uint8Array) & ((input) => Uint8Array);
          }
          • hash: ((input) => Uint8Array) & ((input) => Uint8Array)

    Returns string | {
        node: HdPrivateNodeValid | HdPrivateNodeInvalid;
        version: number;
    } | {
        node: HdPublicNodeValid | HdPublicNodeInvalid;
        version: number;
    }

Generated using TypeDoc