feat: Retry ERC-1155 token instance metadata fetch from baseURI + tokenID (#10766)

pull/10814/head
Qwerty5Uiop 2 months ago committed by GitHub
parent 547032e204
commit bb1c194d62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      apps/indexer/lib/indexer/fetcher/token_instance/helper.ex

@ -239,13 +239,17 @@ defmodule Indexer.Fetcher.TokenInstance.Helper do
end end
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, contract_address: contract_address_hash_string,
method_id: @uri,
args: [token_id],
block_number: nil 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 end
def normalize_token_id("ERC-721", _token_id), do: nil def normalize_token_id("ERC-721", _token_id), do: nil

Loading…
Cancel
Save