BSV-ex v0.2.2 BSV.Transaction.Output View Source
Module for parsing and serialising transaction outputs.
Link to this section Summary
Functions
Returns the size of the given output. If the output has a script, it's actual size is calculated, otherwise a P2PKH output is estimated.
Parse the given binary into a single transaction output. Returns a tuple containing the transaction output and the remaining binary data.
Serialises the given transaction output struct into a binary.
Link to this section Types
Transaction output
Link to this section Functions
Returns the size of the given output. If the output has a script, it's actual size is calculated, otherwise a P2PKH output is estimated.
parse(data, options \\ [])
View Sourceparse(binary(), keyword()) :: {BSV.Transaction.Output.t(), binary()}
Parse the given binary into a single transaction output. Returns a tuple containing the transaction output 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.Output.parse(data)
{%BSV.Trasaction.Output{}, ""}
serialize(output, options \\ [])
View Sourceserialize(BSV.Transaction.Output.t(), keyword()) :: binary()
Serialises the given transaction output 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.Output.serialize(output)
<<binary>>