BSV.Transaction.Output (bsv_sdk v1.1.0)

Copy Markdown View Source

Bitcoin transaction output.

Summary

Functions

Parse an output from raw binary. Returns {:ok, output, remaining_bytes} on success.

Return the locking script as a hex string.

Create a new empty output with default values.

Serialize the output to raw binary (wire format).

Types

t()

@type t() :: %BSV.Transaction.Output{
  change: boolean(),
  locking_script: BSV.Script.t(),
  satoshis: non_neg_integer()
}

Functions

from_binary(arg1)

@spec from_binary(binary()) :: {:ok, t(), binary()} | {:error, term()}

Parse an output from raw binary. Returns {:ok, output, remaining_bytes} on success.

locking_script_hex(output)

@spec locking_script_hex(t()) :: String.t()

Return the locking script as a hex string.

new()

@spec new() :: t()

Create a new empty output with default values.

to_binary(output)

@spec to_binary(t()) :: binary()

Serialize the output to raw binary (wire format).