referrerpolicy=no-referrer-when-downgrade

Trait pallet_asset_conversion::pallet::Config

source ·
pub trait Config: Config {
Show 19 associated items type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>; type Balance: Balance; type HigherPrecisionBalance: IntegerSquareRoot + One + Ensure + Unsigned + From<u32> + From<Self::Balance> + TryInto<Self::Balance>; type AssetKind: Parameter + MaxEncodedLen; type Assets: Inspect<Self::AccountId, AssetId = Self::AssetKind, Balance = Self::Balance> + Mutate<Self::AccountId> + AccountTouch<Self::AssetKind, Self::AccountId, Balance = Self::Balance> + Balanced<Self::AccountId> + Refund<Self::AccountId, AssetId = Self::AssetKind>; type PoolId: Parameter + MaxEncodedLen + Ord; type PoolLocator: PoolLocator<Self::AccountId, Self::AssetKind, Self::PoolId>; type PoolAssetId: AssetId + PartialOrd + Incrementable + From<u32>; type PoolAssets: Inspect<Self::AccountId, AssetId = Self::PoolAssetId, Balance = Self::Balance> + Create<Self::AccountId> + Mutate<Self::AccountId> + AccountTouch<Self::PoolAssetId, Self::AccountId, Balance = Self::Balance> + Refund<Self::AccountId, AssetId = Self::PoolAssetId>; type LPFee: Get<u32>; type PoolSetupFee: Get<Self::Balance>; type PoolSetupFeeAsset: Get<Self::AssetKind>; type PoolSetupFeeTarget: OnUnbalanced<CreditOf<Self>>; type LiquidityWithdrawalFee: Get<Permill>; type MintMinLiquidity: Get<Self::Balance>; type MaxSwapPathLength: Get<u32>; type PalletId: Get<PalletId>; type WeightInfo: WeightInfo; type BenchmarkHelper: BenchmarkHelper<Self::AssetKind>;
}
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 RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>

Overarching event type.

source

type Balance: Balance

The type in which the assets for swapping are measured.

source

type HigherPrecisionBalance: IntegerSquareRoot + One + Ensure + Unsigned + From<u32> + From<Self::Balance> + TryInto<Self::Balance>

A type used for calculations concerning the Balance type to avoid possible overflows.

source

type AssetKind: Parameter + MaxEncodedLen

Type of asset class, sourced from Config::Assets, utilized to offer liquidity to a pool.

source

type Assets: Inspect<Self::AccountId, AssetId = Self::AssetKind, Balance = Self::Balance> + Mutate<Self::AccountId> + AccountTouch<Self::AssetKind, Self::AccountId, Balance = Self::Balance> + Balanced<Self::AccountId> + Refund<Self::AccountId, AssetId = Self::AssetKind>

Registry of assets utilized for providing liquidity to pools.

source

type PoolId: Parameter + MaxEncodedLen + Ord

Liquidity pool identifier.

source

type PoolLocator: PoolLocator<Self::AccountId, Self::AssetKind, Self::PoolId>

Provides means to resolve the Config::PoolId and it’s AccountId from a pair of Config::AssetKinds.

Examples: crate::types::WithFirstAsset, crate::types::Ascending.

source

type PoolAssetId: AssetId + PartialOrd + Incrementable + From<u32>

Asset class for the lp tokens from Self::PoolAssets.

source

type PoolAssets: Inspect<Self::AccountId, AssetId = Self::PoolAssetId, Balance = Self::Balance> + Create<Self::AccountId> + Mutate<Self::AccountId> + AccountTouch<Self::PoolAssetId, Self::AccountId, Balance = Self::Balance> + Refund<Self::AccountId, AssetId = Self::PoolAssetId>

Registry for the lp tokens. Ideally only this pallet should have create permissions on the assets.

source

type LPFee: Get<u32>

A % the liquidity providers will take of every swap. Represents 10ths of a percent.

source

type PoolSetupFee: Get<Self::Balance>

A one-time fee to setup the pool.

source

type PoolSetupFeeAsset: Get<Self::AssetKind>

Asset class from Config::Assets used to pay the Config::PoolSetupFee.

source

type PoolSetupFeeTarget: OnUnbalanced<CreditOf<Self>>

Handler for the Config::PoolSetupFee.

source

type LiquidityWithdrawalFee: Get<Permill>

A fee to withdraw the liquidity.

source

type MintMinLiquidity: Get<Self::Balance>

The minimum LP token amount that could be minted. Ameliorates rounding errors.

source

type MaxSwapPathLength: Get<u32>

The max number of hops in a swap.

source

type PalletId: Get<PalletId>

The pallet’s id, used for deriving its sovereign account ID.

source

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

source

type BenchmarkHelper: BenchmarkHelper<Self::AssetKind>

The benchmarks need a way to create asset ids from u32s.

Object Safety§

This trait is not object safe.

Implementors§