/** * Checks if the given hash type is a defined Bitcoin signature hash type. * @param hashType - The hash type to check (e.g. SIGHASH_ALL, SIGHASH_NONE) * @returns True if the hash type is valid (between 0x01 and 0x03, ignoring SIGHASH_ANYONECANPAY flag) */ export declare function isDefinedHashType(hashType: number): boolean; /** * Converts a buffer to a DER-encoded buffer. * @param x - The buffer to be converted. * @returns The DER-encoded buffer. */ export declare function toDER(x: Uint8Array): Uint8Array; /** * Converts a DER-encoded signature to a buffer. * If the first byte of the input buffer is 0x00, it is skipped. * The resulting buffer is 32 bytes long, filled with zeros if necessary. * @param x - The DER-encoded signature. * @returns The converted buffer. */ export declare function fromDER(x: Uint8Array): Uint8Array; /** * Represents a script signature consisting of a signature and hash type. * @property signature - The signature bytes * @property hashType - The hash type used for signing */ export interface ScriptSignature { signature: Uint8Array; hashType: number; } /** * Decodes a buffer into a ScriptSignature object. * @param buffer - The buffer to decode. * @returns The decoded ScriptSignature object. * @throws Error if the hashType is invalid. */ export declare function decode(buffer: Uint8Array, strict?: boolean): ScriptSignature; /** * Encodes a signature and hash type into a buffer. * @param signature - The signature to encode. * @param hashType - The hash type to encode. * @returns The encoded buffer. * @throws Error if the hashType is invalid. */ export declare function encode(signature: Uint8Array, hashType: number): Uint8Array; /** * This function is translated from bitcoind's IsDERSignature and is used in * the script interpreter. This "DER" format actually includes an extra byte, * the nhashtype, at the end. It is really the tx format, not DER format. * * A canonical signature exists of: [30] [total len] [02] [len R] [R] [02] [len S] [S] [hashtype] * Where R and S are not negative (their first byte has its highest bit not set), and not * excessively padded (do not start with a 0 byte, unless an otherwise negative number follows, * in which case a single 0 byte is necessary and even required). * * See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 */ export declare function isTxDER(buf: Uint8Array): boolean; /** * Checks if a script signature is in canonical format. * * @param buffer - The signature to check as a Uint8Array * @returns true if the signature is canonical (valid DER encoding with defined hash type), false otherwise */ export declare function isCanonicalScriptSignature(buffer: Uint8Array): boolean; //# sourceMappingURL=signatureutils.d.ts.map