@ecash/lib
Version:
Library for eCash transaction building
70 lines • 2.69 kB
TypeScript
/** Type of sighash used to sign for an input for a OP_CHECKSIG operation. */
export declare class SigHashType {
/** Variant of the sighash, e.g. LEGACY or BIP143 */
variant: SigHashTypeVariant;
/** How inputs are signed, e.g. FIXED or ANYONECANPAY */
inputType: SigHashTypeInputs;
/** How outputs are signed, e.g. ALL, NONE or SINGLE */
outputType: SigHashTypeOutputs;
constructor(params: {
variant: SigHashTypeVariant;
inputType: SigHashTypeInputs;
outputType: SigHashTypeOutputs;
});
/** Reconstruct a SigHashType from the flags */
static fromInt(flags: number): SigHashType | undefined;
/** Get the sighash type as integer flags */
toInt(): number;
}
/** Variant of the sighash */
export declare enum SigHashTypeVariant {
/** Original Satoshi, pre-BIP143 sighash */
LEGACY = 0,
/** New BIP143 sighash introduced by UAHF */
BIP143 = 64
}
/** How tx inputs are signed */
export declare enum SigHashTypeInputs {
/** Inputs are fixed, no other inputs can added/removeed */
FIXED = 0,
/** Inputs are arbitrary, other inputs can be added/removed */
ANYONECANPAY = 128
}
/** How tx outputs are signed */
export declare enum SigHashTypeOutputs {
/** All outputs are signed, no outputs can be added/removed */
ALL = 1,
/** No outputs are signed, they can be anything */
NONE = 2,
/** The output with the identical index as this input is signed */
SINGLE = 3
}
/** ALL|BIP143 */
export declare const ALL_BIP143: SigHashType;
/** ALL|ANYONECANPAY|BIP143 */
export declare const ALL_ANYONECANPAY_BIP143: SigHashType;
/** NONE|BIP143 */
export declare const NONE_BIP143: SigHashType;
/** NONE|ANYONECANPAY|BIP143 */
export declare const NONE_ANYONECANPAY_BIP143: SigHashType;
/** SINGLE|BIP143 */
export declare const SINGLE_BIP143: SigHashType;
/** SINGLE|ANYONECANPAY|BIP143 */
export declare const SINGLE_ANYONECANPAY_BIP143: SigHashType;
/** ALL|LEGACY */
export declare const ALL_LEGACY: SigHashType;
/** ALL|ANYONECANPAY|LEGACY */
export declare const ALL_ANYONECANPAY_LEGACY: SigHashType;
/** NONE|LEGACY */
export declare const NONE_LEGACY: SigHashType;
/** NONE|ANYONECANPAY|LEGACY */
export declare const NONE_ANYONECANPAY_LEGACY: SigHashType;
/** SINGLE|LEGACY */
export declare const SINGLE_LEGACY: SigHashType;
/** SINGLE|ANYONECANPAY|LEGACY */
export declare const SINGLE_ANYONECANPAY_LEGACY: SigHashType;
/** List of BIP143 sighashes (FORKID) */
export declare const SIG_HASH_TYPES_BIP143: SigHashType[];
/** List of legacy sighashes (OG Bitcoin signature) */
export declare const SIG_HASH_TYPES_LEGACY: SigHashType[];
//# sourceMappingURL=sigHashType.d.ts.map