Skip to content
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

Feat: Total Supply for AssetHubs #8346 #8347

Closed
wants to merge 5 commits into from
Closed

Feat: Total Supply for AssetHubs #8346 #8347

wants to merge 5 commits into from

Conversation

AshutoshSingh00001
Copy link
Contributor

Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.

👇 __ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

@AshutoshSingh00001 AshutoshSingh00001 requested a review from a team as a code owner December 1, 2023 18:20
@AshutoshSingh00001 AshutoshSingh00001 requested review from daiagi and Jarsen136 and removed request for a team December 1, 2023 18:20
@kodabot
Copy link
Collaborator

kodabot commented Dec 1, 2023

SUCCESS @AshutoshSingh00001 PR for issue #8346 which is assigned to you. Please wait for review and don't hesitate to grab another issue in the meantime!

Copy link

netlify bot commented Dec 1, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 18f04a9
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/656b99ef70f90e00082f0ba3
😎 Deploy Preview https://deploy-preview-8347--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Dec 1, 2023
Copy link
Contributor

reviewpad bot commented Dec 1, 2023

AI-Generated Summary: This pull request introduces a new feature to the collection stat, "Total Supply", which provides the maximum supply of a collection. It extends the functionality into three different files to achieve this.

  1. CollectionInfo.vue - This is where the Total Supply UI component is added. It will display the total available supply.

  2. types.ts - The Stats type definition is expanded to include maxSupply, which can store a number or a string value.

  3. useCollectionDetails.ts - Fetches the data from the API via api.query.nfts.collectionConfigOf(collectionId) and parses the response to extract maxSupply.

In total, there are 10 insertions and 1 deletion across these three files. The changes will provide additional statistical data to the user, enhancing overall usability and information availability.

Copy link
Contributor

@roiLeo roiLeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please could you share a screenshot?
plus we don't need to call api since you can retrieve the data from indexer

@AshutoshSingh00001
Copy link
Contributor Author

please could you share a screenshot? plus we don't need to call api since you can retrieve the data from indexer

I think it's a good idea to use indexer but it works the same and also by using api we get the same values and a lot of time api is used in many different places view #8346 for screenshots

@AshutoshSingh00001
Copy link
Contributor Author

Screenshot 2023-12-01 at 11 46 00 PM Screenshot 2023-12-01 at 11 46 27 PM

it works fine and is it necessary to use indexer if I have an option to use api as I saw on kodadot contributors.md indexer is preferred but api can also be used I had to get the value then convert it into Json format then call a specific object so I used it

Copy link
Contributor

@roiLeo roiLeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use indexer instead, it doesn't work on some collection (i.e. /ahk/collection/u-65535)

Screenshot 2023-12-02 at 20-41-44 Премия «Просветитель» 2022 года

@AshutoshSingh00001
Copy link
Contributor Author

AshutoshSingh00001 commented Dec 2, 2023

please use indexer instead, it doesn't work on some collection (i.e. /ahk/collection/u-65535)

Screenshot 2023-12-02 at 20-41-44 Премия «Просветитель» 2022 года

@roiLeo I already knew about this is why I didn't used indexer it is just for nft pallet not for uniques pallet u-65535 this is uniques collection

@AshutoshSingh00001
Copy link
Contributor Author

please use indexer instead, it doesn't work on some collection (i.e. /ahk/collection/u-65535)

Screenshot 2023-12-02 at 20-41-44 Премия «Просветитель» 2022 года

uniques is now depreciated https://wiki.polkadot.network/docs/learn-nft-pallets#uniques-pallet read this and we are moving to nft pallet

@roiLeo
Copy link
Contributor

roiLeo commented Dec 2, 2023

@AshutoshSingh00001
Copy link
Contributor Author

u-65535

this is why other stats are also not showing like items and owners

@AshutoshSingh00001
Copy link
Contributor Author

AshutoshSingh00001 commented Dec 2, 2023

Copy link

sonarqubecloud bot commented Dec 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link

codeclimate bot commented Dec 2, 2023

Code Climate has analyzed commit 18f04a9 and detected 0 issues on this pull request.

View more on Code Climate.

@AshutoshSingh00001
Copy link
Contributor Author

https://canary.kodadot.xyz/ahp/collection/30 vs https://deploy-preview-8347--koda-canary.netlify.app/ahp/collection/30

your code throw error on empty collection

I fixed it but😂 that collection is destroyed and I think I should added destroy tag to destroyed collections

@AshutoshSingh00001
Copy link
Contributor Author

@roiLeo genuinely your review is too good you gave me a link of destroyed collection this is why I used api which actually helps us to catch bugs

@AshutoshSingh00001
Copy link
Contributor Author

AshutoshSingh00001 commented Dec 4, 2023

@roiLeo changes are made can you review again

Copy link
Contributor

@roiLeo roiLeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roiLeo changes are made can you review again

please see #8389

@AshutoshSingh00001
Copy link
Contributor Author

@roiLeo changes are made can you review again

please see #8389

sorry but this not fair I had took this issue first 🥲 so sad I'll no more contribute if this happens

@roiLeo
Copy link
Contributor

roiLeo commented Dec 4, 2023

sorry but this not fair I had took this issue first 🥲 so sad I'll no more contribute if this happens

I asked you to use indexer, still no changes just comments.

@AshutoshSingh00001
Copy link
Contributor Author

AshutoshSingh00001 commented Dec 4, 2023

sorry but this not fair I had took this issue first 🥲 so sad I'll no more contribute if this happens

I asked you to use indexer, still no changes just comments.

but here https://github.com/kodadot/nft-gallery/blob/main/content/blog/first-time.md we can use any of them it might be your personal demand but if it works properly and I saw api was used on several places so I used it if you think it's my fault ok it's fine I just lost 4 days on this pr at least now you told me your final review thanks

@AshutoshSingh00001
Copy link
Contributor Author

@roiLeo thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Total Supply for AssetHubs
3 participants