Txbox v0.1.0 Txbox.Transactions.Tx View Source

Transaction schema module.

Txbox adds a single table to your database containing all of the transaction, channel and meta data.

For any transaction, the only required attribute is the txid. If no channel is specified, the transaction will be added to the Txbox.default_channel/0. Optionally any of the following attributes can be set:

  • :rawtx - The raw transaction data. Must be given as a raw binary/0, not a hex encoded string.
  • :tags - A list of tags which can be used for organising and filtering transactions.
  • :meta - A map containing structured metadata about the transaction. See Txbox.Transactions.Meta.t/0.
  • :data - A map containing any other arbitarry fields.

When searching Txbox, the data from :tags and :meta are incorporated into full text search.

Txbox automatically syncs the transaction with your configured miner, and updates the :status attribute with a cached response from the miner's Merchant API. See Txbox.Transactions.Status.t/0.

Link to this section Summary

Types

t()

Transaction schema

Link to this section Types

Specs

t() :: %Txbox.Transactions.Tx{
  __meta__: term(),
  block_hash: String.t(),
  block_height: integer(),
  channel: String.t(),
  data: map(),
  id: String.t(),
  inserted_at: NaiveDateTime.t(),
  mapi_attempt: integer(),
  mapi_attempted_at: DateTime.t(),
  mapi_completed_at: DateTime.t(),
  meta: Txbox.Transactions.Meta.t(),
  rawtx: binary(),
  status: Txbox.Transactions.Status.t(),
  tags: [String.t()],
  txid: String.t(),
  updated_at: NaiveDateTime.t()
}

Transaction schema