Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DOT and USDT to chains #17

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions packages/xcm-cfg/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ export const assetHub = new Parachain({
id: 1337,
palletInstance: 50,
},
{
asset: dot,
decimals: 10,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand All @@ -101,6 +105,14 @@ export const astar = new Parachain({
asset: astr,
metadataId: 0,
},
{
asset: dot,
id: 340282366920938463463374607431768211455n,
},
{
asset: usdt,
id: 4294969280,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down Expand Up @@ -130,6 +142,12 @@ export const bifrost = new Parachain({
metadataId: { Token2: 0 },
decimals: 10,
},
{
asset: usdt,
id: { Token2: 2 },
metadataId: { Token2: 2 },
decimals: 6,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down Expand Up @@ -310,6 +328,18 @@ export const interlay = new Parachain({
id: { Token: intr.originSymbol },
metadataId: 0,
},
{
asset: dot,
decimals: 10,
id: { Token: dot.originSymbol },
metadataId: 0,
},
{
asset: usdt,
decimals: 6,
id: { Token: usdt.originSymbol },
metadataId: 0,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down Expand Up @@ -363,6 +393,16 @@ export const moonbeam = new EvmParachain({
metadataId: 0,
decimals: 18,
},
{
asset: dot,
id: '42259045809535163221576417993425387648',
decimals: 10,
},
{
asset: usdt,
id: '311091173110107856861649819128533077277',
decimals: 6,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down
36 changes: 33 additions & 3 deletions packages/xcm-cfg/src/configs/astar.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BalanceBuilder } from '@moonbeam-network/xcm-builder';
import { BalanceBuilder, ExtrinsicBuilder } from '@moonbeam-network/xcm-builder';
import { AssetConfig, ChainConfig } from '@moonbeam-network/xcm-config';

import { astr } from '../assets';
import { astar, hydraDX } from '../chains';
import { astr, dot, usdt } from '../assets';
import { assetHub, astar, hydraDX } from '../chains';
import { ExtrinsicBuilderV2 } from '../builders';

const toHydraDX: AssetConfig[] = [
Expand All @@ -20,6 +20,36 @@ const toHydraDX: AssetConfig[] = [
.reserveTransferAssets()
.here(),
}),
new AssetConfig({
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
destination: hydraDX,
destinationFee: {
amount: 0.044306118,
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
fee: {
asset: astr,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().system().account(),
destination: hydraDX,
destinationFee: {
amount: 0.00222,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(assetHub.parachainId).X3(),
fee: {
asset: astr,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

export const astarConfig = new ChainConfig({
Expand Down
21 changes: 18 additions & 3 deletions packages/xcm-cfg/src/configs/bifrost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
} from '@moonbeam-network/xcm-builder';
import { AssetConfig, ChainConfig } from '@moonbeam-network/xcm-config';

import { bnc, vdot, dot } from '../assets';
import { bifrost, hydraDX } from '../chains';
import { bnc, vdot, dot, usdt } from '../assets';
import { assetHub, bifrost, hydraDX } from '../chains';
import { ExtrinsicBuilderV2 } from '../builders';

const toHydraDX: AssetConfig[] = [
Expand Down Expand Up @@ -40,7 +40,7 @@ const toHydraDX: AssetConfig[] = [
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: hydraDX,
destinationFee: {
amount: 0.0013,
amount: 0.0007,
asset: dot,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
Expand All @@ -50,6 +50,21 @@ const toHydraDX: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
}
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: hydraDX,
destinationFee: {
amount: 0.0007,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(assetHub.parachainId).X3(),
fee: {
asset: bnc,
balance: BalanceBuilder().substrate().system().account(),
}
}),
];

export const bifrostConfig = new ChainConfig({
Expand Down
97 changes: 97 additions & 0 deletions packages/xcm-cfg/src/configs/hydraDX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,36 @@ const toAstar: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: dot,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: astar,
destinationFee: {
amount: 0.00222,
asset: dot,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: astar,
destinationFee: {
amount: 0.0222,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(assetHub.parachainId).X3(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

const toBifrost: AssetConfig[] = [
Expand Down Expand Up @@ -197,6 +227,21 @@ const toBifrost: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: bifrost,
destinationFee: {
amount: 0.000222,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(assetHub.parachainId).X3(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

const toCentrifuge: AssetConfig[] = [
Expand Down Expand Up @@ -248,6 +293,36 @@ const toInterlay: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: dot,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: interlay,
destinationFee: {
amount: 0.00222,
asset: dot,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: interlay,
destinationFee: {
amount: 0.0222,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(assetHub.parachainId).X3(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

const toMoonbeam: AssetConfig[] = [
Expand Down Expand Up @@ -353,6 +428,28 @@ const toMoonbeam: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
destination: moonbeam,
destinationFee: {
amount: FeeBuilder().assetManager().assetTypeUnitsPerSecond(),
asset: dot,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().system().account(),
destination: moonbeam,
destinationFee: {
amount: FeeBuilder().assetManager().assetTypeUnitsPerSecond(),
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(assetHub.parachainId).X3(),
}),
];

const toPolkadot: AssetConfig[] = [
Expand Down
35 changes: 33 additions & 2 deletions packages/xcm-cfg/src/configs/interlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import {
} from '@moonbeam-network/xcm-builder';
import { AssetConfig, ChainConfig } from '@moonbeam-network/xcm-config';

import { ibtc, intr } from '../assets';
import { hydraDX, interlay } from '../chains';
import { ibtc, intr, dot, usdt } from '../assets';
import { assetHub, hydraDX, interlay } from '../chains';
import { ExtrinsicBuilderV2 } from 'builders';

const toHydraDX: AssetConfig[] = [
new AssetConfig({
Expand Down Expand Up @@ -34,6 +35,36 @@ const toHydraDX: AssetConfig[] = [
balance: BalanceBuilder().substrate().tokens().accounts(),
},
}),
new AssetConfig({
asset: dot,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: hydraDX,
destinationFee: {
amount: 0.0022,
asset: dot,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
fee: {
asset: intr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: hydraDX,
destinationFee: {
amount: 0.0222,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(assetHub.parachainId).X3(),
fee: {
asset: intr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
}),
];

export const interlayConfig = new ChainConfig({
Expand Down
32 changes: 32 additions & 0 deletions packages/xcm-cfg/src/configs/moonbeam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
usdt_mwh,
wbtc_mwh,
weth_mwh,
dot,
usdt
} from '../assets';
import { hydraDX, moonbeam } from '../chains';

Expand Down Expand Up @@ -114,6 +116,36 @@ const toHydraDX: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: dot,
balance: BalanceBuilder().substrate().assets().account(),
contract: ContractBuilder().Xtokens().transfer(),
destination: hydraDX,
destinationFee: {
amount: 0.00222,
asset: dot,
balance: BalanceBuilder().substrate().assets().account(),
},
fee: {
asset: glmr,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(),
contract: ContractBuilder().Xtokens().transfer(),
destination: hydraDX,
destinationFee: {
amount: 0.00222,
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(),
},
fee: {
asset: glmr,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

export const moonbeamConfig = new ChainConfig({
Expand Down