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 CRU and comment out AH assets #26

Merged
merged 1 commit into from
Feb 28, 2024
Merged
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
6 changes: 6 additions & 0 deletions packages/xcm-cfg/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,16 @@ export const unq = new Asset({
originSymbol: 'UNQ',
});

export const cru = new Asset({
key: 'cru',
originSymbol: 'CRU',
});

export const assets: Asset[] = [
aca,
astr,
cfg,
cru,
bnc,
dai_awh,
dai_mwh,
Expand Down
24 changes: 24 additions & 0 deletions packages/xcm-cfg/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
weth_mwh,
ztg,
pha,
cru,
} from './assets';

export const acala = new Parachain({
Expand Down Expand Up @@ -308,6 +309,11 @@ export const hydraDX = new Parachain({
id: 8,
decimals: 12,
},
{
asset: cru,
id: 27,
decimals: 12,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down Expand Up @@ -526,12 +532,30 @@ export const unique = new Parachain({
ws: 'wss://unique-rpc.dwellir.com',
});

export const crust = new Parachain({
assetsData: [
{
asset: cru,
id: 0,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
'0x4319cc49ee79495b57a1fec4d2bd43f59052dcc690276de566c2691d6df4f7b8',
key: 'crust',
name: 'Crust network',
parachainId: 2008,
ss58Format: 88,
ws: 'wss://crust-parachain.crustapps.net',
});

export const chains: AnyChain[] = [
acala,
assetHub,
astar,
bifrost,
centrifuge,
crust,
hydraDX,
interlay,
moonbeam,
Expand Down
31 changes: 16 additions & 15 deletions packages/xcm-cfg/src/configs/astar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,22 @@ const toHydraDX: AssetConfig[] = [
},
extrinsic: ExtrinsicBuilderV2().xTokens().transfer()
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(),
destination: hydraDX,
destinationFee: {
amount: 1.4,
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(),
},
fee: {
asset: astr,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transfer()
}),
// TODO: Uncomment with asset hub release 1.7 (jit_withdraw fix)
// new AssetConfig({
// asset: usdt,
// balance: BalanceBuilder().substrate().assets().account(),
// destination: hydraDX,
// destinationFee: {
// amount: 1.4,
// asset: usdt,
// balance: BalanceBuilder().substrate().assets().account(),
// },
// fee: {
// asset: astr,
// balance: BalanceBuilder().substrate().system().account(),
// },
// extrinsic: ExtrinsicBuilderV2().xTokens().transfer()
// }),
];

export const astarConfig = new ChainConfig({
Expand Down
31 changes: 16 additions & 15 deletions packages/xcm-cfg/src/configs/bifrost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,22 @@ const toHydraDX: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: hydraDX,
destinationFee: {
amount: 1.4,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transfer(),
fee: {
asset: bnc,
balance: BalanceBuilder().substrate().system().account(),
}
}),
// TODO: Uncomment with asset hub release 1.7 (jit_withdraw fix)
// new AssetConfig({
// asset: usdt,
// balance: BalanceBuilder().substrate().tokens().accounts(),
// destination: hydraDX,
// destinationFee: {
// amount: 1.4,
// asset: usdt,
// balance: BalanceBuilder().substrate().tokens().accounts(),
// },
// extrinsic: ExtrinsicBuilderV2().xTokens().transfer(),
// fee: {
// asset: bnc,
// balance: BalanceBuilder().substrate().system().account(),
// }
// }),
];

const toPolkadot: AssetConfig[] = [
Expand Down
26 changes: 26 additions & 0 deletions packages/xcm-cfg/src/configs/crust.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {
BalanceBuilder,
ExtrinsicBuilder,
} from '@moonbeam-network/xcm-builder';
import { AssetConfig, ChainConfig } from '@moonbeam-network/xcm-config';
import { cru } from '../assets';
import { hydraDX, crust } from '../chains';

const toHydraDX: AssetConfig[] = [
new AssetConfig({
asset: cru,
balance: BalanceBuilder().substrate().system().account(),
destination: hydraDX,
destinationFee: {
amount: 0.01,
asset: cru,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
];

export const crustConfig = new ChainConfig({
assets: [...toHydraDX],
chain: crust,
});
Loading
Loading