From ea6cd777314667029edcedff8fd3b1401a34e84d Mon Sep 17 00:00:00 2001 From: mmaurello <93129175+mmaurello@users.noreply.github.com> Date: Fri, 20 Oct 2023 13:26:07 +0200 Subject: [PATCH] Support GLMR transfers in interlay (#147) * support GLMR transfers in interlay * add changeset --- .changeset/twenty-frogs-shout.md | 5 +++++ packages/config/src/chains.ts | 4 ++++ packages/config/src/configs/interlay.ts | 13 ++++++++++++- packages/config/src/configs/moonbeam.ts | 11 +++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .changeset/twenty-frogs-shout.md diff --git a/.changeset/twenty-frogs-shout.md b/.changeset/twenty-frogs-shout.md new file mode 100644 index 00000000..8606eb83 --- /dev/null +++ b/.changeset/twenty-frogs-shout.md @@ -0,0 +1,5 @@ +--- +'@moonbeam-network/xcm-config': patch +--- + +Support GLMR transfers in interlay diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index 490119e4..d3d07dbf 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -454,6 +454,10 @@ export const hydraDX = new Parachain({ export const interlay = new Parachain({ assetsData: [ + { + asset: glmr, + id: { ForeignAsset: 10 }, + }, { asset: intr, decimals: 10, diff --git a/packages/config/src/configs/interlay.ts b/packages/config/src/configs/interlay.ts index 6fb73b9c..e8b5838e 100644 --- a/packages/config/src/configs/interlay.ts +++ b/packages/config/src/configs/interlay.ts @@ -3,7 +3,7 @@ import { ExtrinsicBuilder, FeeBuilder, } from '@moonbeam-network/xcm-builder'; -import { ibtc, intr } from '../assets'; +import { glmr, ibtc, intr } from '../assets'; import { interlay, moonbeam } from '../chains'; import { AssetConfig } from '../types/AssetConfig'; import { ChainConfig } from '../types/ChainConfig'; @@ -36,6 +36,17 @@ export const interlayConfig = new ChainConfig({ balance: BalanceBuilder().substrate().tokens().accounts(), }, }), + new AssetConfig({ + asset: glmr, + balance: BalanceBuilder().substrate().tokens().accounts(), + destination: moonbeam, + destinationFee: { + amount: 0.001, + asset: glmr, + balance: BalanceBuilder().substrate().tokens().accounts(), + }, + extrinsic: ExtrinsicBuilder().xTokens().transfer(), + }), ], chain: interlay, }); diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index 4638224c..58b0649d 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -104,6 +104,17 @@ export const moonbeamConfig = new ChainConfig({ balance: BalanceBuilder().substrate().system().account(), }, }), + new AssetConfig({ + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: interlay, + destinationFee: { + amount: 0.05, + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), new AssetConfig({ asset: glmr, balance: BalanceBuilder().substrate().system().account(),