exactly, so as mentioned above we want to get all information about an NFT contract. Especially with an ERC1155 we run into the issue here. To name a specific example, the Swiss Crypto Stamp (on polygon, address 0x6ddcc90614d47acd7596447686c4fd6aee782742) has 175k NFTs over 13 token Ids distributed to 175k paper wallets (real world stamps). Calling this function I would expect the following outcome according to the documentation:
[
{
"token_address": "0x6ddcc90614d47acd7596447686c4fd6aee782742",
"token_id": "1",
"amount": "65000",
"contract_type": "ERC1155",
"token_uri": "tokenuri for token id 1",
"metadata": "metadata for token id 1",
...
},
{
"token_address": "0x6ddcc90614d47acd7596447686c4fd6aee782742",
"token_id": "2",
"amount": "45000",
"contract_type": "ERC1155",
"token_uri": "tokenuri for token id 2",
"metadata": "metadata for token id 2",
...
},
...,
{
"token_address": "0x6ddcc90614d47acd7596447686c4fd6aee782742",
"token_id": "13",
"amount": "50",
"contract_type": "ERC1155",
"token_uri": "tokenuri for token id 13",
"metadata": "metadata for token id 13",
...
}
]
But the actual outcome is:
[
{
"token_address": "0x6ddcc90614d47acd7596447686c4fd6aee782742",
"token_id": "1",
"amount": "1",
"owner_of": "0x......1",
"contract_type": "ERC1155",
"token_uri": "tokenuri for token id 1",
"metadata": "metadata for token id 1",
...
},
{
"token_address": "0x6ddcc90614d47acd7596447686c4fd6aee782742",
"token_id": "1",
"amount": "1",
"owner_of": "0x......2",
"contract_type": "ERC1155",
"token_uri": "tokenuri for token id 1",
"metadata": "metadata for token id 1",
...
},
{
"token_address": "0x6ddcc90614d47acd7596447686c4fd6aee782742",
"token_id": "1",
"amount": "2",
"owner_of": "0x......3",
"contract_type": "ERC1155",
"token_uri": "tokenuri for token id 1",
"metadata": "metadata for token id 1",
...
},
...
]
So essentially for every owner of an NFT there is a separate entry with the amount of tokens that specific owner is holding. Meaning that the result we receive back has ~175,000 entries, one for every paper wallet / stamp (meanwhile some NFTs have been transferred to wallets, so it’s only approximately 175k individual owners now).
So right now getNFTsForContract
and getAllTokenIds
return the same, that’s why I was suspecting a wrong return value in the first place, because it’s currently redundant.
If there is any more questions I’m happy to help.