Trait pallet_investments::pallet::Config
source · pub trait Config: Config {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type InvestmentId: Member + Parameter + Copy + MaxEncodedLen + Into<<<Self as Config>::Tokens as Inspect<<Self as Config>::AccountId>>::AssetId>;
type Accountant: InvestmentAccountant<Self::AccountId, Error = DispatchError, InvestmentId = Self::InvestmentId, Amount = Self::Amount, InvestmentInfo = InvestmentInfo<Self::AccountId, <<Self as Config>::Tokens as Inspect<<Self as Config>::AccountId>>::AssetId, Self::InvestmentId>>;
type Amount: Member + Parameter + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen + FixedPointOperand + From<u64> + From<u128> + TryInto<u64>;
type BalanceRatio: Member + Parameter + Default + Copy + FixedPointNumber<Inner = Self::Amount> + FixedPointNumberExtension + MaxEncodedLen;
type MaxOutstandingCollects: Get<u32>;
type Tokens: Mutate<Self::AccountId> + Inspect<Self::AccountId, Balance = Self::Amount>;
type PreConditions: PreConditions<OrderType<Self::AccountId, Self::InvestmentId, Self::Amount>, Result = DispatchResult>;
type CollectedInvestmentHook: StatusNotificationHook<Error = DispatchError, Id = (Self::AccountId, Self::InvestmentId), Status = CollectedAmount<Self::Amount, Self::Amount>>;
type CollectedRedemptionHook: StatusNotificationHook<Error = DispatchError, Id = (Self::AccountId, Self::InvestmentId), Status = CollectedAmount<Self::Amount, Self::Amount>>;
type WeightInfo: WeightInfo;
}
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§
sourcetype RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
Because this pallet emits events, it depends on the runtime’s definition of an event.
sourcetype InvestmentId: Member + Parameter + Copy + MaxEncodedLen + Into<<<Self as Config>::Tokens as Inspect<<Self as Config>::AccountId>>::AssetId>
type InvestmentId: Member + Parameter + Copy + MaxEncodedLen + Into<<<Self as Config>::Tokens as Inspect<<Self as Config>::AccountId>>::AssetId>
The underlying investments one can invest into
sourcetype Accountant: InvestmentAccountant<Self::AccountId, Error = DispatchError, InvestmentId = Self::InvestmentId, Amount = Self::Amount, InvestmentInfo = InvestmentInfo<Self::AccountId, <<Self as Config>::Tokens as Inspect<<Self as Config>::AccountId>>::AssetId, Self::InvestmentId>>
type Accountant: InvestmentAccountant<Self::AccountId, Error = DispatchError, InvestmentId = Self::InvestmentId, Amount = Self::Amount, InvestmentInfo = InvestmentInfo<Self::AccountId, <<Self as Config>::Tokens as Inspect<<Self as Config>::AccountId>>::AssetId, Self::InvestmentId>>
Something that knows how to handle accounting for the given investments and provides metadata about them
sourcetype Amount: Member + Parameter + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen + FixedPointOperand + From<u64> + From<u128> + TryInto<u64>
type Amount: Member + Parameter + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen + FixedPointOperand + From<u64> + From<u128> + TryInto<u64>
A representation for an investment or redemption. Usually this
is equal to the known Balance
type of a system.
sourcetype BalanceRatio: Member + Parameter + Default + Copy + FixedPointNumber<Inner = Self::Amount> + FixedPointNumberExtension + MaxEncodedLen
type BalanceRatio: Member + Parameter + Default + Copy + FixedPointNumber<Inner = Self::Amount> + FixedPointNumberExtension + MaxEncodedLen
A fixed-point number which represents the value of one currency type in terms of another.
sourcetype MaxOutstandingCollects: Get<u32>
type MaxOutstandingCollects: Get<u32>
The bound on how many fulfilled orders we cache until the user needs to collect them.
sourcetype Tokens: Mutate<Self::AccountId> + Inspect<Self::AccountId, Balance = Self::Amount>
type Tokens: Mutate<Self::AccountId> + Inspect<Self::AccountId, Balance = Self::Amount>
Something that can handle payments and transfers of currencies
sourcetype PreConditions: PreConditions<OrderType<Self::AccountId, Self::InvestmentId, Self::Amount>, Result = DispatchResult>
type PreConditions: PreConditions<OrderType<Self::AccountId, Self::InvestmentId, Self::Amount>, Result = DispatchResult>
A possible check if investors fulfill every condition to invest into a given investment
sourcetype CollectedInvestmentHook: StatusNotificationHook<Error = DispatchError, Id = (Self::AccountId, Self::InvestmentId), Status = CollectedAmount<Self::Amount, Self::Amount>>
type CollectedInvestmentHook: StatusNotificationHook<Error = DispatchError, Id = (Self::AccountId, Self::InvestmentId), Status = CollectedAmount<Self::Amount, Self::Amount>>
The hook which acts upon a collected investment.
NOTE: NOOP if the investment is not foreign.
sourcetype CollectedRedemptionHook: StatusNotificationHook<Error = DispatchError, Id = (Self::AccountId, Self::InvestmentId), Status = CollectedAmount<Self::Amount, Self::Amount>>
type CollectedRedemptionHook: StatusNotificationHook<Error = DispatchError, Id = (Self::AccountId, Self::InvestmentId), Status = CollectedAmount<Self::Amount, Self::Amount>>
The hook which acts upon a (partially) fulfilled order
NOTE: NOOP if the redemption is not foreign.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
The weight information for this pallet extrinsics.