-
Notifications
You must be signed in to change notification settings - Fork 602
[SDK] Add pagination to getOwned for ERC721 & 1155 #1695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 9d1bb6e The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAttention:
... and 4 files with indirect coverage changes 📢 Thoughts on this report? Let us know!. |
@joaquim-verges Thanks again for taking your time to review this. This code of mine:
is based on how I think the pagination for which is a bit different to how it works in p/s: I have set up the unit tests here: js/packages/sdk/test/evm/edition.test.ts Lines 293 to 333 in c7476e8
ERC721: js/packages/sdk/test/evm/nft.test.ts Lines 291 to 319 in c7476e8
|
@kien-ngo you're still considering This is a different behavior from the existing please keep the current behavior and keep it consistent between getAll and getOwned. |
Ah I see. Okay so the |
…b-dev/js into kien/get-owned-paginated
@kien-ngo to be clear - for getAll it just happens to be that index == tokenId, but not the case for getOwned. In general the way to think about it is: let's say i owned 20 NFTs total, calling
should give me my 8th, 9th and 10th owned NFT (regardless of their tokenID) lmk if that makes sense |
Yes ser it does. Thanks again. I will update the code and the tests |
@joaquim-verges Hi there, I updated the code & added unit tests. Please have a look when you have time thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks @kien-ngo
Problem solved
Add optional pagination for
getOwned
.Changes made
How to test