View Source ElectrumClient.Calls.Blockchain.ScriptHash.ListUnspent (electrum_client v0.1.25)

Manages blockchain.scripthash.listunspent params and results

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

Link to this section Summary

Functions

Calls the electrum server with the required parameters and returns a list of UTXO in the form of an elixir list

Converts a script hash into blockchain.scripthash.listunspent params

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

Link to this section Functions

@spec call(any(), binary()) :: list()

Calls the electrum server with the required parameters and returns a list of UTXO in the form of an elixir list

Link to this function

encode_params(script_hash)

View Source

Converts a script hash into blockchain.scripthash.listunspent params

examples

Examples

iex> "67a5662abf889b5a28ffa821c1f85fd3ef9313756b881351d91a3671f3f52858" ...> |> ElectrumClient.Calls.Blockchain.ScriptHash.ListUnspent.encode_params() """ {"id":1,"jsonrpc":"2.0","method":"blockchain.scripthash.listunspent","params":["67a5662abf889b5a28ffa821c1f85fd3ef9313756b881351d91a3671f3f52858"]} """

@spec translate(list()) :: list()

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

examples

Examples

iex> """ ...> [{"height":2346430,"tx_hash":"05517750a78fb8c38346b1bf5908d71abe728811b643105be6595e11a9392373","tx_pos":0,"value":4000}] ...> """ ...> |> Jason.decode!() ...> ...> |> ElectrumClient.Calls.Blockchain.ScriptHash.ListUnspent.translate() [

%{
  height: 2346430,
  transaction_id: "05517750a78fb8c38346b1bf5908d71abe728811b643105be6595e11a9392373",
  value: 4000,
  vxid: 0
}

]