Class: Program

script.Program

new Program(version, data)

Witness Program

Parameters:
Name Type Description
version Number
data Buffer
Properties:
Name Type Description
version Number

Ranges from 0 to 16.

type String | null

Null if malformed. unknown if unknown version (treated as anyone-can-spend). Otherwise one of witnesspubkeyhash or witnessscripthash.

data Buffer

The hash (for now).

Source:

Methods

getType() → {ScriptType}

Get the witness program type.

Source:
Returns:
Type
ScriptType

inspect() → {String}

Inspect the program.

Source:
Returns:
Type
String

isMalformed() → {Boolean}

Test whether the program is malformed.

Source:
Returns:
Type
Boolean

isUnknown() → {Boolean}

Test whether the program is either an unknown version or malformed.

Source:
Returns:
Type
Boolean