diff --git a/tinkernet/runtime/src/rings/asset_hub.rs b/tinkernet/runtime/src/rings/asset_hub.rs index bc8e9d58..7d1c7810 100644 --- a/tinkernet/runtime/src/rings/asset_hub.rs +++ b/tinkernet/runtime/src/rings/asset_hub.rs @@ -8,6 +8,7 @@ pub struct AssetHub; #[derive(Encode, Decode, Clone, Eq, PartialEq, MaxEncodedLen, Debug, TypeInfo)] pub enum AssetHubAssets { KSM, + Local(u32), } impl RingsChain for AssetHub { @@ -20,6 +21,10 @@ impl RingsChain for AssetHub { parents: 1, interior: Junctions::Here, }, + Local(asset_id) => MultiLocation { + parents: 0, + interior: Junctions::X2(Junction::PalletKey(50), Junction::GeneralIndex(*asset_id)), + }, } } diff --git a/tinkernet/runtime/src/rings/mod.rs b/tinkernet/runtime/src/rings/mod.rs index e57db494..531f390e 100644 --- a/tinkernet/runtime/src/rings/mod.rs +++ b/tinkernet/runtime/src/rings/mod.rs @@ -18,6 +18,8 @@ mod karura; use karura::Karura; mod moonriver; use moonriver::Moonriver; +mod kusama; +use kusama::Kusama; parameter_types! { pub MaxXCMCallLength: u32 = 100_000; @@ -47,6 +49,7 @@ pub enum Chains { Shiden, Karura, Moonriver, + Kusama, } #[derive(Encode, Decode, Clone, Eq, PartialEq, MaxEncodedLen, Debug, TypeInfo)] @@ -57,6 +60,7 @@ pub enum ChainAssets { Shiden(::Assets), Karura(::Assets), Moonriver(::Assets), + Kusama(::Assets), } impl ChainAssetsList for ChainAssets { @@ -70,6 +74,7 @@ impl ChainAssetsList for ChainAssets { Self::Shiden(_) => Chains::Shiden, Self::Karura(_) => Chains::Karura, Self::Moonriver(_) => Chains::Moonriver, + Self::Kusama(_) => Chains::Kusama, } } @@ -81,6 +86,7 @@ impl ChainAssetsList for ChainAssets { Self::Shiden(asset) => Shiden::get_asset_location(asset), Self::Karura(asset) => Karura::get_asset_location(asset), Self::Moonriver(asset) => Moonriver::get_asset_location(asset), + Self::Kusama(asset) => Kusama::get_asset_location(asset), } } } @@ -97,6 +103,7 @@ impl ChainList for Chains { Self::Shiden => Shiden::get_location(), Self::Karura => Karura::get_location(), Self::Moonriver => Moonriver::get_location(), + Self::Kusama => Kusama::get_location(), } } @@ -108,6 +115,7 @@ impl ChainList for Chains { Self::Shiden => ChainAssets::Shiden(Shiden::get_main_asset()), Self::Karura => ChainAssets::Karura(Karura::get_main_asset()), Self::Moonriver => ChainAssets::Moonriver(Moonriver::get_main_asset()), + Self::Kusama => ChainAssets::Kusama(Kusama::get_main_asset()), } } diff --git a/tinkernet/runtime/src/rings/moonriver.rs b/tinkernet/runtime/src/rings/moonriver.rs index bff43d6a..3cd8b2f0 100644 --- a/tinkernet/runtime/src/rings/moonriver.rs +++ b/tinkernet/runtime/src/rings/moonriver.rs @@ -1,5 +1,6 @@ use super::RingsChain; use codec::{Decode, Encode, MaxEncodedLen}; +use frame_support::BoundedSlice; use scale_info::TypeInfo; use xcm::latest::{Junction, Junctions, MultiLocation}; @@ -8,9 +9,56 @@ pub struct Moonriver; #[allow(non_camel_case_types)] #[derive(Encode, Decode, Clone, Eq, PartialEq, MaxEncodedLen, Debug, TypeInfo)] pub enum MoonriverAssets { + /// Moonriver main asset. MOVR, + /// KSM. xcKSM, + /// TNKR. xcTNKR, + /// Tether USD on asset hub. + xcUSDT, + /// RMRK on asset hub. + xcRMRK, + /// Karura aSEED (aUSD). + xcaSeed, + /// Karura. + xcKAR, + /// Bifrost Voucher KSM. + xcvKSM, + /// Bifrost Voucher BNC. + xcvBNC, + /// Bifrost Voucher MOVR. + xcvMOVR, + /// Bifrost. + xcBNC, + /// Phala. + xcPHA, + /// Shiden. + xcSDN, + /// Crust Shadow Native Token. + xcCSM, + /// Integritee. + xcTEER, + /// Robonomics Native Token + xcXRT, + /// Calamari. + xcKMA, + /// Parallel Heiko. + xcHKO, + /// Picasso. + xcPICA, + /// Kintsugi Wrapped BTC. + xcKBTC, + /// Kintsugi Native Token. + xcKINT, + /// Crab Parachain Token. + xcCRAB, + /// Litmus. + xcLIT, + /// Mangata X Native Token. + xcMGX, + /// Turing Network. + xcTUR, Erc20([u8; 20]), } @@ -32,6 +80,135 @@ impl RingsChain for Moonriver { parents: 1, interior: Junctions::X2(Junction::Parachain(2125), Junction::GeneralIndex(0)), }, + xcUSDT => MultiLocation { + parents: 1, + interior: Junctions::X3( + Junction::Parachain(1000), + Junction::PalletInstance(50), + Junction::GeneralIndex(1984), + ), + }, + xcRMRK => MultiLocation { + parents: 1, + interior: Junctions::X3( + Junction::Parachain(1000), + Junction::PalletInstance(50), + Junction::GeneralIndex(8), + ), + }, + xcaSeed => MultiLocation { + parents: 1, + interior: Junctions::X2( + Junction::Parachain(2000), + Junction::from(BoundedSlice::truncate_from(&hex_literal::hex!("0081"))), + ), + }, + xcKAR => MultiLocation { + parents: 1, + interior: Junctions::X2( + Junction::Parachain(2000), + Junction::from(BoundedSlice::truncate_from(&hex_literal::hex!("0080"))), + ), + }, + xcvKSM => MultiLocation { + parents: 1, + interior: Junctions::X2( + Junction::Parachain(2001), + Junction::from(BoundedSlice::truncate_from(&hex_literal::hex!("0104"))), + ), + }, + xcvBNC => MultiLocation { + parents: 1, + interior: Junctions::X2( + Junction::Parachain(2001), + Junction::from(BoundedSlice::truncate_from(&hex_literal::hex!("0101"))), + ), + }, + xcvMOVR => MultiLocation { + parents: 1, + interior: Junctions::X2( + Junction::Parachain(2001), + Junction::from(BoundedSlice::truncate_from(&hex_literal::hex!("010a"))), + ), + }, + xcBNC => MultiLocation { + parents: 1, + interior: Junctions::X2( + Junction::Parachain(2001), + Junction::from(BoundedSlice::truncate_from(&hex_literal::hex!("0001"))), + ), + }, + xcPHA => MultiLocation { + parents: 1, + interior: Junctions::X1(Junction::Parachain(2004)), + }, + xcSDN => MultiLocation { + parents: 1, + interior: Junctions::X1(Junction::Parachain(2007)), + }, + xcCSM => MultiLocation { + parents: 1, + interior: Junctions::X1(Junction::Parachain(2012)), + }, + xcTEER => MultiLocation { + parents: 1, + interior: Junctions::X2( + Junction::Parachain(2015), + Junction::from(BoundedSlice::truncate_from(&hex_literal::hex!("54454552"))), + ), + }, + xcXRT => MultiLocation { + parents: 1, + interior: Junctions::X1(Junction::Parachain(2048)), + }, + xcKMA => MultiLocation { + parents: 1, + interior: Junctions::X1(Junction::Parachain(2084)), + }, + xcHKO => MultiLocation { + parents: 1, + interior: Junctions::X2( + Junction::Parachain(2085), + Junction::from(BoundedSlice::truncate_from(&hex_literal::hex!("484b4f"))), + ), + }, + xcPICA => MultiLocation { + parents: 1, + interior: Junctions::X1(Junction::Parachain(2087)), + }, + xcKBTC => MultiLocation { + parents: 1, + interior: Junctions::X2( + Junction::Parachain(2092), + Junction::from(BoundedSlice::truncate_from(&hex_literal::hex!("000b"))), + ), + }, + xcKINT => MultiLocation { + parents: 1, + interior: Junctions::X2( + Junction::Parachain(2092), + Junction::from(BoundedSlice::truncate_from(&hex_literal::hex!("000c"))), + ), + }, + xcCRAB => MultiLocation { + parents: 1, + interior: Junctions::X2(Junction::Parachain(2105), Junction::PalletInstance(5)), + }, + xcLIT => MultiLocation { + parents: 1, + interior: Junctions::X2(Junction::Parachain(2106), Junction::PalletInstance(10)), + }, + xcMGX => MultiLocation { + parents: 1, + interior: Junctions::X2( + Junsction::Parachain(2110), + Junction::from(BoundedSlice::truncate_from(&hex_literal::hex!("00000000"))), + ), + }, + xcTUR => MultiLocation { + parents: 1, + interior: Junctions::X1(Junction::Parachain(2114)), + }, Erc20(address) => MultiLocation { parents: 0, interior: Junctions::X2(