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

CFG assets #25

Closed
wants to merge 1 commit 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
15 changes: 15 additions & 0 deletions packages/xcm-cfg/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,21 @@ export const centrifuge = new Parachain({
asset: cfg,
id: 'Native',
},
{
asset: dot,
id: { ForeignAsset: 5 },
decimals: 10,
},
{
asset: usdt,
id: { ForeignAsset: 1 },
decimals: 6,
},
{
asset: usdc,
id: { ForeignAsset: 6 },
decimals: 6,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down
48 changes: 47 additions & 1 deletion packages/xcm-cfg/src/configs/centrifuge.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 { cfg } from '../assets';
import { cfg, usdt, usdc, dot } from '../assets';
import { centrifuge, hydraDX } from '../chains';
import { BalanceBuilderV2, ExtrinsicBuilderV2 } from 'builders';

const toHydraDX: AssetConfig[] = [
new AssetConfig({
Expand All @@ -19,6 +20,51 @@ const toHydraDX: AssetConfig[] = [
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetConfig({
asset: dot,
balance: BalanceBuilderV2().substrate().ormlTokens().accounts(),
destination: hydraDX,
destinationFee: {
amount: 0.006373834498834048,
asset: cfg,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
fee: {
asset: cfg,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilderV2().substrate().ormlTokens().accounts(),
destination: hydraDX,
destinationFee: {
amount: 1.4,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(1000).X3(),
fee: {
asset: cfg,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdc,
balance: BalanceBuilderV2().substrate().ormlTokens().accounts(),
destination: hydraDX,
destinationFee: {
amount: 1.4,
asset: usdc,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(1000).X3(),
fee: {
asset: cfg,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

export const centrifugeConfig = new ChainConfig({
Expand Down
45 changes: 45 additions & 0 deletions packages/xcm-cfg/src/configs/hydraDX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,51 @@ const toCentrifuge: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: dot,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: centrifuge,
destinationFee: {
amount: 0.01,
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: centrifuge,
destinationFee: {
amount: 1.4,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(1000).X3(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdc,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: centrifuge,
destinationFee: {
amount: 1.4,
asset: usdc,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiasset(1000).X3(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

const toInterlay: AssetConfig[] = [
Expand Down
Loading