Function publicKeyToP2pkhLockingBytecode

  • Derive the P2PKH locking bytecode of the provided public key.

    Note that this function defaults to throwing an error if provided with an invalid public key. To handle errors in a type-safe way, set throwErrors to false.

    To derive the resulting CashAddress, use publicKeyToP2pkhCashAddress. For HD public keys, use hdPublicKeyToP2pkhLockingBytecode. For the private key equivalent, see privateKeyToP2pkhLockingBytecode.

    Type Parameters

    • ThrowErrors extends boolean = true

    Parameters

    • __namedParameters: {
          publicKey: Uint8Array;
          throwErrors?: ThrowErrors;
      }
      • publicKey: Uint8Array

        The public key from which to derive the P2PKH locking bytecode.

      • Optional throwErrors?: ThrowErrors

        If true, this function will throw an Error if the provided publicKey is invalid rather than returning the error as a string (defaults to true).

    Returns ThrowErrors extends true
        ? Uint8Array
        : string | Uint8Array

Generated using TypeDoc