Trait pallet_foreign_investments::pallet::Config
source · pub trait Config: Config {
Show 13 associated items
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type ForeignBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen + Into<Self::SwapBalance> + From<Self::SwapBalance> + Into<Self::PoolBalance>;
type PoolBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen + Into<Self::SwapBalance> + From<Self::SwapBalance> + Into<Self::ForeignBalance>;
type TrancheBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen;
type SwapBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen;
type SwapRatio: Parameter + Member + Copy + MaxEncodedLen + One;
type CurrencyId: Parameter + Member + Copy + MaxEncodedLen;
type InvestmentId: TrancheCurrency<PoolIdOf<Self>, TrancheIdOf<Self>> + Parameter + Copy + MaxEncodedLen;
type Investment: Investment<Self::AccountId, Amount = Self::PoolBalance, TrancheAmount = Self::TrancheBalance, CurrencyId = Self::CurrencyId, Error = DispatchError, InvestmentId = Self::InvestmentId>;
type OrderId: Parameter + Member + Copy + Ord + MaxEncodedLen;
type OrderBook: TokenSwaps<Self::AccountId, CurrencyId = Self::CurrencyId, BalanceIn = Self::SwapBalance, BalanceOut = Self::SwapBalance, Ratio = Self::SwapRatio, OrderId = Self::OrderId>;
type Hooks: ForeignInvestmentHooks<Self::AccountId, Amount = Self::ForeignBalance, TrancheAmount = Self::TrancheBalance, CurrencyId = Self::CurrencyId, InvestmentId = Self::InvestmentId>;
type PoolInspect: PoolInspect<Self::AccountId, Self::CurrencyId>;
}
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. Configure the pallet by specifying the parameters and types on which it depends.
Required Associated Types§
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
sourcetype ForeignBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen + Into<Self::SwapBalance> + From<Self::SwapBalance> + Into<Self::PoolBalance>
type ForeignBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen + Into<Self::SwapBalance> + From<Self::SwapBalance> + Into<Self::PoolBalance>
Represents a foreign amount
sourcetype PoolBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen + Into<Self::SwapBalance> + From<Self::SwapBalance> + Into<Self::ForeignBalance>
type PoolBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen + Into<Self::SwapBalance> + From<Self::SwapBalance> + Into<Self::ForeignBalance>
Represents a pool amount
sourcetype TrancheBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen
type TrancheBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen
Represents a tranche token amount
sourcetype SwapBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen
type SwapBalance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen
Any balances used in TokenSwaps
sourcetype SwapRatio: Parameter + Member + Copy + MaxEncodedLen + One
type SwapRatio: Parameter + Member + Copy + MaxEncodedLen + One
Ratio used for swapping amounts
sourcetype CurrencyId: Parameter + Member + Copy + MaxEncodedLen
type CurrencyId: Parameter + Member + Copy + MaxEncodedLen
The currency type of transferrable tokens
sourcetype InvestmentId: TrancheCurrency<PoolIdOf<Self>, TrancheIdOf<Self>> + Parameter + Copy + MaxEncodedLen
type InvestmentId: TrancheCurrency<PoolIdOf<Self>, TrancheIdOf<Self>> + Parameter + Copy + MaxEncodedLen
The investment identifying type required for the investment type
sourcetype Investment: Investment<Self::AccountId, Amount = Self::PoolBalance, TrancheAmount = Self::TrancheBalance, CurrencyId = Self::CurrencyId, Error = DispatchError, InvestmentId = Self::InvestmentId>
type Investment: Investment<Self::AccountId, Amount = Self::PoolBalance, TrancheAmount = Self::TrancheBalance, CurrencyId = Self::CurrencyId, Error = DispatchError, InvestmentId = Self::InvestmentId>
The internal investment type which handles the actual investment on top of the wrapper implementation of this Pallet
sourcetype OrderId: Parameter + Member + Copy + Ord + MaxEncodedLen
type OrderId: Parameter + Member + Copy + Ord + MaxEncodedLen
An identification for a swap order
sourcetype OrderBook: TokenSwaps<Self::AccountId, CurrencyId = Self::CurrencyId, BalanceIn = Self::SwapBalance, BalanceOut = Self::SwapBalance, Ratio = Self::SwapRatio, OrderId = Self::OrderId>
type OrderBook: TokenSwaps<Self::AccountId, CurrencyId = Self::CurrencyId, BalanceIn = Self::SwapBalance, BalanceOut = Self::SwapBalance, Ratio = Self::SwapRatio, OrderId = Self::OrderId>
The type which exposes token swap order functionality
sourcetype Hooks: ForeignInvestmentHooks<Self::AccountId, Amount = Self::ForeignBalance, TrancheAmount = Self::TrancheBalance, CurrencyId = Self::CurrencyId, InvestmentId = Self::InvestmentId>
type Hooks: ForeignInvestmentHooks<Self::AccountId, Amount = Self::ForeignBalance, TrancheAmount = Self::TrancheBalance, CurrencyId = Self::CurrencyId, InvestmentId = Self::InvestmentId>
The hook type which acts upon a finalized investment decrement.
sourcetype PoolInspect: PoolInspect<Self::AccountId, Self::CurrencyId>
type PoolInspect: PoolInspect<Self::AccountId, Self::CurrencyId>
The source of truth for pool currencies.