|
|
@ -3,8 +3,13 @@ defmodule BlockScoutWeb.ChainView do |
|
|
|
|
|
|
|
|
|
|
|
alias BlockScoutWeb.LayoutView |
|
|
|
alias BlockScoutWeb.LayoutView |
|
|
|
|
|
|
|
|
|
|
|
defp market_cap(:standard, exchange_rate) do |
|
|
|
defp market_cap(:standard, %{available_supply: available_supply, usd_value: usd_value}) |
|
|
|
Decimal.mult(exchange_rate.available_supply, exchange_rate.usd_value) |
|
|
|
when is_nil(available_supply) or is_nil(usd_value) do |
|
|
|
|
|
|
|
Decimal.new(0) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp market_cap(:standard, %{available_supply: available_supply, usd_value: usd_value}) do |
|
|
|
|
|
|
|
Decimal.mult(available_supply, usd_value) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp market_cap(module, exchange_rate) do |
|
|
|
defp market_cap(module, exchange_rate) do |
|
|
|