Trait pallet_assets::pallet::Config
source · pub trait Config<I: 'static = ()>: Config {
Show 19 associated items
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>;
type Balance: Member + Parameter + AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize + MaxEncodedLen + TypeInfo;
type RemoveItemsLimit: Get<u32>;
type AssetId: Member + Parameter + Clone + MaybeSerializeDeserialize + MaxEncodedLen;
type AssetIdParameter: Parameter + From<Self::AssetId> + Into<Self::AssetId> + MaxEncodedLen;
type Currency: ReservableCurrency<Self::AccountId>;
type CreateOrigin: EnsureOriginWithArg<Self::RuntimeOrigin, Self::AssetId, Success = Self::AccountId>;
type ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type AssetDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>;
type AssetAccountDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>;
type MetadataDepositBase: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>;
type MetadataDepositPerByte: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>;
type ApprovalDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>;
type StringLimit: Get<u32>;
type Freezer: FrozenBalance<Self::AssetId, Self::AccountId, Self::Balance>;
type Extra: Member + Parameter + Default + MaxEncodedLen;
type CallbackHandle: AssetsCallback<Self::AssetId, Self::AccountId>;
type WeightInfo: WeightInfo;
type BenchmarkHelper: BenchmarkHelper<Self::AssetIdParameter>;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.
Consequently, a runtime that wants to include this pallet must implement this trait. The module configuration trait.
Required Associated Types§
sourcetype RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
sourcetype Balance: Member + Parameter + AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize + MaxEncodedLen + TypeInfo
type Balance: Member + Parameter + AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize + MaxEncodedLen + TypeInfo
The units in which we record balances.
sourcetype RemoveItemsLimit: Get<u32>
type RemoveItemsLimit: Get<u32>
Max number of items to destroy per destroy_accounts
and destroy_approvals
call.
Must be configured to result in a weight that makes each call fit in a block.
sourcetype AssetId: Member + Parameter + Clone + MaybeSerializeDeserialize + MaxEncodedLen
type AssetId: Member + Parameter + Clone + MaybeSerializeDeserialize + MaxEncodedLen
Identifier for the class of asset.
sourcetype AssetIdParameter: Parameter + From<Self::AssetId> + Into<Self::AssetId> + MaxEncodedLen
type AssetIdParameter: Parameter + From<Self::AssetId> + Into<Self::AssetId> + MaxEncodedLen
Wrapper around Self::AssetId
to use in dispatchable call signatures. Allows the use
of compact encoding in instances of the pallet, which will prevent breaking changes
resulting from the removal of HasCompact
from Self::AssetId
.
This type includes the From<Self::AssetId>
bound, since tightly coupled pallets may
want to convert an AssetId
into a parameter for calling dispatchable functions
directly.
sourcetype CreateOrigin: EnsureOriginWithArg<Self::RuntimeOrigin, Self::AssetId, Success = Self::AccountId>
type CreateOrigin: EnsureOriginWithArg<Self::RuntimeOrigin, Self::AssetId, Success = Self::AccountId>
Standard asset class creation is only allowed if the origin attempting it and the asset class are in this set.
sourcetype ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>
type ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>
The origin which may forcibly create or destroy an asset or otherwise alter privileged attributes.
sourcetype AssetDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>
type AssetDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>
The basic amount of funds that must be reserved for an asset.
sourcetype AssetAccountDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>
type AssetAccountDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>
The amount of funds that must be reserved for a non-provider asset account to be maintained.
sourcetype MetadataDepositBase: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>
type MetadataDepositBase: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>
The basic amount of funds that must be reserved when adding metadata to your asset.
sourcetype MetadataDepositPerByte: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>
type MetadataDepositPerByte: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>
The additional funds that must be reserved for the number of bytes you store in your metadata.
sourcetype ApprovalDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>
type ApprovalDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>
The amount of funds that must be reserved when creating a new approval.
sourcetype StringLimit: Get<u32>
type StringLimit: Get<u32>
The maximum length of a name or symbol stored on-chain.
sourcetype Freezer: FrozenBalance<Self::AssetId, Self::AccountId, Self::Balance>
type Freezer: FrozenBalance<Self::AssetId, Self::AccountId, Self::Balance>
A hook to allow a per-asset, per-account minimum balance to be enforced. This must be respected in all permissionless operations.
sourcetype Extra: Member + Parameter + Default + MaxEncodedLen
type Extra: Member + Parameter + Default + MaxEncodedLen
Additional data to be stored with an account’s asset balance.
sourcetype CallbackHandle: AssetsCallback<Self::AssetId, Self::AccountId>
type CallbackHandle: AssetsCallback<Self::AssetId, Self::AccountId>
Callback methods for asset state change (e.g. asset created or destroyed)
Types implementing the AssetsCallback
can be chained when listed together as a
tuple.
The AutoIncAssetId
callback, in conjunction with the NextAssetId
, can be
used to set up auto-incrementing asset IDs for this collection.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.
sourcetype BenchmarkHelper: BenchmarkHelper<Self::AssetIdParameter>
type BenchmarkHelper: BenchmarkHelper<Self::AssetIdParameter>
Helper trait for benchmarks.