P2SHMultisigInput class

An input for a Pay-to-Script-Hash output (P2SH) with a multisig redeemScript and any number of required signatures. It can be signed with one of the associated ECPrivateKey objects using sign or an existing signature can be inserted with insertSignature.

Inheritance

Constructors

P2SHMultisigInput.new({required OutPoint prevOut, required MultisigProgram program, Iterable<ECDSAInputSignature> sigs = const [], int sequence = Input.sequenceFinal})

Properties

complete bool
Always true as a simple RawInput is assumed to be fully signed as there is no way to determine if it is or not.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
prevOut OutPoint
finalinherited
program MultisigProgram
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 setteroverride
scriptSig Uint8List
finalinherited
sequence int
finalinherited
signedSize int?
The maximum total size when fully signed via the default hash type including any witness data of the input. If this is unknown, this is null. The actual signed size may be lower according to the data being encoded.
no setteroverride
sigs List<ECDSAInputSignature>
final
size int
Obtains the cached size of the object
no setterinherited

Methods

createInputSignature({required Transaction tx, required int inputN, required ECPrivateKey key, required Script scriptCode, SigHashType hashType = const SigHashType.all()}) ECDSAInputSignature
Creates a signature for the input. Used by subclasses to implement signing.
inherited
filterSignatures(bool predicate(InputSignature insig)) P2SHMultisigInput
Removes signatures that the predicate returns false for. This is used to remove invalidated signatures.
override
insertSignature(ECDSAInputSignature insig, ECPublicKey pubkey, Uint8List getSigHash(SigHashType hashType)) P2SHMultisigInput
Returns a new P2SHMultisigInput with the new signature added in order. The pubkey should be the public key for the signature to ensure that it matches. getSigHash obtains the signature hash for a given type so that existing signatures can be checked. If existing signatures are not in-order then they may not be fully matched and included in the resulting input. If there are more signatures than the required threshold, the last signature will be removed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sign({required Transaction tx, required int inputN, required ECPrivateKey key, SigHashType hashType = const SigHashType.all()}) LegacyInput
Signs the input given the tx, input number (inputN) and a private key using the specifified hashType. Implemented by specific subclasses.
override
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) P2SHMultisigInput?
Checks if the RawInput matches the expected format for a P2SHMultisigInput with any number of signatures. If it does it returns a P2SHMultisigInput for the input or else it returns null.