|
|
|
@ -3,17 +3,17 @@ |
|
|
|
|
<%= @type %> (<span data-number-of-tokens-by-type="<%= @type %>"><%= Enum.count(@token_balances)%></span>) |
|
|
|
|
</h6> |
|
|
|
|
|
|
|
|
|
<%= for {token_balance, token} <- @token_balances do %> |
|
|
|
|
<%= for token_balance <- @token_balances do %> |
|
|
|
|
<div |
|
|
|
|
class="border-bottom" |
|
|
|
|
data-dropdown-token-balance-test |
|
|
|
|
data-token-name="<%= token_name(token) %>" |
|
|
|
|
data-token-symbol="<%= token_symbol(token) %>" |
|
|
|
|
data-token-name="<%= token_name(token_balance.token) %>" |
|
|
|
|
data-token-symbol="<%= token_symbol(token_balance.token) %>" |
|
|
|
|
> |
|
|
|
|
<% path = cond do |
|
|
|
|
token_balance.token_type == "ERC-721" && !is_nil(token_balance.token_id) -> token_instance_path(@conn, :show, token.contract_address_hash, to_string(token_balance.token_id)) |
|
|
|
|
token_balance.token_type == "ERC-1155" && !is_nil(token_balance.token_id) -> token_instance_path(@conn, :show, token.contract_address_hash, to_string(token_balance.token_id)) |
|
|
|
|
true -> token_path(@conn, :show, to_string(token.contract_address_hash)) |
|
|
|
|
token_balance.token_type == "ERC-721" && !is_nil(token_balance.token_id) -> token_instance_path(@conn, :show, token_balance.token.contract_address_hash, to_string(token_balance.token_id)) |
|
|
|
|
token_balance.token_type == "ERC-1155" && !is_nil(token_balance.token_id) -> token_instance_path(@conn, :show, token_balance.token.contract_address_hash, to_string(token_balance.token_id)) |
|
|
|
|
true -> token_path(@conn, :show, to_string(token_balance.token.contract_address_hash)) |
|
|
|
|
end |
|
|
|
|
%> |
|
|
|
|
<%= link( |
|
|
|
@ -23,7 +23,7 @@ |
|
|
|
|
<div class="row dropdown-row wh-sp"> |
|
|
|
|
<%= if Application.get_env(:block_scout_web, :display_token_icons) do %> |
|
|
|
|
<% chain_id_for_token_icon = Application.get_env(:block_scout_web, :chain_id) %> |
|
|
|
|
<% address_hash = token.contract_address_hash %> |
|
|
|
|
<% address_hash = token_balance.token.contract_address_hash %> |
|
|
|
|
<%= |
|
|
|
|
render BlockScoutWeb.TokensView, |
|
|
|
|
"_token_icon.html", |
|
|
|
@ -32,18 +32,18 @@ |
|
|
|
|
additional_classes: ["token-wallet-icon"] |
|
|
|
|
%> |
|
|
|
|
<% end %> |
|
|
|
|
<p class="mb-0 col-md-6 pl-0 pr-0 el-1 flex-grow-2 <%= if !Application.get_env(:block_scout_web, :display_token_icons), do: "ml-5px" %>"><%= token_name(token) %> |
|
|
|
|
<p class="mb-0 col-md-6 pl-0 pr-0 el-1 flex-grow-2 <%= if !Application.get_env(:block_scout_web, :display_token_icons), do: "ml-5px" %>"><%= token_name(token_balance.token) %> |
|
|
|
|
</p> |
|
|
|
|
<%= if token.fiat_value && token.decimals do %> |
|
|
|
|
<%= if token_balance.token.fiat_value && token_balance.token.decimals do %> |
|
|
|
|
<p class="mb-0 col-md-6 text-right usd-total"> |
|
|
|
|
<span data-selector="token-balance-usd" data-usd-value="<%= Chain.balance_in_fiat(token_balance, token) %>"></span> |
|
|
|
|
<span data-selector="token-balance-usd" data-usd-value="<%= Chain.balance_in_fiat(token_balance) %>"></span> |
|
|
|
|
</p> |
|
|
|
|
<% end %> |
|
|
|
|
</div> |
|
|
|
|
<div class="row dropdown-row wh-sp"> |
|
|
|
|
<%= if token.fiat_value do %> |
|
|
|
|
<%= if token_balance.token.fiat_value do %> |
|
|
|
|
<p class="mb-0 text-right text-muted usd-rate"> |
|
|
|
|
<span data-selector="token-price" data-token-usd-value="<%= token.fiat_value %>"></span> |
|
|
|
|
<span data-selector="token-price" data-token-usd-value="<%= token_balance.token.fiat_value %>"></span> |
|
|
|
|
</p> |
|
|
|
|
<% end %> |
|
|
|
|
</div> |
|
|
|
@ -52,7 +52,7 @@ |
|
|
|
|
<%= if token_balance.token_type == "ERC-721" && !is_nil(token_balance.token_id) do %> |
|
|
|
|
1 |
|
|
|
|
<% else %> |
|
|
|
|
<%= format_according_to_decimals(token_balance.value, token.decimals) %> <%= token_symbol(token) %> |
|
|
|
|
<%= format_according_to_decimals(token_balance.value, token_balance.token.decimals) %> <%= token_symbol(token_balance.token) %> |
|
|
|
|
<% end %> |
|
|
|
|
<%= if (token_balance.token_type == "ERC-721" && !is_nil(token_balance.token_id)) or token_balance.token_type == "ERC-1155" do %> |
|
|
|
|
<%= " TokenID " <> to_string(token_balance.token_id) %> |
|
|
|
|