Skip to content

Commit

Permalink
Merge pull request #36 from galacticcouncil/ah-bifrost-usdt-c-pink
Browse files Browse the repository at this point in the history
Add PINK, USDT & USDC to AH<>Bifrost
  • Loading branch information
nohaapav authored Mar 28, 2024
2 parents a23f205 + e716796 commit 433caa0
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 6 deletions.
20 changes: 19 additions & 1 deletion packages/xcm-cfg/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,27 @@ export const bifrost = new Parachain({
},
{
asset: usdt,
id: { Token2: 2 },
balanceId: { Token2: 2 },
id: 1984,
metadataId: { Token2: 2 },
decimals: 6,
palletInstance: 50,
},
{
asset: usdc,
id: 1337,
balanceId: { Token2: 5 },
metadataId: { Token2: 5 },
decimals: 6,
palletInstance: 50,
},
{
asset: pink,
balanceId: { Token2: 10 },
id: 23,
metadataId: 23,
decimals: 10,
palletInstance: 50,
},
],
ecosystem: Ecosystem.Polkadot,
Expand Down
67 changes: 65 additions & 2 deletions packages/xcm-cfg/src/configs/assethub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@moonbeam-network/xcm-config';

import { ded, dot, pink, usdc, usdt } from '../assets';
import { assetHub, hydraDX, moonbeam } from '../chains';
import { assetHub, bifrost, hydraDX, moonbeam } from '../chains';
import { ExtrinsicBuilderV2 } from '../builders';

const xcmDeliveryFeeAmount = 0.036;
Expand Down Expand Up @@ -185,7 +185,70 @@ const toMoonbeam: AssetConfig[] = [
}),
];

const toBifrost: AssetConfig[] = [
new AssetConfig({
asset: pink,
balance: BalanceBuilder().substrate().assets().account(),
destination: bifrost,
destinationFee: {
amount: 0.0001,
asset: pink,
balance: BalanceBuilder().substrate().assets().account(),
},
extrinsic: ExtrinsicBuilderV2()
.polkadotXcm()
.limitedReserveTransferAssets()
.X2(),
fee: {
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount,
},
min: AssetMinBuilder().assets().asset(),
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(),
destination: bifrost,
destinationFee: {
amount: 0.03,
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(),
},
extrinsic: ExtrinsicBuilder()
.polkadotXcm()
.limitedReserveTransferAssets()
.X2(),
fee: {
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount,
},
min: AssetMinBuilder().assets().asset(),
}),
new AssetConfig({
asset: usdc,
balance: BalanceBuilder().substrate().assets().account(),
destination: bifrost,
destinationFee: {
amount: 0.03,
asset: usdc,
balance: BalanceBuilder().substrate().assets().account(),
},
extrinsic: ExtrinsicBuilder()
.polkadotXcm()
.limitedReserveTransferAssets()
.X2(),
fee: {
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount,
},
min: AssetMinBuilder().assets().asset(),
}),
];

export const assetHubConfig = new ChainConfig({
assets: [...toHydraDX, ...toPolkadot, ...toMoonbeam],
assets: [...toHydraDX, ...toPolkadot, ...toMoonbeam, ...toBifrost],
chain: assetHub,
});
55 changes: 52 additions & 3 deletions packages/xcm-cfg/src/configs/bifrost.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BalanceBuilder } from '@moonbeam-network/xcm-builder';
import { AssetConfig, ChainConfig, polkadot } from '@moonbeam-network/xcm-config';
import { AssetConfig, ChainConfig, polkadot, usdc } from '@moonbeam-network/xcm-config';

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

const toHydraDX: AssetConfig[] = [
Expand Down Expand Up @@ -83,10 +83,59 @@ const toPolkadot: AssetConfig[] = [
}),
];

const toAssetHub: AssetConfig[] = [
new AssetConfig({
asset: pink,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: assetHub,
destinationFee: {
amount: 0.18,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiassets().X3(),
fee: {
asset: bnc,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: assetHub,
destinationFee: {
amount: 0.11,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiassets().X3(),
fee: {
asset: bnc,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdc,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: assetHub,
destinationFee: {
amount: 0.11,
asset: usdc,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transferMultiassets().X3(),
fee: {
asset: bnc,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

export const bifrostConfig = new ChainConfig({
assets: [
...toHydraDX,
...toPolkadot,
...toAssetHub,
],
chain: bifrost,
});

0 comments on commit 433caa0

Please sign in to comment.