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?