Response Pagination: Moralis / Rarible Recurring Issue

I’ve encountered a recurring issue with response pagination across three distinct plugins and I believe the community might know of a workaround or solution. If you have any ideas or questions, please comment below!

To provide some context: The ERC721 standard necessitates the implementation of the balanceOf function in NFTs, yet it doesn’t inherently keep track or maintain a list of balances, i.e., TokenId’s. Consequently, the balanceOf function can provide a count regardless of the number of items, but to return the actual list of balances, i.e., TokenId’s, a separate query is required, which restricts the returned items to between 10-100.

Utilizing the ‘get NFTs by Wallet’ feature from the Moralis API and getItemsbyOwner from the Rarible SDK, both systems yield similar implementations. While I can retrieve some results successfully, there’s an issue when wallets contain a vast quantity of NFT’s; the results get truncated. These processes have fields for continuation (Rarible) or Cursor (Moralis), which are designed to utilize the continuation token from the preceding response to continue the search.



Nonetheless, this continuation response can only be invoked in a separate expression that has its own continuation field.

My objective is to allow the continuation token to be dynamically invoked in the expression’s continuation field, considering it varies depending on each user and each page. However, it’s not immediately clear how to extract this data. I cannot retrieve this data in an action and I’m skeptical about the potential to set a dynamic state for the data.

This is the relevant documentation from Moralis’ Wallet API: Get NFTs by wallet | Moralis Web3 Documentation

If anyone has ideas on how to access the continuation response token, your input would be greatly appreciated!

Thank you,