P2WPKHInput class
An input for a Pay-to-Witness-Public-Key-Hash output (P2WPKH). This contains the public key that should match the hash in the associated output. It is either signed or unsigned and the addSignature method can be used to add a signature. Signature and public key data is stored in the witness data.
- Inheritance
-
- Object
- Input
- RawInput
- WitnessInput
- P2WPKHInput
- Mixed-in types
Constructors
- P2WPKHInput({required OutPoint prevOut, required ECPublicKey publicKey, InputSignature? insig, int sequence = Input.sequenceFinal})
Properties
- complete → bool
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- insig → InputSignature?
-
final
- prevOut → OutPoint
-
finalinherited
- publicKey → ECPublicKey
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- script → Script?
-
The script from the scriptSig bytes or null if the bytes do not
represent a valid script.
no setterinherited
- scriptSig → Uint8List
-
finalinherited
- sequence → int
-
finalinherited
- size → int
-
Obtains the cached size of the object
no setterinherited
-
witness
→ List<
Uint8List> -
finalinherited
Methods
-
addSignature(
InputSignature insig) → P2WPKHInput -
Returns a new P2WPKHInput with the InputSignature added. Any existing
signature is replaced.
override
-
filterSignatures(
bool predicate(InputSignature insig)) → P2WPKHInput -
Removes signatures that the
predicate
returns false for. This is used to remove invalidated signatures.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toBytes(
) → Uint8List -
Obtains a cached Uint8List with data serialized for this object
inherited
-
toHex(
) → String -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
Writer writer) → void -
Override to write data into
writer
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
match(
RawInput raw, List< Uint8List> witness) → P2WPKHInput? -
Checks if the
raw
input andwitness
data match the expected format for a P2WPKHInput, with or without a signature. If it does it returns a P2WPKHInput for the input or else it returns null.override