Enum pallet_uniques::pallet::Call [−][src]
pub enum Call<T: Config<I>, I: 'static = ()> {}Show variants
create(T::ClassId, <T::Lookup as StaticLookup>::Source), force_create(T::ClassId, <T::Lookup as StaticLookup>::Source, bool), destroy(T::ClassId, DestroyWitness), mint(T::ClassId, T::InstanceId, <T::Lookup as StaticLookup>::Source), burn(T::ClassId, T::InstanceId, Option<<T::Lookup as StaticLookup>::Source>), transfer(T::ClassId, T::InstanceId, <T::Lookup as StaticLookup>::Source), redeposit(T::ClassId, Vec<T::InstanceId>), freeze(T::ClassId, T::InstanceId), thaw(T::ClassId, T::InstanceId), freeze_class(T::ClassId), thaw_class(T::ClassId), transfer_ownership(T::ClassId, <T::Lookup as StaticLookup>::Source), set_team(T::ClassId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source), approve_transfer(T::ClassId, T::InstanceId, <T::Lookup as StaticLookup>::Source), cancel_approval(T::ClassId, T::InstanceId, Option<<T::Lookup as StaticLookup>::Source>), force_asset_status(T::ClassId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, bool, bool), set_attribute(T::ClassId, Option<T::InstanceId>, BoundedVec<u8, T::KeyLimit>, BoundedVec<u8, T::ValueLimit>), clear_attribute(T::ClassId, Option<T::InstanceId>, BoundedVec<u8, T::KeyLimit>), set_metadata(T::ClassId, T::InstanceId, BoundedVec<u8, T::StringLimit>, bool), clear_metadata(T::ClassId, T::InstanceId), set_class_metadata(T::ClassId, BoundedVec<u8, T::StringLimit>, bool), clear_class_metadata(T::ClassId), // some variants omitted
Expand description
Contains one variant per dispatchable that can be called by an extrinsic.
Variants
create(T::ClassId, <T::Lookup as StaticLookup>::Source)
Issue a new class of non-fungible assets from a public origin.
This new asset class has no assets initially and its owner is the origin.
The origin must be Signed and the sender must have sufficient funds free.
AssetDeposit
funds of sender are reserved.
Parameters:
class
: The identifier of the new asset class. This must not be currently in use.admin
: The admin of this class of assets. The admin is the initial address of each member of the asset class’s admin team.
Emits Created
event when successful.
Weight: O(1)
force_create(T::ClassId, <T::Lookup as StaticLookup>::Source, bool)
Issue a new class of non-fungible assets from a privileged origin.
This new asset class has no assets initially.
The origin must conform to ForceOrigin
.
Unlike create
, no funds are reserved.
class
: The identifier of the new asset. This must not be currently in use.owner
: The owner of this class of assets. The owner has full superuser permissions over this asset, but may later change and configure the permissions usingtransfer_ownership
andset_team
.
Emits ForceCreated
event when successful.
Weight: O(1)
destroy(T::ClassId, DestroyWitness)
Destroy a class of fungible assets.
The origin must conform to ForceOrigin
or must be Signed
and the sender must be the
owner of the asset class
.
class
: The identifier of the asset class to be destroyed.witness
: Information on the instances minted in the asset class. This must be correct.
Emits Destroyed
event when successful.
Weight: O(n + m)
where:
n = witness.instances
m = witness.instance_metadatas
a = witness.attributes
mint(T::ClassId, T::InstanceId, <T::Lookup as StaticLookup>::Source)
Mint an asset instance of a particular class.
The origin must be Signed and the sender must be the Issuer of the asset class
.
class
: The class of the asset to be minted.instance
: The instance value of the asset to be minted.beneficiary
: The initial owner of the minted asset.
Emits Issued
event when successful.
Weight: O(1)
burn(T::ClassId, T::InstanceId, Option<<T::Lookup as StaticLookup>::Source>)
Destroy a single asset instance.
Origin must be Signed and the sender should be the Admin of the asset class
.
class
: The class of the asset to be burned.instance
: The instance of the asset to be burned.check_owner
: IfSome
then the operation will fail withWrongOwner
unless the asset is owned by this value.
Emits Burned
with the actual amount burned.
Weight: O(1)
Modes: check_owner.is_some()
.
transfer(T::ClassId, T::InstanceId, <T::Lookup as StaticLookup>::Source)
Move an asset from the sender account to another.
Origin must be Signed and the signing account must be either:
- the Admin of the asset
class
; - the Owner of the asset
instance
; - the approved delegate for the asset
instance
(in this case, the approval is reset).
Arguments:
class
: The class of the asset to be transferred.instance
: The instance of the asset to be transferred.dest
: The account to receive ownership of the asset.
Emits Transferred
.
Weight: O(1)
redeposit(T::ClassId, Vec<T::InstanceId>)
Reevaluate the deposits on some assets.
Origin must be Signed and the sender should be the Owner of the asset class
.
class
: The class of the asset to be frozen.instances
: The instances of the asset class whose deposits will be reevaluated.
NOTE: This exists as a best-effort function. Any asset instances 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 instances 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 class is unknown of the signer is not permitted to call it.
Weight: O(instances.len())
freeze(T::ClassId, T::InstanceId)
Disallow further unprivileged transfer of an asset instance.
Origin must be Signed and the sender should be the Freezer of the asset class
.
class
: The class of the asset to be frozen.instance
: The instance of the asset to be frozen.
Emits Frozen
.
Weight: O(1)
thaw(T::ClassId, T::InstanceId)
Re-allow unprivileged transfer of an asset instance.
Origin must be Signed and the sender should be the Freezer of the asset class
.
class
: The class of the asset to be thawed.instance
: The instance of the asset to be thawed.
Emits Thawed
.
Weight: O(1)
freeze_class(T::ClassId)
Disallow further unprivileged transfers for a whole asset class.
Origin must be Signed and the sender should be the Freezer of the asset class
.
class
: The asset class to be frozen.
Emits ClassFrozen
.
Weight: O(1)
thaw_class(T::ClassId)
Re-allow unprivileged transfers for a whole asset class.
Origin must be Signed and the sender should be the Admin of the asset class
.
class
: The class to be thawed.
Emits ClassThawed
.
Weight: O(1)
transfer_ownership(T::ClassId, <T::Lookup as StaticLookup>::Source)
Change the Owner of an asset class.
Origin must be Signed and the sender should be the Owner of the asset class
.
class
: The asset class whose owner should be changed.owner
: The new Owner of this asset class.
Emits OwnerChanged
.
Weight: O(1)
set_team(T::ClassId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source)
Change the Issuer, Admin and Freezer of an asset class.
Origin must be Signed and the sender should be the Owner of the asset class
.
class
: The asset class whose team should be changed.issuer
: The new Issuer of this asset class.admin
: The new Admin of this asset class.freezer
: The new Freezer of this asset class.
Emits TeamChanged
.
Weight: O(1)
approve_transfer(T::ClassId, T::InstanceId, <T::Lookup as StaticLookup>::Source)
Approve an instance to be transferred by a delegated third-party account.
Origin must be Signed and must be the owner of the asset instance
.
class
: The class of the asset to be approved for delegated transfer.instance
: The instance of the asset to be approved for delegated transfer.delegate
: The account to delegate permission to transfer the asset.
Emits ApprovedTransfer
on success.
Weight: O(1)
cancel_approval(T::ClassId, T::InstanceId, Option<<T::Lookup as StaticLookup>::Source>)
Cancel the prior approval for the transfer of an asset by a delegate.
Origin must be either:
- the
Force
origin; Signed
with the signer being the Admin of the assetclass
;Signed
with the signer being the Owner of the assetinstance
;
Arguments:
class
: The class of the asset of whose approval will be cancelled.instance
: The instance of the asset of whose approval will be cancelled.maybe_check_delegate
: IfSome
will ensure that the given account is the one to which permission of transfer is delegated.
Emits ApprovalCancelled
on success.
Weight: O(1)
force_asset_status(T::ClassId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, bool, bool)
Alter the attributes of a given asset.
Origin must be ForceOrigin
.
class
: The identifier of the asset.owner
: The new Owner of this asset.issuer
: The new Issuer of this asset.admin
: The new Admin of this asset.freezer
: The new Freezer of this asset.free_holding
: Whether a deposit is taken for holding an instance of this asset class.is_frozen
: Whether this asset class is frozen except for permissioned/admin instructions.
Emits AssetStatusChanged
with the identity of the asset.
Weight: O(1)
set_attribute(T::ClassId, Option<T::InstanceId>, BoundedVec<u8, T::KeyLimit>, BoundedVec<u8, T::ValueLimit>)
Set an attribute for an asset class or instance.
Origin must be either ForceOrigin
or Signed and the sender should be the Owner of the
asset class
.
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.
class
: The identifier of the asset class whose instance’s metadata to set.maybe_instance
: The identifier of the asset instance 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(T::ClassId, Option<T::InstanceId>, BoundedVec<u8, T::KeyLimit>)
Set an attribute for an asset class or instance.
Origin must be either ForceOrigin
or Signed and the sender should be the Owner of the
asset class
.
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.
class
: The identifier of the asset class whose instance’s metadata to set.instance
: The identifier of the asset instance whose metadata to set.key
: The key of the attribute.value
: The value to which to set the attribute.
Emits AttributeSet
.
Weight: O(1)
set_metadata(T::ClassId, T::InstanceId, BoundedVec<u8, T::StringLimit>, bool)
Set the metadata for an asset instance.
Origin must be either ForceOrigin
or Signed and the sender should be the Owner of the
asset class
.
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.
class
: The identifier of the asset class whose instance’s metadata to set.instance
: The identifier of the asset instance whose metadata to set.data
: The general information of this asset. Limited in length byStringLimit
.is_frozen
: Whether the metadata should be frozen against further changes.
Emits MetadataSet
.
Weight: O(1)
clear_metadata(T::ClassId, T::InstanceId)
Clear the metadata for an asset instance.
Origin must be either ForceOrigin
or Signed and the sender should be the Owner of the
asset instance
.
Any deposit is freed for the asset class owner.
class
: The identifier of the asset class whose instance’s metadata to clear.instance
: The identifier of the asset instance whose metadata to clear.
Emits MetadataCleared
.
Weight: O(1)
set_class_metadata(T::ClassId, BoundedVec<u8, T::StringLimit>, bool)
Set the metadata for an asset class.
Origin must be either ForceOrigin
or Signed
and the sender should be the Owner of
the asset class
.
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.
class
: The identifier of the asset whose metadata to update.data
: The general information of this asset. Limited in length byStringLimit
.is_frozen
: Whether the metadata should be frozen against further changes.
Emits ClassMetadataSet
.
Weight: O(1)
clear_class_metadata(T::ClassId)
Clear the metadata for an asset class.
Origin must be either ForceOrigin
or Signed
and the sender should be the Owner of
the asset class
.
Any deposit is freed for the asset class owner.
class
: The identifier of the asset class whose metadata to clear.
Emits ClassMetadataCleared
.
Weight: O(1)
Trait Implementations
Attempt to deserialise the value from input.
Attempt to skip the encoded value from input. Read more
fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
Convert self to a slice and append it to the destination.
fn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R,
Convert self to a slice and then invoke the given closure with it.
fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
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
Dispatch this call but do not check the filter in origin.
Auto Trait Implementations
impl<T, I> RefUnwindSafe for Call<T, I> where
I: RefUnwindSafe,
T: RefUnwindSafe,
<T as Config<I>>::ClassId: RefUnwindSafe,
<T as Config<I>>::InstanceId: RefUnwindSafe,
<T as Config<I>>::KeyLimit: RefUnwindSafe,
<<T as Config>::Lookup as StaticLookup>::Source: RefUnwindSafe,
<T as Config<I>>::StringLimit: RefUnwindSafe,
<T as Config<I>>::ValueLimit: RefUnwindSafe,
impl<T, I> Send for Call<T, I> where
I: Send,
T: Send,
<T as Config<I>>::KeyLimit: Send,
<<T as Config>::Lookup as StaticLookup>::Source: Send,
<T as Config<I>>::StringLimit: Send,
<T as Config<I>>::ValueLimit: Send,
impl<T, I> Sync for Call<T, I> where
I: Sync,
T: Sync,
<T as Config<I>>::KeyLimit: Sync,
<<T as Config>::Lookup as StaticLookup>::Source: Sync,
<T as Config<I>>::StringLimit: Sync,
<T as Config<I>>::ValueLimit: Sync,
impl<T, I> Unpin for Call<T, I> where
I: Unpin,
T: Unpin,
<T as Config<I>>::ClassId: Unpin,
<T as Config<I>>::InstanceId: Unpin,
<T as Config<I>>::KeyLimit: Unpin,
<<T as Config>::Lookup as StaticLookup>::Source: Unpin,
<T as Config<I>>::StringLimit: Unpin,
<T as Config<I>>::ValueLimit: Unpin,
impl<T, I> UnwindSafe for Call<T, I> where
I: UnwindSafe,
T: UnwindSafe,
<T as Config<I>>::ClassId: UnwindSafe,
<T as Config<I>>::InstanceId: UnwindSafe,
<T as Config<I>>::KeyLimit: UnwindSafe,
<<T as Config>::Lookup as StaticLookup>::Source: UnwindSafe,
<T as Config<I>>::StringLimit: UnwindSafe,
<T as Config<I>>::ValueLimit: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
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
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
T: Encode,
impl<'_, T> EncodeLike<&'_ T> for T where
T: Encode,
impl<'_, T> EncodeLike<&'_ mut T> for T where
T: Encode,
impl<T> EncodeLike<Arc<T>> for T where
T: Encode,
impl<T> EncodeLike<Rc<T>> for T where
T: Encode,
impl<T> MaybeDebug for T where
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,