Function decodeHdPublicKey

  • Decode an HD public key as defined by BIP32.

    This method is similar to decodeHdKey but ensures that the result is a valid HD public node. Decoding error messages are returned as strings.

    Parameters

    • hdPublicKey: string

      A BIP32 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 | DecodedHdKey<HdPublicNodeValid>

Generated using TypeDoc