-
Notifications
You must be signed in to change notification settings - Fork 13
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
added getInvetory retriever method fixes #30 #32
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
cadence/contracts/NFTRetrieval.cdc
Outdated
let types = NFTCatalog.getCatalogTypeData() | ||
for nftType in types.keys { | ||
let typeData=types[nftType]! | ||
let collectionKey=typeData.keys[0] |
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.
Why 0 index here? Do we want to handle the case if one nft type has multiple collections like Mint Store?
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.
All the collections are stored in the same path, we just want the ids of them all. Paritioning these into subcollections will take up a lot of gas since you need to borrow each one.
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.
Makes sense!
cadence/contracts/NFTRetrieval.cdc
Outdated
let collectionKey=typeData.keys[0] | ||
let catalogEntry = NFTCatalog.getCatalogEntry(collectionIdentifier:collectionKey)! | ||
let path =catalogEntry.collectionData.publicPath | ||
let cap= account.getCapability<&{MetadataViews.ResolverCollection}>(path) |
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.
This won't be guaranteed to exist just a heads up
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.
What will not be guaranteed to not exist? I check if the cap is linked on the next line.
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.
The capability is linked
cadence/contracts/NFTRetrieval.cdc
Outdated
let types = NFTCatalog.getCatalogTypeData() | ||
for nftType in types.keys { | ||
let typeData=types[nftType]! | ||
let collectionKey=typeData.keys[0] |
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.
Makes sense!
LGTM! |
No description provided.