|
|
@ -3,7 +3,7 @@ |
|
|
|
<%= @type %> (<span data-number-of-tokens-by-type="<%= @type %>"><%= Enum.count(@token_balances)%></span>) |
|
|
|
<%= @type %> (<span data-number-of-tokens-by-type="<%= @type %>"><%= Enum.count(@token_balances)%></span>) |
|
|
|
</h6> |
|
|
|
</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 |
|
|
|
<div |
|
|
|
class="border-bottom" |
|
|
|
class="border-bottom" |
|
|
|
data-dropdown-token-balance-test |
|
|
|
data-dropdown-token-balance-test |
|
|
@ -15,15 +15,27 @@ |
|
|
|
class: "dropdown-item" |
|
|
|
class: "dropdown-item" |
|
|
|
) do %> |
|
|
|
) do %> |
|
|
|
<div class="row"> |
|
|
|
<div class="row"> |
|
|
|
<p class="mb-0 col-md-6"><%= token_name(token_balance.token) %></p> |
|
|
|
<p class="mb-0 col-md-6"><%= token_name(token_balance.token) %> |
|
|
|
<%= if token_balance.token.usd_value do %> |
|
|
|
<%= 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"> |
|
|
|
<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> |
|
|
|
</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 %> |
|
|
|
<% end %> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="row"> |
|
|
|
<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 %> |
|
|
|
<%= format_according_to_decimals(token_balance.value, token_balance.token.decimals) %> <%= token_balance.token.symbol %> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<%= if token_balance.token.usd_value do %> |
|
|
|
<%= if token_balance.token.usd_value do %> |
|
|
@ -35,4 +47,4 @@ |
|
|
|
<% end %> |
|
|
|
<% end %> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<% end %> |
|
|
|
<% end %> |
|
|
|
</div> |
|
|
|
</div> |