Skip to content

Commit

Permalink
Fix missing vDOT, INTR, SUB config
Browse files Browse the repository at this point in the history
  • Loading branch information
nohaapav committed Dec 6, 2023
1 parent 54b86b7 commit f9677bb
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 4 deletions.
20 changes: 19 additions & 1 deletion packages/xcm/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,30 @@ import {
glmr,
hdx,
ibtc,
intr,
usdc,
usdt,
vdot,
wbtc,
weth,
ztg,
} from '@moonbeam-network/xcm-config';

export { aca, astr, bnc, cfg, dot, glmr, hdx, ibtc, usdc, usdt, ztg };
export {
aca,
astr,
bnc,
cfg,
dot,
glmr,
hdx,
intr,
ibtc,
usdc,
usdt,
vdot,
ztg,
};

export const dai_awh = new Asset({
...dai,
Expand Down Expand Up @@ -64,9 +80,11 @@ export const assets: Asset[] = [
glmr,
hdx,
ibtc,
intr,
sub,
usdc,
usdt,
vdot,
wbtc_awh,
wbtc_mwh,
weth_awh,
Expand Down
23 changes: 23 additions & 0 deletions packages/xcm/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ import {
glmr,
hdx,
ibtc,
intr,
sub,
usdc,
usdt,
vdot,
wbtc_awh,
wbtc_mwh,
weth_awh,
Expand Down Expand Up @@ -105,6 +107,11 @@ export const bifrost = new Parachain({
asset: bnc,
id: { Native: bnc.originSymbol },
},
{
asset: vdot,
id: { VToken2: 0 },
metadataId: { VToken2: 0 },
},
],
});

Expand Down Expand Up @@ -166,6 +173,11 @@ export const hydraDX = new Parachain({
id: 11,
decimals: 8,
},
{
asset: intr,
id: 17,
decimals: 10,
},
{
asset: usdc,
id: 1337,
Expand All @@ -182,6 +194,11 @@ export const hydraDX = new Parachain({
palletInstance: 50,
decimals: 6,
},
{
asset: vdot,
id: 15,
decimals: 10,
},
{
asset: wbtc_awh,
id: 3,
Expand Down Expand Up @@ -219,6 +236,12 @@ export const interlay = new Parachain({
id: { Token: ibtc.originSymbol },
metadataId: 0,
},
{
asset: intr,
decimals: 10,
id: { Token: intr.originSymbol },
metadataId: 0,
},
],
});

Expand Down
13 changes: 12 additions & 1 deletion packages/xcm/src/configs/bifrost.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BalanceBuilder } from '@moonbeam-network/xcm-builder';
import { AssetConfig, ChainConfig } from '@moonbeam-network/xcm-config';

import { bnc } from '../assets';
import { bnc, vdot } from '../assets';
import { bifrost, hydraDX } from '../chains';
import { ExtrinsicBuilderV3 } from '../builders';

Expand All @@ -17,6 +17,17 @@ const toHydraDX: AssetConfig[] = [
},
extrinsic: ExtrinsicBuilderV3().xTokens().transfer(),
}),
new AssetConfig({
asset: vdot,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: hydraDX,
destinationFee: {
amount: 0.000555,
asset: vdot,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilderV3().xTokens().transfer(),
}),
];

export const bifrostConfig = new ChainConfig({
Expand Down
53 changes: 53 additions & 0 deletions packages/xcm/src/configs/hydraDX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ import {
glmr,
hdx,
ibtc,
intr,
sub,
usdc,
usdt,
vdot,
wbtc_awh,
wbtc_mwh,
weth_awh,
Expand All @@ -37,6 +40,7 @@ import {
hydraDX,
interlay,
moonbeam,
subsocial,
zeitgeist,
} from '../chains';
import { ExtrinsicBuilderV3 } from '../builders';
Expand Down Expand Up @@ -156,6 +160,21 @@ const toBifrost: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: vdot,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: bifrost,
destinationFee: {
amount: 0.0000000703,
asset: vdot,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV3().xTokens().transfer(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

const toCentrifuge: AssetConfig[] = [
Expand Down Expand Up @@ -192,6 +211,21 @@ const toInterlay: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: intr,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: interlay,
destinationFee: {
amount: 0.0019213457,
asset: intr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV3().xTokens().transfer(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

const toMoonbeam: AssetConfig[] = [
Expand Down Expand Up @@ -287,6 +321,24 @@ const toPolkadot: AssetConfig[] = [
}),
];

const toSubsocial: AssetConfig[] = [
new AssetConfig({
asset: sub,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: subsocial,
destinationFee: {
amount: 0.064,
asset: sub,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV3().xTokens().transfer(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

const toZeitgeist: AssetConfig[] = [
new AssetConfig({
asset: ztg,
Expand Down Expand Up @@ -315,6 +367,7 @@ export const hydraDxConfig = new ChainConfig({
...toInterlay,
...toMoonbeam,
...toPolkadot,
...toSubsocial,
...toZeitgeist,
],
chain: hydraDX,
Expand Down
6 changes: 5 additions & 1 deletion packages/xcm/src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { hydraDxConfig } from './hydraDX';
import { interlayConfig } from './interlay';
import { moonbeamConfig } from './moonbeam';
import { polkadotConfig } from './polkadot';
import { subsocialConfig } from './subsocial';
import { zeitgeistConfig } from './zeitgeist';

export const chainsConfig: ChainConfig[] = [
Expand All @@ -21,7 +22,10 @@ export const chainsConfig: ChainConfig[] = [
interlayConfig,
moonbeamConfig,
polkadotConfig,
subsocialConfig,
zeitgeistConfig,
];

export const chainsConfigMap = new Map<string, ChainConfig>(chainsConfig.map((config) => [config.chain.key, config]));
export const chainsConfigMap = new Map<string, ChainConfig>(
chainsConfig.map((config) => [config.chain.key, config])
);
13 changes: 12 additions & 1 deletion packages/xcm/src/configs/interlay.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BalanceBuilder } from '@moonbeam-network/xcm-builder';
import { AssetConfig, ChainConfig } from '@moonbeam-network/xcm-config';

import { ibtc } from '../assets';
import { ibtc, intr } from '../assets';
import { hydraDX, interlay } from '../chains';
import { ExtrinsicBuilderV3 } from '../builders';

Expand All @@ -17,6 +17,17 @@ const toHydraDX: AssetConfig[] = [
},
extrinsic: ExtrinsicBuilderV3().xTokens().transfer(),
}),
new AssetConfig({
asset: intr,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: hydraDX,
destinationFee: {
amount: 0.136389,
asset: intr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV3().xTokens().transfer(),
}),
];

export const interlayConfig = new ChainConfig({
Expand Down
33 changes: 33 additions & 0 deletions packages/xcm/src/configs/subsocial.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { AssetMinBuilder, BalanceBuilder } from '@moonbeam-network/xcm-builder';
import { AssetConfig, ChainConfig } from '@moonbeam-network/xcm-config';

import { sub } from '../assets';
import { hydraDX, subsocial } from '../chains';
import { ExtrinsicBuilderV3 } from '../builders';

const toHydraDX: AssetConfig[] = [
new AssetConfig({
asset: sub,
balance: BalanceBuilder().substrate().system().account(),
destination: hydraDX,
destinationFee: {
amount: 0.0003525641,
asset: sub,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilderV3()
.polkadotXcm()
.limitedReserveTransferAssets()
.X2(),
fee: {
asset: sub,
balance: BalanceBuilder().substrate().system().account(),
},
min: AssetMinBuilder().assets().asset(),
}),
];

export const subsocialConfig = new ChainConfig({
assets: [...toHydraDX],
chain: subsocial,
});

0 comments on commit f9677bb

Please sign in to comment.