Orchard value pool info

This commit is contained in:
Vamsi Krishna B 2022-05-12 12:00:25 +05:30
parent ae34fb3825
commit 9963772864
1 changed files with 13 additions and 0 deletions

View File

@ -52,6 +52,15 @@ defmodule ZcashExplorerWeb.BlockChainInfoLive do
</dd> </dd>
</div> </div>
<div class="px-4 py-5 bg-white shadow rounded-lg overflow-hidden sm:p-6">
<dt class="text-sm font-medium text-gray-500 truncate">
Orchard pool
</dt>
<dd class="mt-1 text-3xl font-semibold text-gray-900">
<%= orchard_value(@blockchain_info["valuePools"]) %> ZEC
</dd>
</div>
<div class="px-4 py-5 bg-white shadow rounded-lg overflow-hidden sm:p-6"> <div class="px-4 py-5 bg-white shadow rounded-lg overflow-hidden sm:p-6">
<dt class="text-sm font-medium text-gray-500 truncate"> <dt class="text-sm font-medium text-gray-500 truncate">
zcashd version zcashd version
@ -99,6 +108,10 @@ defmodule ZcashExplorerWeb.BlockChainInfoLive do
value_pools |> get_value_pools() |> Map.get("sapling") value_pools |> get_value_pools() |> Map.get("sapling")
end end
defp orchard_value(value_pools) do
value_pools |> get_value_pools |> Map.get("orchard")
end
defp get_value_pools(value_pools) do defp get_value_pools(value_pools) do
Enum.map(value_pools, fn %{"id" => name, "chainValue" => value} -> {name, value} end) Enum.map(value_pools, fn %{"id" => name, "chainValue" => value} -> {name, value} end)
|> Map.new() |> Map.new()