Function pallet_nfts::pallet::dispatchables::set_attribute
source · pub fn set_attribute<T: Config<I>, I: 'static>(
collection: T::CollectionId,
maybe_item: Option<T::ItemId>,
namespace: AttributeNamespace<T::AccountId>,
key: BoundedVec<u8, T::KeyLimit>,
value: BoundedVec<u8, T::ValueLimit>
)Expand description
Set an attribute for a collection or item.
Origin must be Signed and must conform to the namespace ruleset:
CollectionOwnernamespace could be modified by thecollectionAdmin only;ItemOwnernamespace could be modified by themaybe_itemowner only.maybe_itemshould be set in that case;Account(AccountId)namespace could be modified only when theoriginwas given a permission to do so;
The funds of origin are reserved according to the formula:
AttributeDepositBase + DepositPerByte * (key.len + value.len) taking into
account any already reserved funds.
collection: The identifier of the collection whose item’s metadata to set.maybe_item: The identifier of the item whose metadata to set.namespace: Attribute’s namespace.key: The key of the attribute.value: The value to which to set the attribute.
Emits AttributeSet.
Weight: O(1)
Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::set_attribute.