Enum pallet_assets::pallet::Call[][src]

pub enum Call<T: Config<I>, I: 'static = ()> {
Show variants create(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance), force_create(T::AssetId, <T::Lookup as StaticLookup>::Sourcebool, T::Balance), destroy(T::AssetIdDestroyWitness), mint(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance), burn(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance), transfer(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance), transfer_keep_alive(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance), force_transfer(T::AssetId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, T::Balance), freeze(T::AssetId, <T::Lookup as StaticLookup>::Source), thaw(T::AssetId, <T::Lookup as StaticLookup>::Source), freeze_asset(T::AssetId), thaw_asset(T::AssetId), transfer_ownership(T::AssetId, <T::Lookup as StaticLookup>::Source), set_team(T::AssetId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source), set_metadata(T::AssetIdVec<u8>, Vec<u8>, u8), clear_metadata(T::AssetId), force_set_metadata(T::AssetIdVec<u8>, Vec<u8>, u8bool), force_clear_metadata(T::AssetId), force_asset_status(T::AssetId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, T::Balanceboolbool), approve_transfer(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance), cancel_approval(T::AssetId, <T::Lookup as StaticLookup>::Source), force_cancel_approval(T::AssetId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source), transfer_approved(T::AssetId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, T::Balance), // some variants omitted
}
Expand description

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

Variants

create(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance)

Issue a new class of 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.

Funds of sender are reserved by AssetDeposit.

Parameters:

Emits Created event when successful.

Weight: O(1)

force_create(T::AssetId, <T::Lookup as StaticLookup>::Sourcebool, T::Balance)

Issue a new class of 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.

Emits ForceCreated event when successful.

Weight: O(1)

destroy(T::AssetIdDestroyWitness)

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 id.

Emits Destroyed event when successful.

NOTE: It can be helpful to first freeze an asset before destroying it so that you can provide accurate witness information and prevent users from manipulating state in a way that can make it harder to destroy.

Weight: O(c + p + a) where:

mint(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance)

Mint assets of a particular class.

The origin must be Signed and the sender must be the Issuer of the asset id.

Emits Issued event when successful.

Weight: O(1) Modes: Pre-existing balance of beneficiary; Account pre-existence of beneficiary.

burn(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance)

Reduce the balance of who by as much as possible up to amount assets of id.

Origin must be Signed and the sender should be the Manager of the asset id.

Bails with BalanceZero if the who is already dead.

Emits Burned with the actual amount burned. If this takes the balance to below the minimum for the asset, then the amount burned is increased to take it to zero.

Weight: O(1) Modes: Post-existence of who; Pre & post Zombie-status of who.

transfer(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance)

Move some assets from the sender account to another.

Origin must be Signed.

Emits Transferred with the actual amount transferred. If this takes the source balance to below the minimum for the asset, then the amount transferred is increased to take it to zero.

Weight: O(1) Modes: Pre-existence of target; Post-existence of sender; Account pre-existence of target.

transfer_keep_alive(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance)

Move some assets from the sender account to another, keeping the sender account alive.

Origin must be Signed.

Emits Transferred with the actual amount transferred. If this takes the source balance to below the minimum for the asset, then the amount transferred is increased to take it to zero.

Weight: O(1) Modes: Pre-existence of target; Post-existence of sender; Account pre-existence of target.

force_transfer(T::AssetId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, T::Balance)

Move some assets from one account to another.

Origin must be Signed and the sender should be the Admin of the asset id.

Emits Transferred with the actual amount transferred. If this takes the source balance to below the minimum for the asset, then the amount transferred is increased to take it to zero.

Weight: O(1) Modes: Pre-existence of dest; Post-existence of source; Account pre-existence of dest.

freeze(T::AssetId, <T::Lookup as StaticLookup>::Source)

Disallow further unprivileged transfers from an account.

Origin must be Signed and the sender should be the Freezer of the asset id.

Emits Frozen.

Weight: O(1)

thaw(T::AssetId, <T::Lookup as StaticLookup>::Source)

