BSV-ex v0.2.3 BSV.Transaction.Input View Source
Module for parsing and serialising transaction inputs.
Link to this section Summary
Functions
Returns the size of the given input. If the input has a script, it's actual size is calculated, otherwise a P2PKH input is estimated.
Parse the given binary into a transaction input. Returns a tuple containing the transaction input and the remaining binary data.
Serialises the given transaction input struct into a binary.
Link to this section Types
t()
View Sourcet() :: %BSV.Transaction.Input{ output_index: integer(), output_txid: String.t(), script: binary(), sequence: integer(), utxo: BSV.Transaction.Output.t() }
Transaction input
Link to this section Functions
Returns the size of the given input. If the input has a script, it's actual size is calculated, otherwise a P2PKH input is estimated.
parse(data, options \\ [])
View Sourceparse(binary(), keyword()) :: {BSV.Transaction.Input.t(), binary()}
Parse the given binary into a transaction input. Returns a tuple containing the transaction input and the remaining binary data.
Options
The accepted options are:
:encoding
- Optionally decode the binary with either the:base64
or:hex
encoding scheme.
Examples
BSV.Transaction.Input.parse(data)
{%BSV.Trasaction.Input{}, ""}
serialize(input, options \\ [])
View Sourceserialize(BSV.Transaction.Input.t(), keyword()) :: binary()
Serialises the given transaction input struct into a binary.
Options
The accepted options are:
:encode
- Optionally encode the returned binary with either the:base64
or:hex
encoding scheme.
Examples
BSV.Transaction.Input.serialize(input)
<<binary>>