1234567891011121314151617use frame_support::{parameter_types, traits::Everything};18use frame_system::EnsureSigned;19use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key};20use pallet_foreign_assets::CurrencyIdConvert;21use sp_runtime::traits::Convert;22use staging_xcm::latest::prelude::*;23use staging_xcm_executor::XcmExecutor;24use up_common::{25 constants::*,26 types::{AccountId, Balance},27};28use up_data_structs::CollectionId;2930use crate::{31 runtime_common::config::xcm::{SelfLocation, UniversalLocation, Weigher, XcmExecutorConfig},32 RelayChainBlockNumberProvider, Runtime, RuntimeEvent,33};343536pub type Amount = i128;3738parameter_types! {39 pub const MinVestedTransfer: Balance = 10 * UNIQUE;40 pub const MaxVestingSchedules: u32 = 28;4142 pub const BaseXcmWeight: Weight = Weight::from_parts(100_000_000, 1000); 43 pub const MaxAssetsForTransfer: usize = 2;44}4546parameter_type_with_key! {47 pub ParachainMinFee: |_location: Location| -> Option<u128> {48 Some(100_000_000_000)49 };50}5152pub struct AccountIdToLocation;53impl Convert<AccountId, Location> for AccountIdToLocation {54 fn convert(account: AccountId) -> Location {55 AccountId32 {56 network: None,57 id: account.into(),58 }59 .into()60 }61}6263impl orml_vesting::Config for Runtime {64 type RuntimeEvent = RuntimeEvent;65 type Currency = pallet_balances::Pallet<Runtime>;66 type MinVestedTransfer = MinVestedTransfer;67 type VestedTransferOrigin = EnsureSigned<AccountId>;68 type WeightInfo = ();69 type MaxVestingSchedules = MaxVestingSchedules;70 type BlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;71}7273impl orml_xtokens::Config for Runtime {74 type RuntimeEvent = RuntimeEvent;75 type Balance = Balance;76 type CurrencyId = CollectionId;77 type CurrencyIdConvert = CurrencyIdConvert<Self>;78 type AccountIdToLocation = AccountIdToLocation;79 type SelfLocation = SelfLocation;80 type XcmExecutor = XcmExecutor<XcmExecutorConfig<Self>>;81 type Weigher = Weigher;82 type BaseXcmWeight = BaseXcmWeight;83 type MaxAssetsForTransfer = MaxAssetsForTransfer;84 type MinXcmFee = ParachainMinFee;85 type LocationsFilter = Everything;86 type ReserveProvider = AbsoluteReserveProvider;87 type UniversalLocation = UniversalLocation;88 type RateLimiter = ();89 type RateLimiterId = ();90}