|
|
|
@ -3,7 +3,7 @@ |
|
|
|
|
<%= @type %> (<span data-number-of-tokens-by-type="<%= @type %>"><%= Enum.count(@token_balances)%></span>) |
|
|
|
|
</h6> |
|
|
|
|
|
|
|
|
|
<%= for token_balance <- sort_by_usd_value_and_name(@token_balances) do %> |
|
|
|
|
<%= for {token_balance, bridged_token} <- sort_by_usd_value_and_name(@token_balances) do %> |
|
|
|
|
<div |
|
|
|
|
class="border-bottom" |
|
|
|
|
data-dropdown-token-balance-test |
|
|
|
@ -15,15 +15,27 @@ |
|
|
|
|
class: "dropdown-item" |
|
|
|
|
) do %> |
|
|
|
|
<div class="row"> |
|
|
|
|
<p class="mb-0 col-md-6"><%= token_name(token_balance.token) %></p> |
|
|
|
|
<%= if token_balance.token.usd_value do %> |
|
|
|
|
<p class="mb-0 col-md-6"><%= token_name(token_balance.token) %> |
|
|
|
|
<%= if bridged_token && bridged_token.custom_metadata do %> |
|
|
|
|
<%= "(" <> bridged_token.custom_metadata <> ")" %> |
|
|
|
|
<% end %> |
|
|
|
|
</p> |
|
|
|
|
<%= if bridged_token && bridged_token.lp_token && bridged_token.custom_cap do %> |
|
|
|
|
<% lp_token_balance_usd = token_balance.value |> Decimal.div(token_balance.token.total_supply) |> Decimal.mult(bridged_token.custom_cap) |> Decimal.round(4) %> |
|
|
|
|
<p class="mb-0 col-md-6 text-right"> |
|
|
|
|
<span data-selector="token-balance-usd" data-usd-value="<%= Chain.balance_in_usd(token_balance) %>"></span> |
|
|
|
|
<span data-selector="token-balance-usd" data-usd-value="<%= lp_token_balance_usd %>"></span> |
|
|
|
|
</p> |
|
|
|
|
<% else %> |
|
|
|
|
<%= if token_balance.token.usd_value do %> |
|
|
|
|
<p class="mb-0 col-md-6 text-right"> |
|
|
|
|
<span data-selector="token-balance-usd" data-usd-value="<%= Chain.balance_in_usd(token_balance) %>"></span> |
|
|
|
|
</p> |
|
|
|
|
<% end %> |
|
|
|
|
<% end %> |
|
|
|
|
</div> |
|
|
|
|
<div class="row"> |
|
|
|
|
<p class="mb-0 col-md-6"> |
|
|
|
|
<% col_md = if token_balance.token.usd_value, do: "col-md-6", else: "col-md-12" %> |
|
|
|
|
<p class="mb-0 <%= col_md %> "> |
|
|
|
|
<%= format_according_to_decimals(token_balance.value, token_balance.token.decimals) %> <%= token_balance.token.symbol %> |
|
|
|
|
</p> |
|
|
|
|
<%= if token_balance.token.usd_value do %> |
|
|
|
|