-
Notifications
You must be signed in to change notification settings - Fork 6
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
Decide if we use another nft pallet #7
Comments
Some notes for now |
Problems with 1. not possible to set collection attributes with traits. This means that we can't set
More context: 2. it's possible to hide extrinsics, but we can't hide events. I.e when we create collection or transfer through 3. another dependency to we add another dependency to our list and if we encounter any bugs, issues or want to change the behaviour, we should make PR to |
this is how our precompiles would look like (on a high-level) if we were to use |
Pallet NFTsDocs: https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/nfts#nfts-pallet Potential parts of the code to be changed. |
Hi, actually, there is a way to read the collection's metadata and attributes, it's the |
hey @jsidorenko thanks for reaching out here. yes, we are aware of the I think this is a bug, since users who use the I was actually thinking of making a PR for this, just want to confirm with you if this is actually a bug or there is something I am missing? |
Oh, I see! The easiest solution would be to change that line: https://github.com/paritytech/polkadot-sdk/blob/e3892745f7c58e877d8838587e1471a93796ead4/substrate/frame/nfts/src/impl_nonfungibles.rs#L87 and make the How would you solve that issue? |
yes, that's what I was going to propose |
Cool, I can open a PR later today, or feel free to submit it first :) |
# Description - What does this PR do? While working with `pallet_nfts` through `nonfungibles_v2` traits `Inspect, Mutate`, I found out that once you have set the collection attribute with `<Nfts as Mutate>::set_collection_attribute()`, it's not possible to read it with `<Nfts as Inspect>::collection_attribute()` since they use different `namespace` values. When setting the attribute, `AttributeNamespace::Pallet` is used, while `AttributeNamespace::CollectionOwner` is used when reading. more context: freeverseio/laos#7 (comment) This PR makes `item` an optional parameter in `Inspect::system_attribute()`, to be able to read collection attributes. - Why are these changes needed? To be able to read collection level attributes when reading attributes of the collection. It will be possible to read collection attributes by passing `None` for `item` - How were these changes implemented and what do they affect? `NftsApi` is also affected and `NftsApi::system_attribute()` now accepts optional `item` parameter. ## Breaking change Because of the change in the `NftsApi::system_attribute()` method's `item` param, parachains who integrated the `NftsApi` need to update their API code and frontend integrations accordingly. AssetHubs are unaffected since the NftsApi wasn't released on those parachains yet.
# Description - What does this PR do? While working with `pallet_nfts` through `nonfungibles_v2` traits `Inspect, Mutate`, I found out that once you have set the collection attribute with `<Nfts as Mutate>::set_collection_attribute()`, it's not possible to read it with `<Nfts as Inspect>::collection_attribute()` since they use different `namespace` values. When setting the attribute, `AttributeNamespace::Pallet` is used, while `AttributeNamespace::CollectionOwner` is used when reading. more context: freeverseio/laos#7 (comment) This PR makes `item` an optional parameter in `Inspect::system_attribute()`, to be able to read collection attributes. - Why are these changes needed? To be able to read collection level attributes when reading attributes of the collection. It will be possible to read collection attributes by passing `None` for `item` - How were these changes implemented and what do they affect? `NftsApi` is also affected and `NftsApi::system_attribute()` now accepts optional `item` parameter. ## Breaking change Because of the change in the `NftsApi::system_attribute()` method's `item` param, parachains who integrated the `NftsApi` need to update their API code and frontend integrations accordingly. AssetHubs are unaffected since the NftsApi wasn't released on those parachains yet.
# Description - What does this PR do? While working with `pallet_nfts` through `nonfungibles_v2` traits `Inspect, Mutate`, I found out that once you have set the collection attribute with `<Nfts as Mutate>::set_collection_attribute()`, it's not possible to read it with `<Nfts as Inspect>::collection_attribute()` since they use different `namespace` values. When setting the attribute, `AttributeNamespace::Pallet` is used, while `AttributeNamespace::CollectionOwner` is used when reading. more context: freeverseio/laos#7 (comment) This PR makes `item` an optional parameter in `Inspect::system_attribute()`, to be able to read collection attributes. - Why are these changes needed? To be able to read collection level attributes when reading attributes of the collection. It will be possible to read collection attributes by passing `None` for `item` - How were these changes implemented and what do they affect? `NftsApi` is also affected and `NftsApi::system_attribute()` now accepts optional `item` parameter. ## Breaking change Because of the change in the `NftsApi::system_attribute()` method's `item` param, parachains who integrated the `NftsApi` need to update their API code and frontend integrations accordingly. AssetHubs are unaffected since the NftsApi wasn't released on those parachains yet.
As a LAOS dev I want to understand if integrating an existing nft pallet would save a lot of work (compared to writing all methods by ourselves), and how I could integrate it.
Worth having a look at using it via traits here
ACCEPTANCE:
The text was updated successfully, but these errors were encountered: