|
|
@ -22,8 +22,8 @@ defmodule Explorer.MicroserviceInterfaces.Metadata do |
|
|
|
with :ok <- Microservice.check_enabled(__MODULE__) do |
|
|
|
with :ok <- Microservice.check_enabled(__MODULE__) do |
|
|
|
body = %{ |
|
|
|
body = %{ |
|
|
|
addresses: Enum.join(addresses, ","), |
|
|
|
addresses: Enum.join(addresses, ","), |
|
|
|
tagsLimit: @tags_per_address_limit, |
|
|
|
tags_limit: @tags_per_address_limit, |
|
|
|
chainId: Application.get_env(:block_scout_web, :chain_id) |
|
|
|
chain_id: Application.get_env(:block_scout_web, :chain_id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
http_get_request(addresses_metadata_url(), body) |
|
|
|
http_get_request(addresses_metadata_url(), body) |
|
|
@ -38,8 +38,8 @@ defmodule Explorer.MicroserviceInterfaces.Metadata do |
|
|
|
with :ok <- Microservice.check_enabled(__MODULE__) do |
|
|
|
with :ok <- Microservice.check_enabled(__MODULE__) do |
|
|
|
params = |
|
|
|
params = |
|
|
|
params |
|
|
|
params |
|
|
|
|> Map.put("pageSize", @page_size) |
|
|
|
|> Map.put("page_size", @page_size) |
|
|
|
|> Map.put("chainId", Application.get_env(:block_scout_web, :chain_id)) |
|
|
|
|> Map.put("chain_id", Application.get_env(:block_scout_web, :chain_id)) |
|
|
|
|
|
|
|
|
|
|
|
http_get_request_for_proxy_method(addresses_url(), params, &prepare_addresses_response/1) |
|
|
|
http_get_request_for_proxy_method(addresses_url(), params, &prepare_addresses_response/1) |
|
|
|
end |
|
|
|
end |
|
|
@ -136,11 +136,11 @@ defmodule Explorer.MicroserviceInterfaces.Metadata do |
|
|
|
Map.put(tag, "meta", Jason.decode!(meta)) |
|
|
|
Map.put(tag, "meta", Jason.decode!(meta)) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp prepare_addresses_response({:ok, %{"addresses" => addresses} = response}) do |
|
|
|
defp prepare_addresses_response({:ok, %{"items" => addresses} = response}) do |
|
|
|
{:ok, |
|
|
|
{:ok, |
|
|
|
Map.put( |
|
|
|
Map.put( |
|
|
|
response, |
|
|
|
response, |
|
|
|
"addresses", |
|
|
|
"items", |
|
|
|
addresses |
|
|
|
addresses |
|
|
|
|> Chain.hashes_to_addresses( |
|
|
|
|> Chain.hashes_to_addresses( |
|
|
|
necessity_by_association: %{names: :optional, smart_contract: :optional, proxy_implementations: :optional} |
|
|
|
necessity_by_association: %{names: :optional, smart_contract: :optional, proxy_implementations: :optional} |
|
|
|