Trait pallet_rewards::pallet::Config
source · pub trait Config<I: 'static = ()>: Config {
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>;
type PalletId: Get<PalletId>;
type CurrencyId: AssetId + MaxEncodedLen + MaybeSerializeDeserialize + Default;
type RewardCurrency: Get<Self::CurrencyId>;
type GroupId: FullCodec + TypeInfo + MaxEncodedLen + Copy + PartialEq + Debug;
type Currency: MutateHold<Self::AccountId, AssetId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance, Reason = ()> + Mutate<Self::AccountId, AssetId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance> + Inspect<Self::AccountId, AssetId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance>;
type RewardMechanism: RewardMechanism;
type RewardIssuance: RewardIssuance<AccountId = Self::AccountId, CurrencyId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance>;
}
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§
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>
sourcetype PalletId: Get<PalletId>
type PalletId: Get<PalletId>
Identifier of this pallet used as an account where stores the reward that is not claimed. When you distribute reward, the amount distributed goes here.
sourcetype CurrencyId: AssetId + MaxEncodedLen + MaybeSerializeDeserialize + Default
type CurrencyId: AssetId + MaxEncodedLen + MaybeSerializeDeserialize + Default
Type used to identify currencies.
sourcetype RewardCurrency: Get<Self::CurrencyId>
type RewardCurrency: Get<Self::CurrencyId>
Identifier for the currency used to give the reward.
sourcetype GroupId: FullCodec + TypeInfo + MaxEncodedLen + Copy + PartialEq + Debug
type GroupId: FullCodec + TypeInfo + MaxEncodedLen + Copy + PartialEq + Debug
Type used to identify groups.
sourcetype Currency: MutateHold<Self::AccountId, AssetId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance, Reason = ()> + Mutate<Self::AccountId, AssetId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance> + Inspect<Self::AccountId, AssetId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance>
type Currency: MutateHold<Self::AccountId, AssetId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance, Reason = ()> + Mutate<Self::AccountId, AssetId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance> + Inspect<Self::AccountId, AssetId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance>
Type used to handle currency transfers and reservations.
sourcetype RewardMechanism: RewardMechanism
type RewardMechanism: RewardMechanism
Specify the internal reward mechanism used by this pallet.
Check available mechanisms at mechanism
module.
sourcetype RewardIssuance: RewardIssuance<AccountId = Self::AccountId, CurrencyId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance>
type RewardIssuance: RewardIssuance<AccountId = Self::AccountId, CurrencyId = Self::CurrencyId, Balance = <<Self as Config<I>>::RewardMechanism as RewardMechanism>::Balance>
Type used to identify the income stream for rewards.