terra.wasm.contractQuery(contractAddr1,
{
"all_tokens":{
"limit": 30,
"start_after": 1000 // this is not working
},
}
).then(res => {
})
I am struggling to use pagination to get all NFT details in a collection. Is there any resource on how to user start_after I can refer to ? . What do you think I am doing wrong here ?
A few things, first off the answer depends on the collection you are trying to paginate. A few of the early collections on Terra unfortunately have a bug that prevents pagination using all_tokens. More details on the bug here:
Ultimately start_after is expecting a token_id not an offset. So if the contract is not affected by this bug you can use the token_id of the last token in the first query you make.
If you could share the collection Iām happy to come up with an example!