BSV-ex v0.1.0 BSV.Transaction.Output View Source

Module for parsing and serialising transaction outputs.

Link to this section Summary

Types

t()

Transaction output

Functions

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

Link to this type

t()

View Source
t() :: %BSV.Transaction.Output{
  amount: float(),
  satoshis: integer(),
  script: binary()
}

Transaction output

Link to this section Functions

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{}, ""}
Link to this function

serialize(output, options \\ [])

View Source
serialize(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>>