From 56e9b572b6a3070a3f871617c4bcc36abd2a3cdd Mon Sep 17 00:00:00 2001 From: mmaurello <93129175+mmaurello@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:06:55 +0200 Subject: [PATCH] Enable DOT transfers between Polkadot Asset Hub and Moonbeam (#376) --- .changeset/dirty-pillows-breathe.md | 5 +++++ packages/config/src/configs/moonbeam.ts | 20 +++++++++++++++++-- .../config/src/configs/polkadotAssetHub.ts | 18 +++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 .changeset/dirty-pillows-breathe.md diff --git a/.changeset/dirty-pillows-breathe.md b/.changeset/dirty-pillows-breathe.md new file mode 100644 index 00000000..0ba2c217 --- /dev/null +++ b/.changeset/dirty-pillows-breathe.md @@ -0,0 +1,5 @@ +--- +'@moonbeam-network/xcm-config': patch +--- + +Enable DOT transfers between Polkadot Asset Hub and Moonbeam diff --git a/packages/config/src/configs/moonbeam.ts b/packages/config/src/configs/moonbeam.ts index f049fba3..bb24a3d6 100644 --- a/packages/config/src/configs/moonbeam.ts +++ b/packages/config/src/configs/moonbeam.ts @@ -247,7 +247,22 @@ export const moonbeamConfig = new ChainConfig({ contract: ContractBuilder().Xtokens().transfer(), destination: polkadot, destinationFee: { - amount: 0.052, + amount: 0.01, + asset: dot, + balance: BalanceBuilder().substrate().assets().account(), + }, + fee: { + asset: glmr, + balance: BalanceBuilder().substrate().system().account(), + }, + }), + new AssetConfig({ + asset: dot, + balance: BalanceBuilder().substrate().assets().account(), + contract: ContractBuilder().Xtokens().transfer(), + destination: polkadotAssetHub, + destinationFee: { + amount: 0.01, asset: dot, balance: BalanceBuilder().substrate().assets().account(), }, @@ -445,7 +460,8 @@ export const moonbeamConfig = new ChainConfig({ amount: 0.2, asset: usdt, balance: BalanceBuilder().substrate().assets().account(), - destinationBalance: BalanceBuilder().substrate().system().account(), + // TODO uncomment when we apply dot as payment asset + // destinationBalance: BalanceBuilder().substrate().system().account(), }, fee: { asset: glmr, diff --git a/packages/config/src/configs/polkadotAssetHub.ts b/packages/config/src/configs/polkadotAssetHub.ts index 17f281ba..2d47b8c1 100644 --- a/packages/config/src/configs/polkadotAssetHub.ts +++ b/packages/config/src/configs/polkadotAssetHub.ts @@ -13,6 +13,24 @@ const xcmDeliveryFeeAmount = 0.036; export const polkadotAssetHubConfig = new ChainConfig({ assets: [ + new AssetConfig({ + asset: dot, + balance: BalanceBuilder().substrate().system().account(), + destination: moonbeam, + destinationFee: { + amount: FeeBuilder().xcmPaymentApi().xcmPaymentFee({ + isAssetReserveChain: false, + }), + asset: dot, + balance: BalanceBuilder().substrate().system().account(), + }, + extrinsic: ExtrinsicBuilder().polkadotXcm().trasferAssets().here(), + fee: { + asset: dot, + balance: BalanceBuilder().substrate().system().account(), + xcmDeliveryFeeAmount, + }, + }), new AssetConfig({ asset: usdt, balance: BalanceBuilder().substrate().assets().account(),