Elixium Core v0.2.13 Elixium.Store.Utxo View Source

Provides an interface for interacting with the UTXOs stored in level db

Link to this section Summary

Functions

Add a utxo to leveldb, indexing it by its txoid

Return a list of UTXOs that a given address (public key) can use as inputs

Check if a UTXO is currently in the pool

Retrieve a UTXO by its txoid

Link to this section Types

Link to this type utxo() View Source
utxo() :: %{
  txoid: String.t(),
  addr: String.t(),
  amount: number(),
  signature: String.t() | none()
}

Link to this section Functions

Link to this function add_utxo(utxo) View Source
add_utxo(utxo()) :: :ok | {:error, any()}

Add a utxo to leveldb, indexing it by its txoid

Link to this function find_by_address(public_key) View Source
find_by_address(String.t()) :: [utxo()]

Return a list of UTXOs that a given address (public key) can use as inputs

Link to this function in_pool?(map) View Source
in_pool?(utxo()) :: true | false

Check if a UTXO is currently in the pool

Link to this function remove_utxo(txoid) View Source
remove_utxo(String.t()) :: :ok | {:error, any()}
Link to this function retrieve_all_utxos() View Source
retrieve_all_utxos() :: [utxo()]
Link to this function retrieve_utxo(txoid) View Source
retrieve_utxo(String.t()) :: map()

Retrieve a UTXO by its txoid

Link to this function update_with_transactions(transactions) View Source
update_with_transactions(list()) :: :ok | {:error, any()}