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>;
    type AssetId: Parameter + Member + Clone + MaybeSerializeDeserialize + MaxEncodedLen + Ord;
    type MaximumIssuance: Get<<<Self as Config>::Fungibles as FungiblesInspect<<Self as Config>::AccountId>>::Balance>;
    type ManagerOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = PsmManagerLevel>;
    type WeightInfo: WeightInfo;
    type InternalAsset: FungibleMutate<Self::AccountId, Balance = <<Self as Config>::Fungibles as FungiblesInspect<<Self as Config>::AccountId>>::Balance> + FungibleMetadataInspect<Self::AccountId>;
    type FeeDestination: Get<Self::AccountId>;
    type PalletId: Get<PalletId>;
    type MinSwapAmount: Get<<<Self as Config>::Fungibles as FungiblesInspect<<Self as Config>::AccountId>>::Balance>;
    type MaxExternalAssets: 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>

Fungibles implementation for both internal and external stablecoins.

Source

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

Asset identifier type.

Source

type MaximumIssuance: Get<<<Self as Config>::Fungibles as FungiblesInspect<<Self as Config>::AccountId>>::Balance>

Maximum allowed internal issuance across the entire system.

Source

type ManagerOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = PsmManagerLevel>

Origin allowed to update PSM parameters.

Returns PsmManagerLevel to distinguish privilege levels:

  • Full (via GeneralAdmin): Can modify all parameters
  • Emergency (via EmergencyAction): Can modify circuit breaker status, per-asset ceiling weights, and the global max PSM debt ratio.
Source

type WeightInfo: WeightInfo

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

Source

type InternalAsset: FungibleMutate<Self::AccountId, Balance = <<Self as Config>::Fungibles as FungiblesInspect<<Self as Config>::AccountId>>::Balance> + FungibleMetadataInspect<Self::AccountId>

The internal asset as a single-asset fungible type.

Typically ItemOf<Asset, InternalAssetId, AccountId>. Must use the same Balance type as Asset.

Source

type FeeDestination: Get<Self::AccountId>

Account that receives internal fees from minting and redemption.

Must exist before any swap; initialized at genesis and migration via Pallet::ensure_account_exists.

Source

type PalletId: Get<PalletId>

PalletId for deriving the PSM account.

Source

type MinSwapAmount: Get<<<Self as Config>::Fungibles as FungiblesInspect<<Self as Config>::AccountId>>::Balance>

Minimum swap amount.

Source

type MaxExternalAssets: Get<u32>

Maximum number of approved external assets.

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§