function isCanonicalScriptSignature(buffer) {
  if (!(buffer instanceof Uint8Array)) return false;
  if (!isDefinedHashType(buffer[buffer.length - 1])) return false;
  return bip66.check(buffer.slice(0, -1));
}
Checks if the provided buffer is a canonical script signature.

A canonical script signature is a valid DER-encoded signature followed by a valid hash type byte.

@param buffer - The buffer to check.
@returns `true` if the buffer is a canonical script signature, `false` otherwise.