set_attribute: TxDescriptor<{
    collection: number;
    key: Binary;
    maybe_item?: number;
    namespace: Enum<{
        Account: SS58String;
        CollectionOwner: undefined;
        ItemOwner: undefined;
        Pallet: undefined;
    }>;
    value: Binary;
}>

Set an attribute for a collection or item.

Origin must be Signed and must conform to the namespace ruleset:

  • CollectionOwner namespace could be modified by the collection Admin only;
  • ItemOwner namespace could be modified by the maybe_item owner only. maybe_item should be set in that case;
  • Account(AccountId) namespace could be modified only when the origin was 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)