Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blockscout/lib/explorer/ethereum/ethereum.ex

19 lines
473 B

defmodule Explorer.Ethereum do
@client Application.get_env(:explorer, :ethereum)[:backend]
defmodule API do
@moduledoc false
@callback download_balance(String.t()) :: String.t()
end
defdelegate download_balance(hash), to: @client
def decode_integer_field(hex) do
{"0x", base_16} = String.split_at(hex, 2)
String.to_integer(base_16, 16)
end
def decode_time_field(field) do
field |> decode_integer_field() |> Timex.from_unix()
end
end