referrerpolicy=no-referrer-when-downgrade

Config

Trait Config 

Source
pub trait Config: Config + Config<RuntimeEvent: From<Event<Self>>> {
    type Fungibles: FungiblesMutate<Self::AccountId, AssetId = Self::AssetId> + FungiblesMetadataInspect<Self::AccountId> + FungiblesRolesInspect<Self::AccountId>;
    type Consideration: Consideration<Self::AccountId, Footprint>;
    type CreateOrigin: EnsureOriginWithArg<<Self as Config>::RuntimeOrigin, Self::AssetId, Success = Option<Self::AccountId>>;
    type RuntimeOrigin: OriginTrait<PalletsOrigin = Self::PalletsOrigin> + From<Self::PalletsOrigin> + IsType<<Self as Config>::RuntimeOrigin>;
    type PalletsOrigin: Parameter + From<RawOrigin<Self::AccountId>> + CallerTrait<Self::AccountId> + MaxEncodedLen;
    type AssetId: Parameter + Member + Clone + MaybeSerializeDeserialize + MaxEncodedLen + Ord;
    type WeightInfo: WeightInfo;
    type PalletId: Get<PalletId>;
    type MaxExternals: Get<u32>;
    type BenchmarkHelper: BenchmarkHelper<Self::AssetId, Self::AccountId>;
}
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.

Required Associated Types§

Source

type Fungibles: FungiblesMutate<Self::AccountId, AssetId = Self::AssetId> + FungiblesMetadataInspect<Self::AccountId> + FungiblesRolesInspect<Self::AccountId>

Fungibles implementation for both internal and external assets.

Source

type Consideration: Consideration<Self::AccountId, Footprint>

Consideration for PSM creation. Runtimes can price this from the PSM footprint or anything else they choose.

Source

type CreateOrigin: EnsureOriginWithArg<<Self as Config>::RuntimeOrigin, Self::AssetId, Success = Option<Self::AccountId>>

Origin permitted to create a PSM for a given internal asset; succeeds with the optional account that pays the creation consideration. Returning None creates without a deposit, useful for privileged origins such as Root.

Source

type RuntimeOrigin: OriginTrait<PalletsOrigin = Self::PalletsOrigin> + From<Self::PalletsOrigin> + IsType<<Self as Config>::RuntimeOrigin>

The aggregated origin, tying the runtime origin to Config::PalletsOrigin so PSM admins can be matched against incoming origins.

Source

type PalletsOrigin: Parameter + From<RawOrigin<Self::AccountId>> + CallerTrait<Self::AccountId> + MaxEncodedLen

The caller origin, overarching type of all pallets’ origins. Stored as a PSM’s full_admin / emergency_admin and matched against incoming origins.

Source

type AssetId: Parameter + Member + Clone + MaybeSerializeDeserialize + MaxEncodedLen + Ord

Asset identifier type.

Source

type WeightInfo: WeightInfo

A type representing the weights required by the dispatchables of this pallet.

Source

type PalletId: Get<PalletId>

PalletId for deriving each PSM instance’s reserve sub-account.

Source

type MaxExternals: Get<u32>

Maximum number of approved external assets per PSM instance.

Source

type BenchmarkHelper: BenchmarkHelper<Self::AssetId, Self::AccountId>

Helper for benchmarks to create an external asset with correct metadata.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§