|
|
@ -5,13 +5,14 @@ defmodule BlockScoutWeb.AddressChannel do |
|
|
|
use BlockScoutWeb, :channel |
|
|
|
use BlockScoutWeb, :channel |
|
|
|
|
|
|
|
|
|
|
|
alias BlockScoutWeb.{AddressCoinBalanceView, AddressView, InternalTransactionView, TransactionView} |
|
|
|
alias BlockScoutWeb.{AddressCoinBalanceView, AddressView, InternalTransactionView, TransactionView} |
|
|
|
|
|
|
|
alias Explorer.Chain |
|
|
|
alias Explorer.Chain.Hash |
|
|
|
alias Explorer.Chain.Hash |
|
|
|
alias Phoenix.View |
|
|
|
alias Phoenix.View |
|
|
|
|
|
|
|
|
|
|
|
intercept(["balance_update", "coin_balance", "count", "internal_transaction", "transaction"]) |
|
|
|
intercept(["balance_update", "coin_balance", "count", "internal_transaction", "transaction"]) |
|
|
|
|
|
|
|
|
|
|
|
def join("addresses:" <> _address_hash, _params, socket) do |
|
|
|
def join("addresses:" <> address_hash, _params, socket) do |
|
|
|
{:ok, %{}, socket} |
|
|
|
{:ok, %{}, assign(socket, :address_hash, address_hash)} |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def handle_out( |
|
|
|
def handle_out( |
|
|
@ -63,7 +64,9 @@ defmodule BlockScoutWeb.AddressChannel do |
|
|
|
|
|
|
|
|
|
|
|
def handle_out("transaction", data, socket), do: handle_transaction(data, socket, "transaction") |
|
|
|
def handle_out("transaction", data, socket), do: handle_transaction(data, socket, "transaction") |
|
|
|
|
|
|
|
|
|
|
|
def handle_out("coin_balance", %{coin_balance: coin_balance}, socket) do |
|
|
|
def handle_out("coin_balance", %{block_number: block_number}, socket) do |
|
|
|
|
|
|
|
coin_balance = Chain.get_coin_balance(socket.assigns.address_hash, block_number) |
|
|
|
|
|
|
|
|
|
|
|
Gettext.put_locale(BlockScoutWeb.Gettext, socket.assigns.locale) |
|
|
|
Gettext.put_locale(BlockScoutWeb.Gettext, socket.assigns.locale) |
|
|
|
|
|
|
|
|
|
|
|
rendered_coin_balance = |
|
|
|
rendered_coin_balance = |
|
|
|