View Source ElectrumClient.Calls.Blockchain.ScriptHash.GetHistory (electrum_client v0.1.20)

Manages blockchain.scripthash.get_history params and results

ref: https://electrumx-spesmilo.readthedocs.io/en/latest/protocol-methods.html#blockchain-scripthash-get-history

Link to this section Summary

Functions

Converts a script hash into blockchain.scripthash.get_history params

Converts a blockchain.scripthash.get_history's call result into an elixir list

Link to this section Functions

Converts a script hash into blockchain.scripthash.get_history params

examples

Examples

iex> "tb1qqu0x5hfjktz5azefaaa0937w0692ln0dvanfu8"
...> |> ElectrumClient.Calls.Blockchain.ScriptHash.GetHistory.encode_params()
"""
{"id":1,"jsonrpc":"2.0","method":"blockchain.scripthash.get_history","params":["295634380c67a76e8138f3e61c616b8d0d5ca2362b2ede17de0080d879bd21c8\"]}
"""
@spec translate(list()) :: [%{confirmed: integer(), unconfirmed: integer()}]

Converts a blockchain.scripthash.get_history's call result into an elixir list

examples

Examples

iex> [
...>   %{ "height" => 2347375, "tx_hash" => "dde058767aa566f2aba736320796771922efa6cb6e75f1cba3d47e4bfd5ae0d8" },
...>   %{ "height" => 2347382, "tx_hash" => "5a957f4bff6d23140eb7e9b6fcedd41d3febf1e145d37519c593c939789a49af" }
...> ]
...> |> ElectrumClient.Calls.Blockchain.ScriptHash.GetHistory.translate()
[
  %{
    height: 2347375,
    txid: "dde058767aa566f2aba736320796771922efa6cb6e75f1cba3d47e4bfd5ae0d8"
  },
  %{
    height: 2347382,
    txid: "5a957f4bff6d23140eb7e9b6fcedd41d3febf1e145d37519c593c939789a49af"
  }
]