/{address}/nft/{token_address} returns HEX token_id nevertheless

Using the GET /{address}/nft/{token_address}, returns the token_id in the URI in a HEX format, nevertheless how you set the format option. The correct behaviour should be that if the decimal format is selected, the uri token_id should also be decimal.

Request URL: https://deep-index.moralis.io/api/v2/0x4e2f2eae1e26b6a27af2badd5efbfce3081868cd/nft/0x82a3e038048cf02c19e60856564be209899d4f12?chain=bsc&format=decimal

We have also added support for the HEX value in our uri as a workaround, but how could we go about resyncing the NFT contract? As there is incorrect data shown from your side.

I get this as output in both cases:

{
  "total": 1,
  "page": 0,
  "page_size": 500,
  "result": [
    {
      "token_address": "0x82a3e038048cf02c19e60856564be209899d4f12",
      "token_id": "21006",
      "block_number_minted": "13551904",
      "owner_of": "0x4e2f2eae1e26b6a27af2badd5efbfce3081868cd",
      "block_number": "13551904",
      "amount": "1",
      "contract_type": "ERC1155",

what do you say that it should be the expected output for that token_id?

The token_id output is correct. I’m talking about the token_uri output.

Output:
“token_uri”:“https://moonboxes.io/api/card/000000000000000000000000000000000000000000000000000000000000520e

should be:
“token_uri”:“https://moonboxes.io/api/card/21006

You can see that the uri for the NFT metadata isn’t generated as needed, as the token_id value that is added to the end of the uri is in hex and should be in decimal.

now it looks like I get this output for hex:

{
  "total": 1,
  "page": 0,
  "page_size": 500,
  "result": [
    {
      "token_address": "0x82a3e038048cf02c19e60856564be209899d4f12",
      "token_id": "0x000000000000000000000000000000000000000000000000000000000000520e",
      "block_number_minted": "13551904",
      "owner_of": "0x4e2f2eae1e26b6a27af2badd5efbfce3081868cd",
      "block_number": "13551904",
      "amount": "1",
      "contract_type": "ERC1155",
      "name": null,
      "symbol": null,
      "token_uri": "https://moonboxes.io/api/card/000000000000000000000000000000000000000000000000000000000000520e",

and this output for decimal:

{
  "total": 1,
  "page": 0,
  "page_size": 500,
  "result": [
    {
      "token_address": "0x82a3e038048cf02c19e60856564be209899d4f12",
      "token_id": "21006",
      "block_number_minted": "13551904",
      "owner_of": "0x4e2f2eae1e26b6a27af2badd5efbfce3081868cd",
      "block_number": "13551904",
      "amount": "1",
      "contract_type": "ERC1155",
      "name": null,
      "symbol": null,
      "token_uri": "https://moonboxes.io/api/card/000000000000000000000000000000000000000000000000000000000000520e",

I think that the token_uri should be the same in both cases

No. The token_uri should be changed according to the format setting. If i select the Decimal format, the token_uri should be also with the decimal format rather than the hex format. Or I’m missing something?

I think that the token_uri will be the same in both cases, it will be only one token uri, when you select decimal or hex format, I think that you select it only for the token_id format, but that doesn’t influence the token uri, the token uri is in hex, based on the ERC1155 standard

1 Like

Oh. Sorry, i completely missed the ERC1155 standard for the token_uri. Thank you for your time :slight_smile: