pub enum Call<T: Config<I>, I: 'static = ()> {
Show 26 variants create { collection: T::CollectionId, admin: <<T as Config>::Lookup as StaticLookup>::Source, }, force_create { collection: T::CollectionId, owner: <<T as Config>::Lookup as StaticLookup>::Source, free_holding: bool, }, destroy { collection: T::CollectionId, witness: DestroyWitness, }, mint { collection: T::CollectionId, item: T::ItemId, owner: <<T as Config>::Lookup as StaticLookup>::Source, }, burn { collection: T::CollectionId, item: T::ItemId, check_owner: Option<<<T as Config>::Lookup as StaticLookup>::Source>, }, transfer { collection: T::CollectionId, item: T::ItemId, dest: <<T as Config>::Lookup as StaticLookup>::Source, }, redeposit { collection: T::CollectionId, items: Vec<T::ItemId>, }, freeze { collection: T::CollectionId, item: T::ItemId, }, thaw { collection: T::CollectionId, item: T::ItemId, }, freeze_collection { collection: T::CollectionId, }, thaw_collection { collection: T::CollectionId, }, transfer_ownership { collection: T::CollectionId, owner: <<T as Config>::Lookup as StaticLookup>::Source, }, set_team { collection: T::CollectionId, issuer: <<T as Config>::Lookup as StaticLookup>::Source, admin: <<T as Config>::Lookup as StaticLookup>::Source, freezer: <<T as Config>::Lookup as StaticLookup>::Source, }, approve_transfer { collection: T::CollectionId, item: T::ItemId, delegate: <<T as Config>::Lookup as StaticLookup>::Source, }, cancel_approval { collection: T::CollectionId, item: T::ItemId, maybe_check_delegate: Option<<<T as Config>::Lookup as StaticLookup>::Source>, }, force_item_status { collection: T::CollectionId, owner: <<T as Config>::Lookup as StaticLookup>::Source, issuer: <<T as Config>::Lookup as StaticLookup>::Source, admin: <<T as Config>::Lookup as StaticLookup>::Source, freezer: <<T as Config>::Lookup as StaticLookup>::Source, free_holding: bool, is_frozen: bool, }, set_attribute { collection: T::CollectionId, maybe_item: Option<T::ItemId>, key: BoundedVec<u8, T::KeyLimit>, value: BoundedVec<u8, T::ValueLimit>, }, clear_attribute { collection: T::CollectionId, maybe_item: Option<T::ItemId>, key: BoundedVec<u8, T::KeyLimit>, }, set_metadata { collection: T::CollectionId, item: T::ItemId, data: BoundedVec<u8, T::StringLimit>, is_frozen: bool, }, clear_metadata { collection: T::CollectionId, item: T::ItemId, }, set_collection_metadata { collection: T::CollectionId, data: BoundedVec<u8, T::StringLimit>, is_frozen: bool, }, clear_collection_metadata { collection: T::CollectionId, }, set_accept_ownership { maybe_collection: Option<T::CollectionId>, }, set_collection_max_supply { collection: T::CollectionId, max_supply: u32, }, set_price { collection: T::CollectionId, item: T::ItemId, price: Option<<<T as Config<I>>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance>, whitelisted_buyer: Option<<<T as Config>::Lookup as StaticLookup>::Source>, }, buy_item { collection: T::CollectionId, item: T::ItemId, bid_price: <<T as Config<I>>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance, }, // some variants omitted
}
Expand description

Contains one variant per dispatchable that can be called by an extrinsic.

Variants§

§

create

Fields

§collection: T::CollectionId
§admin: <<T as Config>::Lookup as StaticLookup>::Source

Issue a new collection of non-fungible items from a public origin.

This new collection has no items initially and its owner is the origin.

The origin must be Signed and the sender must have sufficient funds free.

ItemDeposit funds of sender are reserved.

Parameters:

  • collection: The identifier of the new collection. This must not be currently in use.
  • admin: The admin of this collection. The admin is the initial address of each member of the collection’s admin team.

Emits Created event when successful.

Weight: O(1)

§

force_create

Fields

§collection: T::CollectionId
§owner: <<T as Config>::Lookup as StaticLookup>::Source
§free_holding: bool

Issue a new collection of non-fungible items from a privileged origin.

This new collection has no items initially.

The origin must conform to ForceOrigin.

Unlike create, no funds are reserved.

  • collection: The identifier of the new item. This must not be currently in use.
  • owner: The owner of this collection of items. The owner has full superuser permissions over this item, but may later change and configure the permissions using transfer_ownership and set_team.

Emits ForceCreated event when successful.

Weight: O(1)

§

destroy

Fields

§collection: T::CollectionId

Destroy a collection of fungible items.

The origin must conform to ForceOrigin or must be Signed and the sender must be the owner of the collection.

  • collection: The identifier of the collection to be destroyed.
  • witness: Information on the items minted in the collection. This must be correct.

Emits Destroyed event when successful.

Weight: O(n + m) where:

  • n = witness.items
  • m = witness.item_metadatas
  • a = witness.attributes
§

mint

Fields

§collection: T::CollectionId
§item: T::ItemId
§owner: <<T as Config>::Lookup as StaticLookup>::Source

Mint an item of a particular collection.

The origin must be Signed and the sender must be the Issuer of the collection.

  • collection: The collection of the item to be minted.
  • item: The item value of the item to be minted.
  • beneficiary: The initial owner of the minted item.

Emits Issued event when successful.

Weight: O(1)

§

burn

Fields

§collection: T::CollectionId
§item: T::ItemId
§check_owner: Option<<<T as Config>::Lookup as StaticLookup>::Source>

Destroy a single item.

Origin must be Signed and the sender should be the Admin of the collection.

  • collection: The collection of the item to be burned.
  • item: The item of the item to be burned.
  • check_owner: If Some then the operation will fail with WrongOwner unless the item is owned by this value.

Emits Burned with the actual amount burned.

Weight: O(1) Modes: check_owner.is_some().

§

transfer

Fields

§collection: T::CollectionId
§item: T::ItemId
§dest: <<T as Config>::Lookup as StaticLookup>::Source

Move an item from the sender account to another.

This resets the approved account of the item.

Origin must be Signed and the signing account must be either:

  • the Admin of the collection;
  • the Owner of the item;
  • the approved delegate for the item (in this case, the approval is reset).

Arguments:

  • collection: The collection of the item to be transferred.
  • item: The item of the item to be transferred.
  • dest: The account to receive ownership of the item.

Emits Transferred.

Weight: O(1)

§

redeposit

Fields

§collection: T::CollectionId
§items: Vec<T::ItemId>

Reevaluate the deposits on some items.

Origin must be Signed and the sender should be the Owner of the collection.

  • collection: The collection to be frozen.
  • items: The items of the collection whose deposits will be reevaluated.

NOTE: This exists as a best-effort function. Any items which are unknown or in the case that the owner account does not have reservable funds to pay for a deposit increase are ignored. Generally the owner isn’t going to call this on items whose existing deposit is less than the refreshed deposit as it would only cost them, so it’s of little consequence.

It will still return an error in the case that the collection is unknown of the signer is not permitted to call it.

Weight: O(items.len())

§

freeze

Fields

§collection: T::CollectionId
§item: T::ItemId

Disallow further unprivileged transfer of an item.

Origin must be Signed and the sender should be the Freezer of the collection.

  • collection: The collection of the item to be frozen.
  • item: The item of the item to be frozen.

Emits Frozen.

Weight: O(1)

§

thaw

Fields

§collection: T::CollectionId
§item: T::ItemId

Re-allow unprivileged transfer of an item.

Origin must be Signed and the sender should be the Freezer of the collection.

  • collection: The collection of the item to be thawed.
  • item: The item of the item to be thawed.

Emits Thawed.

Weight: O(1)

§

freeze_collection

Fields

§collection: T::CollectionId

Disallow further unprivileged transfers for a whole collection.

Origin must be Signed and the sender should be the Freezer of the collection.

  • collection: The collection to be frozen.

Emits CollectionFrozen.

Weight: O(1)

§

thaw_collection

Fields

§collection: T::CollectionId

Re-allow unprivileged transfers for a whole collection.

Origin must be Signed and the sender should be the Admin of the collection.

  • collection: The collection to be thawed.

Emits CollectionThawed.

Weight: O(1)

§

transfer_ownership

Fields

§collection: T::CollectionId
§owner: <<T as Config>::Lookup as StaticLookup>::Source

Change the Owner of a collection.

Origin must be Signed and the sender should be the Owner of the collection.

  • collection: The collection whose owner should be changed.
  • owner: The new Owner of this collection. They must have called set_accept_ownership with collection in order for this operation to succeed.

Emits OwnerChanged.

Weight: O(1)

§

set_team

Fields

§collection: T::CollectionId
§issuer: <<T as Config>::Lookup as StaticLookup>::Source
§admin: <<T as Config>::Lookup as StaticLookup>::Source
§freezer: <<T as Config>::Lookup as StaticLookup>::Source

Change the Issuer, Admin and Freezer of a collection.

Origin must be Signed and the sender should be the Owner of the collection.

  • collection: The collection whose team should be changed.
  • issuer: The new Issuer of this collection.
  • admin: The new Admin of this collection.
  • freezer: The new Freezer of this collection.

Emits TeamChanged.

Weight: O(1)

§

approve_transfer

Fields

§collection: T::CollectionId
§item: T::ItemId
§delegate: <<T as Config>::Lookup as StaticLookup>::Source

Approve an item to be transferred by a delegated third-party account.

The origin must conform to ForceOrigin or must be Signed and the sender must be either the owner of the item or the admin of the collection.

  • collection: The collection of the item to be approved for delegated transfer.
  • item: The item of the item to be approved for delegated transfer.
  • delegate: The account to delegate permission to transfer the item.

Important NOTE: The approved account gets reset after each transfer.

Emits ApprovedTransfer on success.

Weight: O(1)

§

cancel_approval

Fields

§collection: T::CollectionId
§item: T::ItemId
§maybe_check_delegate: Option<<<T as Config>::Lookup as StaticLookup>::Source>

Cancel the prior approval for the transfer of an item by a delegate.

Origin must be either:

  • the Force origin;
  • Signed with the signer being the Admin of the collection;
  • Signed with the signer being the Owner of the item;

Arguments:

  • collection: The collection of the item of whose approval will be cancelled.
  • item: The item of the item of whose approval will be cancelled.
  • maybe_check_delegate: If Some will ensure that the given account is the one to which permission of transfer is delegated.

Emits ApprovalCancelled on success.

Weight: O(1)

§

force_item_status

Fields

§collection: T::CollectionId
§owner: <<T as Config>::Lookup as StaticLookup>::Source
§issuer: <<T as Config>::Lookup as StaticLookup>::Source
§admin: <<T as Config>::Lookup as StaticLookup>::Source
§freezer: <<T as Config>::Lookup as StaticLookup>::Source
§free_holding: bool
§is_frozen: bool

Alter the attributes of a given item.

Origin must be ForceOrigin.

  • collection: The identifier of the item.
  • owner: The new Owner of this item.
  • issuer: The new Issuer of this item.
  • admin: The new Admin of this item.
  • freezer: The new Freezer of this item.
  • free_holding: Whether a deposit is taken for holding an item of this collection.
  • is_frozen: Whether this collection is frozen except for permissioned/admin instructions.

Emits ItemStatusChanged with the identity of the item.

Weight: O(1)

§

set_attribute

Fields

§collection: T::CollectionId
§maybe_item: Option<T::ItemId>

Set an attribute for a collection or item.

Origin must be either ForceOrigin or Signed and the sender should be the Owner of the collection.

If the origin is Signed, then funds of signer are reserved according to the formula: MetadataDepositBase + 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.
  • key: The key of the attribute.
  • value: The value to which to set the attribute.

Emits AttributeSet.

Weight: O(1)

§

clear_attribute

Fields

§collection: T::CollectionId
§maybe_item: Option<T::ItemId>

Clear an attribute for a collection or item.

Origin must be either ForceOrigin or Signed and the sender should be the Owner of the collection.

Any deposit is freed for the collection’s owner.

  • collection: The identifier of the collection whose item’s metadata to clear.
  • maybe_item: The identifier of the item whose metadata to clear.
  • key: The key of the attribute.

Emits AttributeCleared.

Weight: O(1)

§

set_metadata

Fields

§collection: T::CollectionId
§item: T::ItemId
§is_frozen: bool

Set the metadata for an item.

Origin must be either ForceOrigin or Signed and the sender should be the Owner of the collection.

If the origin is Signed, then funds of signer are reserved according to the formula: MetadataDepositBase + DepositPerByte * data.len taking into account any already reserved funds.

  • collection: The identifier of the collection whose item’s metadata to set.
  • item: The identifier of the item whose metadata to set.
  • data: The general information of this item. Limited in length by StringLimit.
  • is_frozen: Whether the metadata should be frozen against further changes.

Emits MetadataSet.

Weight: O(1)

§

clear_metadata

Fields

§collection: T::CollectionId
§item: T::ItemId

Clear the metadata for an item.

Origin must be either ForceOrigin or Signed and the sender should be the Owner of the item.

Any deposit is freed for the collection’s owner.

  • collection: The identifier of the collection whose item’s metadata to clear.
  • item: The identifier of the item whose metadata to clear.

Emits MetadataCleared.

Weight: O(1)

§

set_collection_metadata

Fields

§collection: T::CollectionId
§is_frozen: bool

Set the metadata for a collection.

Origin must be either ForceOrigin or Signed and the sender should be the Owner of the collection.

If the origin is Signed, then funds of signer are reserved according to the formula: MetadataDepositBase + DepositPerByte * data.len taking into account any already reserved funds.

  • collection: The identifier of the item whose metadata to update.
  • data: The general information of this item. Limited in length by StringLimit.
  • is_frozen: Whether the metadata should be frozen against further changes.

Emits CollectionMetadataSet.

Weight: O(1)

§

clear_collection_metadata

Fields

§collection: T::CollectionId

Clear the metadata for a collection.

Origin must be either ForceOrigin or Signed and the sender should be the Owner of the collection.

Any deposit is freed for the collection’s owner.

  • collection: The identifier of the collection whose metadata to clear.

Emits CollectionMetadataCleared.

Weight: O(1)

§

set_accept_ownership

Fields

§maybe_collection: Option<T::CollectionId>

Set (or reset) the acceptance of ownership for a particular account.

Origin must be Signed and if maybe_collection is Some, then the signer must have a provider reference.

  • maybe_collection: The identifier of the collection whose ownership the signer is willing to accept, or if None, an indication that the signer is willing to accept no ownership transferal.

Emits OwnershipAcceptanceChanged.

§

set_collection_max_supply

Fields

§collection: T::CollectionId
§max_supply: u32

Set the maximum amount of items a collection could have.

Origin must be either ForceOrigin or Signed and the sender should be the Owner of the collection.

Note: This function can only succeed once per collection.

  • collection: The identifier of the collection to change.
  • max_supply: The maximum amount of items a collection could have.

Emits CollectionMaxSupplySet event when successful.

§

set_price

Fields

§collection: T::CollectionId
§item: T::ItemId
§price: Option<<<T as Config<I>>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance>
§whitelisted_buyer: Option<<<T as Config>::Lookup as StaticLookup>::Source>

Set (or reset) the price for an item.

Origin must be Signed and must be the owner of the asset item.

  • collection: The collection of the item.
  • item: The item to set the price for.
  • price: The price for the item. Pass None, to reset the price.
  • buyer: Restricts the buy operation to a specific account.

Emits ItemPriceSet on success if the price is not None. Emits ItemPriceRemoved on success if the price is None.

§

buy_item

Fields

§collection: T::CollectionId
§item: T::ItemId
§bid_price: <<T as Config<I>>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance

Allows to buy an item if it’s up for sale.

Origin must be Signed and must not be the owner of the item.

  • collection: The collection of the item.
  • item: The item the sender wants to buy.
  • bid_price: The price the sender is willing to pay.

Emits ItemBought on success.

Implementations§

Create a call with the variant create.

Create a call with the variant force_create.

Create a call with the variant destroy.

Create a call with the variant mint.

Create a call with the variant burn.

Create a call with the variant transfer.

Create a call with the variant redeposit.

Create a call with the variant freeze.

Create a call with the variant thaw.

Create a call with the variant freeze_collection.

Create a call with the variant thaw_collection.

Create a call with the variant transfer_ownership.

Create a call with the variant set_team.

Create a call with the variant approve_transfer.

Create a call with the variant cancel_approval.

Create a call with the variant force_item_status.

Create a call with the variant set_attribute.

Create a call with the variant clear_attribute.

Create a call with the variant set_metadata.

Create a call with the variant clear_metadata.

Create a call with the variant set_collection_metadata.

Create a call with the variant clear_collection_metadata.

Create a call with the variant set_accept_ownership.

Create a call with the variant set_collection_max_supply.

Create a call with the variant set_price.

Create a call with the variant buy_item.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Attempt to deserialise the value from input.
Attempt to skip the encoded value from input. Read more
Returns the fixed encoded size of the type. Read more
Convert self to a slice and append it to the destination.
If possible give a hint of expected size of the encoding. Read more
Convert self to an owned vector.
Convert self to a slice and then invoke the given closure with it.
Calculates the encoded size. Read more
Return the function name of the Call.
Return all function names.
Return a DispatchInfo, containing relevant information of this dispatch. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The type identifying for which type info is provided. Read more
Returns the static type identifier for Self.
The origin type of the runtime, (i.e. frame_system::Config::Origin).
Dispatch this call but do not check the filter in origin.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert from a value of T into an equivalent instance of Option<Self>. Read more
Consume self to return Some equivalent value of Option<T>. Read more
Converts self into T using Into<T>. Read more
Decode Self and consume all of the given input data. Read more
Decode Self and consume all of the given input data. Read more
Decode Self with the given maximum recursion depth and advance input by the number of bytes consumed. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more
Compare self to key and return true if they are equal.
Causes self to use its Binary implementation when Debug-formatted. Read more
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted. Read more
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Cast reference.
Cast reference.
Cast mutable reference.
Cast mutable reference.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Return an encoding of Self prepended by given slice.
Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
Convert from a value of T into an equivalent instance of Self. Read more
Consume self to return an equivalent value of T. Read more
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The counterpart to unchecked_from.
Consume self to return an equivalent value of T.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more