Skip to content

Commit

Permalink
Merge pull request #33 from galacticcouncil/add-pink-ded
Browse files Browse the repository at this point in the history
Memecoins go xchain
  • Loading branch information
nohaapav authored Mar 22, 2024
2 parents 5689b5c + ed44558 commit a24e851
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/xcm-cfg/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ export const unq = new Asset({
originSymbol: 'UNQ',
});

export const pink = new Asset({
key: 'pink',
originSymbol: 'PINK',
});

export const ded = new Asset({
key: 'ded',
originSymbol: 'DED',
});

export const assets: Asset[] = [
aca,
astr,
Expand Down Expand Up @@ -150,6 +160,8 @@ export const assets: Asset[] = [
weth_mwh,
ztg,
xrt,
pink,
ded,
];

export const assetsMap = new Map<string, Asset>(
Expand Down
32 changes: 32 additions & 0 deletions packages/xcm-cfg/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import {
weth_mwh,
ztg,
xrt,
pink,
ded,
} from './assets';

export const acala = new Parachain({
Expand Down Expand Up @@ -96,6 +98,18 @@ export const assetHub = new Parachain({
decimals: 10,
id: 0,
},
{
asset: pink,
decimals: 10,
id: 23,
palletInstance: 50,
},
{
asset: ded,
decimals: 10,
id: 30,
palletInstance: 50,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down Expand Up @@ -320,6 +334,18 @@ export const hydraDX = new Parachain({
id: 27,
decimals: 12,
},
{
asset: pink,
id: 23,
decimals: 10,
palletInstance: 50,
},
{
asset: ded,
id: 30,
decimals: 10,
palletInstance: 50,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down Expand Up @@ -357,6 +383,12 @@ export const interlay = new Parachain({
id: { ForeignAsset: 2 },
metadataId: 0,
},
{
asset: hdx,
decimals: 12,
id: { ForeignAsset: 13 },
metadataId: 0,
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
Expand Down
42 changes: 41 additions & 1 deletion packages/xcm-cfg/src/configs/assethub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
polkadot,
} from '@moonbeam-network/xcm-config';

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

Expand Down Expand Up @@ -56,6 +56,46 @@ const toHydraDX: AssetConfig[] = [
},
min: AssetMinBuilder().assets().asset(),
}),
new AssetConfig({
asset: pink,
balance: BalanceBuilder().substrate().assets().account(),
destination: hydraDX,
destinationFee: {
amount: 0.02,
asset: usdt,
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: ded,
balance: BalanceBuilder().substrate().assets().account(),
destination: hydraDX,
destinationFee: {
amount: 0.02,
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(),
},
extrinsic: ExtrinsicBuilderV2()
.polkadotXcm()
.limitedReserveTransferAssets()
.X2(),
fee: {
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount,
},
min: AssetMinBuilder().assets().asset(),
}),
];

const toPolkadot: AssetConfig[] = [
Expand Down
47 changes: 47 additions & 0 deletions packages/xcm-cfg/src/configs/hydraDX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ import {
cru,
dai_awh,
dai_mwh,
ded,
dot,
glmr,
hdx,
ibtc,
intr,
nodl,
pha,
pink,
sub,
unq,
usdc,
Expand Down Expand Up @@ -133,6 +135,36 @@ const toAssetHub: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: pink,
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: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: ded,
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: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
];

const toAstar: AssetConfig[] = [
Expand Down Expand Up @@ -312,6 +344,21 @@ const toInterlay: AssetConfig[] = [
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: hdx,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: interlay,
destinationFee: {
amount: 0.5,
asset: hdx,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transfer(),
fee: {
asset: hdx,
balance: BalanceBuilder().substrate().system().account(),
},
}),
// TODO: Uncomment with asset hub release 1.7 (jit_withdraw fix)
// new AssetConfig({
// asset: usdt,
Expand Down
15 changes: 15 additions & 0 deletions packages/xcm-cfg/src/configs/interlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@ const toHydraDX: AssetConfig[] = [
balance: BalanceBuilder().substrate().tokens().accounts(),
},
}),
new AssetConfig({
asset: hdx,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: hydraDX,
destinationFee: {
amount: 0.1,
asset: hdx,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
fee: {
asset: intr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
}),
// TODO: Uncomment with asset hub release 1.7 (jit_withdraw fix)
// new AssetConfig({
// asset: usdt,
Expand Down

0 comments on commit a24e851

Please sign in to comment.