From bb1c194d62d86474d00f93852360b2d57f29ffd8 Mon Sep 17 00:00:00 2001 From: Qwerty5Uiop <105209995+Qwerty5Uiop@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:43:19 +0400 Subject: [PATCH] feat: Retry ERC-1155 token instance metadata fetch from baseURI + tokenID (#10766) --- .../lib/indexer/fetcher/token_instance/helper.ex | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/indexer/lib/indexer/fetcher/token_instance/helper.ex b/apps/indexer/lib/indexer/fetcher/token_instance/helper.ex index 5067e601ab..0987055f33 100644 --- a/apps/indexer/lib/indexer/fetcher/token_instance/helper.ex +++ b/apps/indexer/lib/indexer/fetcher/token_instance/helper.ex @@ -239,13 +239,17 @@ defmodule Indexer.Fetcher.TokenInstance.Helper do end end - def prepare_request(_token_type, contract_address_hash_string, token_id, _retry) do - %{ + def prepare_request(_token_type, contract_address_hash_string, token_id, from_base_uri?) do + request = %{ contract_address: contract_address_hash_string, - method_id: @uri, - args: [token_id], block_number: nil } + + if from_base_uri? do + request |> Map.put(:method_id, @base_uri) |> Map.put(:args, []) + else + request |> Map.put(:method_id, @uri) |> Map.put(:args, [token_id]) + end end def normalize_token_id("ERC-721", _token_id), do: nil