Module: inputs

This module provides functions for sorting & validating multisig transaction inputs.

Source:

Methods

(static) sortInputs(inputs) → {Array.<module:inputs.MultisigTransactionInput>}

Sorts the given inputs according to the BIP69 standard: ascending lexicographic order.

Parameters:
Name Type Description
inputs Array.<module:inputs.MultisigTransactionInput>

inputs to sort

Source:
Returns:

inputs sorted according to BIP69

Type
Array.<module:inputs.MultisigTransactionInput>

(static) validateMultisigInput(input) → {string}

Validates the given transaction input.

  • Validates the presence and value of the transaction ID (txid) property.

  • Validates the presence and value of the transaction index (index) property.

  • Validates the presence of the multisig property.

Parameters:
Name Type Description
input module:inputs.MultisigTransactionInput

input to validate

Source:
Returns:

empty if valid or corresponding validation message if not

Type
string

(static) validateMultisigInputs(inputs, braidRequiredopt) → {string}

Validates the given transaction inputs.

Returns an error message if there are no inputs. Passes each output to validateMultisigInput.

If the function is called with braidRequired, an additional check is performed on each input's multisig to make sure that it is braid-aware. In other words, does the input know the set of ExtendedPublicKeys it came from?

Parameters:
Name Type Attributes Description
inputs Array.<module:inputs.MultisigTransactionInput>

inputs to validate

braidRequired boolean <optional>

inputs need to have braid details attached to them

Source:
Returns:

empty if valid or corresponding validation message if not

Type
string

(static) validateTransactionID(txid) → {string}

Validates the given transaction ID.

Parameters:
Name Type Description
txid string

transaction ID to validate

Source:
Returns:

empty if valid or corresponding validation message if not

Type
string

(static) validateTransactionIndex(indexString) → {string}

Validates the given transaction index.

Parameters:
Name Type Description
indexString string | number

transaction index to validate

Source:
Returns:

empty if valid or corresponding validation message if not

Type
string

Type Definitions

MultisigTransactionInput

Represents a transaction input.

The Multisig object represents the address the corresponding UTXO belongs to.

Type:
  • Object
Properties:
Name Type Description
txid string

The transaction ID where funds were received

index number

The index in the transaction referred to by {txid}

multisig module:multisig.Multisig

The multisig object encumbering this UTXO

Source: