|
|
@ -5,7 +5,7 @@ defmodule BlockScoutWeb.AddressCoinBalanceController do |
|
|
|
|
|
|
|
|
|
|
|
use BlockScoutWeb, :controller |
|
|
|
use BlockScoutWeb, :controller |
|
|
|
|
|
|
|
|
|
|
|
import BlockScoutWeb.AddressController, only: [transaction_count: 1, validation_count: 1] |
|
|
|
import BlockScoutWeb.AddressController, only: [transaction_and_validation_count: 1] |
|
|
|
import BlockScoutWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1] |
|
|
|
import BlockScoutWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1] |
|
|
|
|
|
|
|
|
|
|
|
alias BlockScoutWeb.AddressCoinBalanceView |
|
|
|
alias BlockScoutWeb.AddressCoinBalanceView |
|
|
@ -60,12 +60,14 @@ defmodule BlockScoutWeb.AddressCoinBalanceController do |
|
|
|
def index(conn, %{"address_id" => address_hash_string}) do |
|
|
|
def index(conn, %{"address_id" => address_hash_string}) do |
|
|
|
with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), |
|
|
|
with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), |
|
|
|
{:ok, address} <- Chain.hash_to_address(address_hash) do |
|
|
|
{:ok, address} <- Chain.hash_to_address(address_hash) do |
|
|
|
|
|
|
|
{transaction_count, validation_count} = transaction_and_validation_count(address_hash) |
|
|
|
|
|
|
|
|
|
|
|
render(conn, "index.html", |
|
|
|
render(conn, "index.html", |
|
|
|
address: address, |
|
|
|
address: address, |
|
|
|
coin_balance_status: CoinBalanceOnDemand.trigger_fetch(address), |
|
|
|
coin_balance_status: CoinBalanceOnDemand.trigger_fetch(address), |
|
|
|
exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(), |
|
|
|
exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(), |
|
|
|
transaction_count: transaction_count(address_hash), |
|
|
|
transaction_count: transaction_count, |
|
|
|
validation_count: validation_count(address_hash), |
|
|
|
validation_count: validation_count, |
|
|
|
current_path: current_path(conn) |
|
|
|
current_path: current_path(conn) |
|
|
|
) |
|
|
|
) |
|
|
|
else |
|
|
|
else |
|
|
|