BSV-ex v0.1.0 BSV.Transaction View Source

Module for the construction, parsing and serialization of Bitcoin transactions.

Link to this section Summary

Types

t()

Bitcoin Transaction

Functions

Returns the given transaction's txid, which is a double SHA-256 hash of the transaction, reversed.

Parse the given binary into a transaction. Returns a tuple containing the transaction input and the remaining binary data.

Serialises the given transaction into a binary.

Link to this section Types

Link to this type

t()

View Source
t() :: %BSV.Transaction{
  inputs: list(),
  lock_time: integer(),
  outputs: list(),
  version: integer()
}

Bitcoin Transaction

Link to this section Functions

Returns the given transaction's txid, which is a double SHA-256 hash of the transaction, reversed.

Link to this function

parse(data, options \\ [])

View Source
parse(binary(), keyword()) :: {BSV.Transaction.t(), binary()}

Parse the given binary into a transaction. 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.parse(data)
{%BSV.Trasaction{}, ""}
Link to this function

serialize(tx, options \\ [])

View Source
serialize(BSV.Transaction.t(), keyword()) :: binary()

Serialises the given transaction 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>>