Trait pallet_order_book::pallet::Config
source · pub trait Config: Config {
Show 15 associated items
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type AssetRegistry: Inspect<AssetId = Self::CurrencyId, Balance = BalanceOf<Self>>;
type CurrencyId: AssetId + Parameter + Default + Member + Copy + MaybeSerializeDeserialize + Ord;
type OrderIdNonce: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + EnsureAdd + MaybeSerializeDeserialize + MaxEncodedLen;
type BalanceIn: Member + Parameter + FixedPointOperand + AtLeast32BitUnsigned + EnsureMul + EnsureDiv + MaxEncodedLen + Into<BalanceOf<Self>> + From<BalanceOf<Self>>;
type BalanceOut: Member + Parameter + FixedPointOperand + AtLeast32BitUnsigned + EnsureMul + EnsureDiv + MaxEncodedLen + Into<BalanceOf<Self>> + From<BalanceOf<Self>>;
type Currency: AssetInspect<Self::AccountId, AssetId = Self::CurrencyId> + InspectHold<Self::AccountId, Reason = ()> + MutateHold<Self::AccountId> + Mutate<Self::AccountId>;
type Ratio: Parameter + Member + FixedPointNumber + EnsureMul + EnsureDiv + MaybeSerializeDeserialize + MaxEncodedLen;
type MinFulfillmentAmountNative: Get<Self::BalanceOut>;
type NativeDecimals: Get<u32>;
type FulfilledOrderHook: StatusNotificationHook<Id = Self::OrderIdNonce, Status = SwapInfo<Self::BalanceIn, Self::BalanceOut, Self::CurrencyId, Self::Ratio>, Error = DispatchError>;
type FeederId: Parameter + Member + Ord + MaxEncodedLen;
type RatioProvider: ValueProvider<Self::FeederId, (Self::CurrencyId, Self::CurrencyId), Value = Self::Ratio>;
type AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type Weights: 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.
Required Associated Types§
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
sourcetype AssetRegistry: Inspect<AssetId = Self::CurrencyId, Balance = BalanceOf<Self>>
type AssetRegistry: Inspect<AssetId = Self::CurrencyId, Balance = BalanceOf<Self>>
Asset registry for foreign currencies we can take orders for.
sourcetype CurrencyId: AssetId + Parameter + Default + Member + Copy + MaybeSerializeDeserialize + Ord
type CurrencyId: AssetId + Parameter + Default + Member + Copy + MaybeSerializeDeserialize + Ord
CurrencyId that an order can be made for
sourcetype OrderIdNonce: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + EnsureAdd + MaybeSerializeDeserialize + MaxEncodedLen
type OrderIdNonce: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + EnsureAdd + MaybeSerializeDeserialize + MaxEncodedLen
Type used for OrderId. OrderIdNonce ensures each OrderId is unique. OrderIdNonce incremented with each new order.
sourcetype BalanceIn: Member + Parameter + FixedPointOperand + AtLeast32BitUnsigned + EnsureMul + EnsureDiv + MaxEncodedLen + Into<BalanceOf<Self>> + From<BalanceOf<Self>>
type BalanceIn: Member + Parameter + FixedPointOperand + AtLeast32BitUnsigned + EnsureMul + EnsureDiv + MaxEncodedLen + Into<BalanceOf<Self>> + From<BalanceOf<Self>>
Balance type for incoming values
sourcetype BalanceOut: Member + Parameter + FixedPointOperand + AtLeast32BitUnsigned + EnsureMul + EnsureDiv + MaxEncodedLen + Into<BalanceOf<Self>> + From<BalanceOf<Self>>
type BalanceOut: Member + Parameter + FixedPointOperand + AtLeast32BitUnsigned + EnsureMul + EnsureDiv + MaxEncodedLen + Into<BalanceOf<Self>> + From<BalanceOf<Self>>
Balance type for outgoing values
sourcetype Currency: AssetInspect<Self::AccountId, AssetId = Self::CurrencyId> + InspectHold<Self::AccountId, Reason = ()> + MutateHold<Self::AccountId> + Mutate<Self::AccountId>
type Currency: AssetInspect<Self::AccountId, AssetId = Self::CurrencyId> + InspectHold<Self::AccountId, Reason = ()> + MutateHold<Self::AccountId> + Mutate<Self::AccountId>
Type for currency orders can be made for
sourcetype Ratio: Parameter + Member + FixedPointNumber + EnsureMul + EnsureDiv + MaybeSerializeDeserialize + MaxEncodedLen
type Ratio: Parameter + Member + FixedPointNumber + EnsureMul + EnsureDiv + MaybeSerializeDeserialize + MaxEncodedLen
Type for conversion ratios.
It will be factor applied to currency_out
amount to obtain
currency_in
sourcetype MinFulfillmentAmountNative: Get<Self::BalanceOut>
type MinFulfillmentAmountNative: Get<Self::BalanceOut>
The default minimum fulfillment amount for orders.
NOTE: The amount is expected to be denominated in native currency. When applying to a swap order, it will be re-denominated into the target currency.
type NativeDecimals: Get<u32>
sourcetype FulfilledOrderHook: StatusNotificationHook<Id = Self::OrderIdNonce, Status = SwapInfo<Self::BalanceIn, Self::BalanceOut, Self::CurrencyId, Self::Ratio>, Error = DispatchError>
type FulfilledOrderHook: StatusNotificationHook<Id = Self::OrderIdNonce, Status = SwapInfo<Self::BalanceIn, Self::BalanceOut, Self::CurrencyId, Self::Ratio>, Error = DispatchError>
The hook which acts upon a (partially) fulfilled order
sourcetype FeederId: Parameter + Member + Ord + MaxEncodedLen
type FeederId: Parameter + Member + Ord + MaxEncodedLen
Type for a market conversion ratio feeder
sourcetype RatioProvider: ValueProvider<Self::FeederId, (Self::CurrencyId, Self::CurrencyId), Value = Self::Ratio>
type RatioProvider: ValueProvider<Self::FeederId, (Self::CurrencyId, Self::CurrencyId), Value = Self::Ratio>
A way to obtain conversion ratios for market pairs
sourcetype AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>
type AdminOrigin: EnsureOrigin<Self::RuntimeOrigin>
The admin origin of this pallet
sourcetype Weights: WeightInfo
type Weights: WeightInfo
Type for pallet weights