ERC1155 import issues on Polygon

Hi everyone,

Here is the issue I have with reading the response for an ERC1155 contract on Polygon:

get /nft/{address} returns a response split in 2 parts for the same contract address.As it conflicts with the “usual” response structure (in 1 part/contract) for other ERC1155 contracts, its importation is problematic:

Call:

curl -X 'GET' \
  'https://deep-index.moralis.io/api/v2/nft/0x26bd28360f9C55d009e685b01D1959824978a138?chain=polygon&format=decimal' \

Response:

{
  "total": "1",
  "page": 0,
  "page_size": 500,
  "cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3aGVyZSI6eyJ0b2tlbl9hZGRyZXNzIjoiMHgyNmJkMjgzNjBmOWM1NWQwMDllNjg1YjAxZDE5NTk4MjQ5NzhhMTM4In0sImxpbWl0Ijo1MDAsIm9mZnNldCI6NTAwLCJvcmRlciI6W1siYmxvY2tfbnVtYmVyX21pbnRlZCIsIkRFU0MiXSxbInRva2VuX2hhc2giLCJERVNDIl1dLCJncm91cCI6WyJ0b2tlbl9oYXNoIiwidG9rZW5fYWRkcmVzcyIsInRva2VuX2lkIiwiYmxvY2tfbnVtYmVyX21pbnRlZCJdLCJwYWdlIjoxLCJpYXQiOjE2NDY4MTU3MjJ9.gnkJr8slLwtiwhGYAsD_InMT5-aayHmqPkMmhk9T9oE",
  "result": [
    {
      "token_address": "0x26bd28360f9c55d009e685b01d1959824978a138",
      "token_id": "1",
      "amount": "1988903",
      "contract_type": "ERC1155",
      "name": "RariLend Protocol - DAO PASS",
      "symbol": null,
      "token_uri": "https://gateway.moralisipfs.com/ipfs/Qma9XzYytpUrewixPkuy9HA4xtjkmyjpHvgihLzxYD5nPy/0.json",
      "metadata": "{...}",
      "synced_at": "2022-03-02T01:15:12.658Z"
    },
    {
      "token_address": "0x26bd28360f9c55d009e685b01d1959824978a138",
      "token_id": "1",
      "amount": "111097",
      "contract_type": "ERC1155",
      "name": "RariLend Protocol - DAO PASS",
      "symbol": null,
      "token_uri": "https://gateway.moralisipfs.com/ipfs/Qma9XzYytpUrewixPkuy9HA4xtjkmyjpHvgihLzxYD5nPy/0.json",
      "metadata": "{...}",
      "synced_at": "2022-03-02T01:15:12.658Z"
    }
  ]
}

Do anyone know why the response (basically the token supply) is split in 2 ?

Is there anyway to make it be one in order to fit the classic response structure?

1 Like

we will investigate, at first look it doesn’t seem to me like the expected output

1 Like

Can share the ERC1155 contract source code if that can help

I don’t think that it is needed for now

Sum of both “amount” is the correct Total Supply. The first section “amount”: 1988903 is very close to the owner address’s holdings, but not exactly (26 tokens more).

1 Like

any update about this ERC1155 integration?

I don’t have an update now

can you check again now?

now it returns this:

{
  "total": "1",
  "page": 0,
  "page_size": 500,
  "cursor": "...",
  "result": [
    {
      "token_address": "0x26bd28360f9c55d009e685b01d1959824978a138",
      "token_id": "1",
      "amount": "2100000",
      "contract_type": "ERC1155",
      "name": "RariLend Protocol - DAO PASS",
      "symbol": null,
      "token_uri": "https://gateway.moralisipfs.com/ipfs/Qma9XzYytpUrewixPkuy9HA4xtjkmyjpHvgihLzxYD5nPy/0.json",
      "metadata": "...",
      "synced_at": "2022-03-24T19:37:12.697Z"
    }
  ]
}