Skip to content

Commit

Permalink
Add new parse functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dudo50 committed Oct 15, 2024
1 parent 9751814 commit 2a8a158
Show file tree
Hide file tree
Showing 2 changed files with 601 additions and 60 deletions.
5 changes: 5 additions & 0 deletions substrate/frame/nfts/src/common_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Collection::<T, I>::get(collection).map(|i| i.owner_deposit)
}

/// Returns collection data
pub fn collection_data(collection: T::CollectionId) -> Option<BoundedVec<u8, <T as Config<I>>::StringLimit>> {
CollectionMetadataOf::<T, I>::get(collection).map(|i| i.data)
}

/// Returns item data
pub fn item_data(collection: T::CollectionId, item: T::ItemId) -> Option<BoundedVec<u8, <T as Config<I>>::StringLimit>> {
ItemMetadataOf::<T, I>::get(collection, item).map(|i| i.data)
Expand Down
Loading

0 comments on commit 2a8a158

Please sign in to comment.