Trait pallet_asset_conversion::pallet::Config
source · pub trait Config: Config {
Show 21 associated items
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type Currency: InspectFungible<Self::AccountId, Balance = Self::Balance> + MutateFungible<Self::AccountId>;
type Balance: Balance;
type AssetBalance: Balance;
type HigherPrecisionBalance: IntegerSquareRoot + One + Ensure + Unsigned + From<u32> + From<Self::AssetBalance> + From<Self::Balance> + TryInto<Self::AssetBalance> + TryInto<Self::Balance>;
type AssetId: AssetId;
type MultiAssetId: AssetId + Ord + From<Self::AssetId>;
type MultiAssetIdConverter: MultiAssetIdConverter<Self::MultiAssetId, Self::AssetId>;
type PoolAssetId: AssetId + PartialOrd + Incrementable + From<u32>;
type Assets: Inspect<Self::AccountId, AssetId = Self::AssetId, Balance = Self::AssetBalance> + Mutate<Self::AccountId> + AccountTouch<Self::AssetId, Self::AccountId> + ContainsPair<Self::AssetId, Self::AccountId>;
type PoolAssets: Inspect<Self::AccountId, AssetId = Self::PoolAssetId, Balance = Self::AssetBalance> + Create<Self::AccountId> + Mutate<Self::AccountId> + AccountTouch<Self::PoolAssetId, Self::AccountId>;
type LPFee: Get<u32>;
type PoolSetupFee: Get<Self::Balance>;
type PoolSetupFeeReceiver: Get<Self::AccountId>;
type LiquidityWithdrawalFee: Get<Permill>;
type MintMinLiquidity: Get<Self::AssetBalance>;
type MaxSwapPathLength: Get<u32>;
type PalletId: Get<PalletId>;
type AllowMultiAssetPools: Get<bool>;
type WeightInfo: WeightInfo;
type BenchmarkHelper: BenchmarkHelper<Self::AssetId, Self::MultiAssetId>;
}
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§
sourcetype RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
Overarching event type.
sourcetype Currency: InspectFungible<Self::AccountId, Balance = Self::Balance> + MutateFungible<Self::AccountId>
type Currency: InspectFungible<Self::AccountId, Balance = Self::Balance> + MutateFungible<Self::AccountId>
Currency type that this works on.
sourcetype AssetBalance: Balance
type AssetBalance: Balance
The type used to describe the amount of fractions converted into assets.
sourcetype HigherPrecisionBalance: IntegerSquareRoot + One + Ensure + Unsigned + From<u32> + From<Self::AssetBalance> + From<Self::Balance> + TryInto<Self::AssetBalance> + TryInto<Self::Balance>
type HigherPrecisionBalance: IntegerSquareRoot + One + Ensure + Unsigned + From<u32> + From<Self::AssetBalance> + From<Self::Balance> + TryInto<Self::AssetBalance> + TryInto<Self::Balance>
A type used for conversions between Balance
and AssetBalance
.
sourcetype AssetId: AssetId
type AssetId: AssetId
Identifier for the class of non-native asset.
Note: A From<u32>
bound here would prevent MultiLocation
from being used as an
AssetId
.
sourcetype MultiAssetId: AssetId + Ord + From<Self::AssetId>
type MultiAssetId: AssetId + Ord + From<Self::AssetId>
Type that identifies either the native currency or a token class from Assets
.
Ord
is added because of get_pool_id
.
The pool’s AccountId
is derived from this type. Any changes to the type may
necessitate a migration.
sourcetype MultiAssetIdConverter: MultiAssetIdConverter<Self::MultiAssetId, Self::AssetId>
type MultiAssetIdConverter: MultiAssetIdConverter<Self::MultiAssetId, Self::AssetId>
Type to convert an AssetId
into MultiAssetId
.
sourcetype PoolAssetId: AssetId + PartialOrd + Incrementable + From<u32>
type PoolAssetId: AssetId + PartialOrd + Incrementable + From<u32>
AssetId
to address the lp tokens by.
sourcetype Assets: Inspect<Self::AccountId, AssetId = Self::AssetId, Balance = Self::AssetBalance> + Mutate<Self::AccountId> + AccountTouch<Self::AssetId, Self::AccountId> + ContainsPair<Self::AssetId, Self::AccountId>
type Assets: Inspect<Self::AccountId, AssetId = Self::AssetId, Balance = Self::AssetBalance> + Mutate<Self::AccountId> + AccountTouch<Self::AssetId, Self::AccountId> + ContainsPair<Self::AssetId, Self::AccountId>
Registry for the assets.
sourcetype PoolAssets: Inspect<Self::AccountId, AssetId = Self::PoolAssetId, Balance = Self::AssetBalance> + Create<Self::AccountId> + Mutate<Self::AccountId> + AccountTouch<Self::PoolAssetId, Self::AccountId>
type PoolAssets: Inspect<Self::AccountId, AssetId = Self::PoolAssetId, Balance = Self::AssetBalance> + Create<Self::AccountId> + Mutate<Self::AccountId> + AccountTouch<Self::PoolAssetId, Self::AccountId>
Registry for the lp tokens. Ideally only this pallet should have create permissions on the assets.
sourcetype LPFee: Get<u32>
type LPFee: Get<u32>
A % the liquidity providers will take of every swap. Represents 10ths of a percent.
sourcetype PoolSetupFee: Get<Self::Balance>
type PoolSetupFee: Get<Self::Balance>
A one-time fee to setup the pool.
sourcetype PoolSetupFeeReceiver: Get<Self::AccountId>
type PoolSetupFeeReceiver: Get<Self::AccountId>
An account that receives the pool setup fee.
sourcetype LiquidityWithdrawalFee: Get<Permill>
type LiquidityWithdrawalFee: Get<Permill>
A fee to withdraw the liquidity.
sourcetype MintMinLiquidity: Get<Self::AssetBalance>
type MintMinLiquidity: Get<Self::AssetBalance>
The minimum LP token amount that could be minted. Ameliorates rounding errors.
sourcetype MaxSwapPathLength: Get<u32>
type MaxSwapPathLength: Get<u32>
The max number of hops in a swap.
sourcetype AllowMultiAssetPools: Get<bool>
type AllowMultiAssetPools: Get<bool>
A setting to allow creating pools with both non-native assets.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.
sourcetype BenchmarkHelper: BenchmarkHelper<Self::AssetId, Self::MultiAssetId>
type BenchmarkHelper: BenchmarkHelper<Self::AssetId, Self::MultiAssetId>
The benchmarks need a way to create asset ids from u32s.