Skip to content

Commit

Permalink
added moonbeam & hub xcm locations
Browse files Browse the repository at this point in the history
  • Loading branch information
nohaapav committed Dec 4, 2024
1 parent 4d1b175 commit 4087d16
Show file tree
Hide file tree
Showing 2 changed files with 264 additions and 14 deletions.
274 changes: 262 additions & 12 deletions packages/xcm-cfg/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,23 +220,35 @@ export const assetHub = new Parachain({
id: 1984,
min: 0.7,
palletInstance: 50,
xcmLocation: {
parents: 0,
interior: {
X2: [
{
PalletInstance: 50,
},
{
GeneralIndex: 1984,
},
],
},
},
},
{
asset: usdc,
decimals: 6,
id: 1337,
min: 0.7,
palletInstance: 50,
},
{
asset: myth,
decimals: 18,
xcmLocation: {
parents: 1,
parents: 0,
interior: {
X1: [
X2: [
{
Parachain: 3369,
PalletInstance: 50,
},
{
GeneralIndex: 1337,
},
],
},
Expand All @@ -247,24 +259,91 @@ export const assetHub = new Parachain({
decimals: 10,
id: 23,
palletInstance: 50,
xcmLocation: {
parents: 0,
interior: {
X2: [
{
PalletInstance: 50,
},
{
GeneralIndex: 23,
},
],
},
},
},
{
asset: ded,
decimals: 10,
id: 30,
palletInstance: 50,
xcmLocation: {
parents: 0,
interior: {
X2: [
{
PalletInstance: 50,
},
{
GeneralIndex: 30,
},
],
},
},
},
{
asset: dota,
decimals: 4,
id: 18,
palletInstance: 50,
xcmLocation: {
parents: 0,
interior: {
X2: [
{
PalletInstance: 50,
},
{
GeneralIndex: 18,
},
],
},
},
},
{
asset: wud,
decimals: 10,
id: 31337,
palletInstance: 50,
xcmLocation: {
parents: 0,
interior: {
X2: [
{
PalletInstance: 50,
},
{
GeneralIndex: 31337,
},
],
},
},
},
// foreign assets
{
asset: myth,
decimals: 18,
xcmLocation: {
parents: 1,
interior: {
X1: [
{
Parachain: 3369,
},
],
},
},
},
],
ecosystem: Ecosystem.Polkadot,
Expand Down Expand Up @@ -1435,62 +1514,233 @@ export const moonbeam = new EvmParachain({
asset: glmr,
id: '0x0000000000000000000000000000000000000802',
min: 0.1,
xcmLocation: {
parents: 0,
interior: {
X1: [
{
PalletInstance: 10,
},
],
},
},
},
{
asset: dai_mwh,
decimals: 18,
id: '0x06e605775296e851FF43b4dAa541Bb0984E9D6fD',
xcmLocation: {
parents: 0,
interior: {
X2: [
{
PalletInstance: 110,
},
{
AccountKey20: {
network: null,
key: '0x06e605775296e851ff43b4daa541bb0984e9d6fd',
},
},
],
},
},
},
{
asset: usdc_mwh,
decimals: 6,
id: '0x931715FEE2d06333043d11F658C8CE934aC61D0c',
xcmLocation: {
parents: 0,
interior: {
X2: [
{
PalletInstance: 110,
},
{
AccountKey20: {
network: null,
key: '0x931715FEE2d06333043d11F658C8CE934aC61D0c',
},
},
],
},
},
},
{
asset: usdt_mwh,
decimals: 6,
id: '0xc30E9cA94CF52f3Bf5692aaCF81353a27052c46f',
xcmLocation: {
parents: 0,
interior: {
X2: [
{
PalletInstance: 110,
},
{
AccountKey20: {
network: null,
key: '0xc30E9cA94CF52f3Bf5692aaCF81353a27052c46f',
},
},
],
},
},
},
{
asset: wbtc_mwh,
decimals: 8,
id: '0xE57eBd2d67B462E9926e04a8e33f01cD0D64346D',
xcmLocation: {
parents: 0,
interior: {
X2: [
{
PalletInstance: 110,
},
{
AccountKey20: {
network: null,
key: '0xE57eBd2d67B462E9926e04a8e33f01cD0D64346D',
},
},
],
},
},
},
{
asset: weth_mwh,
decimals: 18,
id: '0xab3f0245B83feB11d15AAffeFD7AD465a59817eD',
},
{
asset: usdc,
decimals: 6,
id: '0xFFfffffF7D2B0B761Af01Ca8e25242976ac0aD7D',
xcmLocation: {
parents: 0,
interior: {
X2: [
{
PalletInstance: 110,
},
{
AccountKey20: {
network: null,
key: '0xab3f0245B83feB11d15AAffeFD7AD465a59817eD',
},
},
],
},
},
},
// xc-20 assets
{
asset: aca,
decimals: 12,
id: '224821240862170613278369189818311486111',
xcmLocation: {
parents: 1,
interior: {
X2: [
{
Parachain: 2000,
},
{
GeneralKey: {
length: 2,
data: '0x0000000000000000000000000000000000000000000000000000000000000000',
},
},
],
},
},
},
{
asset: dot,
decimals: 10,
id: '42259045809535163221576417993425387648',
xcmLocation: {
parents: 1,
interior: 'Here',
},
},
{
asset: hdx,
decimals: 12,
id: '69606720909260275826784788104880799692',
xcmLocation: {
parents: 1,
interior: {
X2: [
{
Parachain: 2034,
},
{
GeneralIndex: 0,
},
],
},
},
},
{
asset: pink,
decimals: 10,
id: '64174511183114006009298114091987195453',
xcmLocation: {
parents: 1,
interior: {
X3: [
{
Parachain: 1000,
},
{
PalletInstance: 50,
},
{
GeneralIndex: 23,
},
],
},
},
},
{
asset: usdc,
decimals: 6,
id: '166377000701797186346254371275954761085',
xcmLocation: {
parents: 1,
interior: {
X3: [
{
Parachain: 1000,
},
{
PalletInstance: 50,
},
{
GeneralIndex: 1337,
},
],
},
},
},
{
asset: usdt,
decimals: 6,
id: '311091173110107856861649819128533077277',
xcmLocation: {
parents: 1,
interior: {
X3: [
{
Parachain: 1000,
},
{
PalletInstance: 50,
},
{
GeneralIndex: 1984,
},
],
},
},
},
],
ecosystem: Ecosystem.Polkadot,
Expand Down
4 changes: 2 additions & 2 deletions packages/xcm-cfg/src/configs/polkadot/moonbeam/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ const toAssetHub: AssetRoute[] = [
new AssetRoute({
source: {
asset: usdc,
balance: BalanceBuilder().evm().erc20(),
balance: BalanceBuilder().substrate().assets().account(),
fee: {
asset: glmr,
balance: BalanceBuilder().substrate().system().account(),
},
destinationFee: {
balance: BalanceBuilder().evm().erc20(),
balance: BalanceBuilder().substrate().assets().account(),
},
},
destination: {
Expand Down

0 comments on commit 4087d16

Please sign in to comment.