parent
e5f127c06e
commit
97dc5adbad
@ -0,0 +1,38 @@ |
|||||||
|
<section class="container"> |
||||||
|
<%= render( |
||||||
|
OverviewView, |
||||||
|
"_details.html", |
||||||
|
token: @token, |
||||||
|
total_token_transfers: @total_token_transfers, |
||||||
|
token_id: @token_instance.token_id, |
||||||
|
conn: @conn |
||||||
|
) %> |
||||||
|
|
||||||
|
<section> |
||||||
|
<div class="card"> |
||||||
|
<%= render OverviewView, "_tabs.html", assigns %> |
||||||
|
<div class="card-body" data-async-load data-async-listing="<%= @current_path %>"> |
||||||
|
<h2 class="card-title"><%= gettext "Token Transfers" %></h2> |
||||||
|
|
||||||
|
<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> |
||||||
|
|
||||||
|
<button data-error-message class="alert alert-danger col-12 text-left" style="display: none;"> |
||||||
|
<span href="#" class="alert-link"><%= gettext("Something went wrong, click to reload.") %></span> |
||||||
|
</button> |
||||||
|
|
||||||
|
<div data-empty-response-message class="tile tile-muted text-center" style="display: none;"> |
||||||
|
<span data-selector="empty-transactions-list"> |
||||||
|
<%= gettext "There are no transfers for this Token." %> |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div data-items> |
||||||
|
<%= render BlockScoutWeb.CommonComponentsView, "_tile-loader.html" %> |
||||||
|
</div> |
||||||
|
|
||||||
|
<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> |
||||||
|
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
</section> |
@ -0,0 +1,21 @@ |
|||||||
|
defmodule BlockScoutWeb.Tokens.Instance.OverviewView do |
||||||
|
use BlockScoutWeb, :view |
||||||
|
|
||||||
|
alias Explorer.Chain.Token |
||||||
|
alias BlockScoutWeb.CurrencyHelpers |
||||||
|
|
||||||
|
def token_name?(%Token{name: nil}), do: false |
||||||
|
def token_name?(%Token{name: _}), do: true |
||||||
|
|
||||||
|
def decimals?(%Token{decimals: nil}), do: false |
||||||
|
def decimals?(%Token{decimals: _}), do: true |
||||||
|
|
||||||
|
def total_supply?(%Token{total_supply: nil}), do: false |
||||||
|
def total_supply?(%Token{total_supply: _}), do: true |
||||||
|
|
||||||
|
def total_supply_usd(token) do |
||||||
|
tokens = CurrencyHelpers.divide_decimals(token.total_supply, token.decimals) |
||||||
|
price = token.usd_value |
||||||
|
Decimal.mult(tokens, price) |
||||||
|
end |
||||||
|
end |
@ -1,3 +1,5 @@ |
|||||||
defmodule BlockScoutWeb.Tokens.Instance.TransferView do |
defmodule BlockScoutWeb.Tokens.Instance.TransferView do |
||||||
use BlockScoutWeb, :view |
use BlockScoutWeb, :view |
||||||
|
|
||||||
|
alias BlockScoutWeb.Tokens.Instance.OverviewView |
||||||
end |
end |
||||||
|
Loading…
Reference in new issue