View Source BitcoinCoreClient.Business (BitcoinCoreClient v0.1.3)
Makes the RPC calls and returns the results in bitstring format
Link to this section Summary
Functions
Returns the block corresponding to the hash sent as a parameter
Returns the block corresponding to the block height sent as a parameter
Converts a block height into a block hash
Returns a transaction
Link to this section Functions
@spec get_block_by_hash(binary(), %BitcoinCoreClient.Rpc.Settings{ http_module: term(), ip: term(), password: term(), port: term(), username: term() }) :: {:ok, bitstring()} | {:error, binary()}
Returns the block corresponding to the hash sent as a parameter
examples
Examples
iex> "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
...> |> BitcoinCoreClient.Business.get_block_by_hash()
%Block{...}
@spec get_block_by_height(integer(), %BitcoinCoreClient.Rpc.Settings{ http_module: term(), ip: term(), password: term(), port: term(), username: term() }) :: {:ok, bitstring()} | {:error, binary()}
Returns the block corresponding to the block height sent as a parameter
examples
Examples
iex> 0
...> |> BitcoinCoreClient.Business.get_block_by_height()
%Block{...}
@spec get_block_hash(integer(), %BitcoinCoreClient.Rpc.Settings{ http_module: term(), ip: term(), password: term(), port: term(), username: term() }) :: binary()
Converts a block height into a block hash
examples
Examples
iex> BitcoinCoreClient.Business.get_block_hash(0, settings)
...> "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
@spec get_transaction(binary(), %BitcoinCoreClient.Rpc.Settings{ http_module: term(), ip: term(), password: term(), port: term(), username: term() }) :: {:ok, bitstring()} | {:error, binary()}
Returns a transaction
examples
Examples
iex> "50cfd3361f7162b3c0c00dacd3d0e4ddf61e8ec0c51bfa54c4ca0e61876810a9"
...> |> BitcoinCoreClient.Business.get_transaction()
<<x::bitstring>>