Allow unprivileged transfers from an account again.

Origin must be Signed and the sender should be the Admin of the asset id.

Emits Thawed.

Weight: O(1)

freeze_asset(T::AssetId)

Disallow further unprivileged transfers for the asset class.

Origin must be Signed and the sender should be the Freezer of the asset id.

Emits Frozen.

Weight: O(1)

thaw_asset(T::AssetId)

Allow unprivileged transfers for the asset again.

Origin must be Signed and the sender should be the Admin of the asset id.

Emits Thawed.

Weight: O(1)

transfer_ownership(T::AssetId, <T::Lookup as StaticLookup>::Source)

Change the Owner of an asset.

Origin must be Signed and the sender should be the Owner of the asset id.

Emits OwnerChanged.

Weight: O(1)

set_team(T::AssetId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source)

Change the Issuer, Admin and Freezer of an asset.

Origin must be Signed and the sender should be the Owner of the asset id.

Emits TeamChanged.

Weight: O(1)

set_metadata(T::AssetIdVec<u8>, Vec<u8>, u8)

Set the metadata for an asset.

Origin must be Signed and the sender should be the Owner of the asset id.

Funds of sender are reserved according to the formula: MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len) taking into account any already reserved funds.

Emits MetadataSet.

Weight: O(1)

clear_metadata(T::AssetId)

Clear the metadata for an asset.

Origin must be Signed and the sender should be the Owner of the asset id.

Any deposit is freed for the asset owner.

Emits MetadataCleared.

Weight: O(1)

force_set_metadata(T::AssetIdVec<u8>, Vec<u8>, u8bool)

Force the metadata for an asset to some value.

Origin must be ForceOrigin.

Any deposit is left alone.

Emits MetadataSet.

Weight: O(N + S) where N and S are the length of the name and symbol respectively.

force_clear_metadata(T::AssetId)

Clear the metadata for an asset.

Origin must be ForceOrigin.

Any deposit is returned.

Emits MetadataCleared.

Weight: O(1)

force_asset_status(T::AssetId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, T::Balanceboolbool)

Alter the attributes of a given asset.

Origin must be ForceOrigin.

Emits AssetStatusChanged with the identity of the asset.

Weight: O(1)

approve_transfer(T::AssetId, <T::Lookup as StaticLookup>::Source, T::Balance)

Approve an amount of asset for transfer by a delegated third-party account.

Origin must be Signed.

Ensures that ApprovalDeposit worth of Currency is reserved from signing account for the purpose of holding the approval. If some non-zero amount of assets is already approved from signing account to delegate, then it is topped up or unreserved to meet the right value.

NOTE: The signing account does not need to own amount of assets at the point of making this call.

Emits ApprovedTransfer on success.

Weight: O(1)

cancel_approval(T::AssetId, <T::Lookup as StaticLookup>::Source)

Cancel all of some asset approved for delegated transfer by a third-party account.

Origin must be Signed and there must be an approval in place between signer and delegate.

Unreserves any deposit previously reserved by approve_transfer for the approval.

Emits ApprovalCancelled on success.

Weight: O(1)

force_cancel_approval(T::AssetId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source)

Cancel all of some asset approved for delegated transfer by a third-party account.

Origin must be either ForceOrigin or Signed origin with the signer being the Admin account of the asset id.

Unreserves any deposit previously reserved by approve_transfer for the approval.

Emits ApprovalCancelled on success.

Weight: O(1)

transfer_approved(T::AssetId, <T::Lookup as StaticLookup>::Source, <T::Lookup as StaticLookup>::Source, T::Balance)

Transfer some asset balance from a previously delegated account to some third-party account.

Origin must be Signed and there must be an approval in place by the owner to the signer.

If the entire amount approved for transfer is transferred, then any deposit previously reserved by approve_transfer is unreserved.

Emits TransferredApproved on success.

Weight: O(1)

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 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

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. 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

Performs the conversion.

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

Performs the conversion.

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.

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.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. 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.