From 5d308c3455126b5dfedb93c38a0afb18344a183e Mon Sep 17 00:00:00 2001 From: mmaurello <93129175+mmaurello@users.noreply.github.com> Date: Sun, 29 Sep 2024 16:33:16 +0200 Subject: [PATCH] Fix Asset Hub memecoings asset ordering in fee calculation (#359) --- .changeset/serious-ants-shout.md | 5 ++++ .../config/src/configs/polkadotAssetHub.ts | 28 +++++++++++-------- 2 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 .changeset/serious-ants-shout.md diff --git a/.changeset/serious-ants-shout.md b/.changeset/serious-ants-shout.md new file mode 100644 index 00000000..4670249b --- /dev/null +++ b/.changeset/serious-ants-shout.md @@ -0,0 +1,5 @@ +--- +'@moonbeam-network/xcm-config': patch +--- + +Fix Asset Hub memecoins asset ordering in fee calculation diff --git a/packages/config/src/configs/polkadotAssetHub.ts b/packages/config/src/configs/polkadotAssetHub.ts index f1b5a6aa..17f281ba 100644 --- a/packages/config/src/configs/polkadotAssetHub.ts +++ b/packages/config/src/configs/polkadotAssetHub.ts @@ -62,9 +62,10 @@ export const polkadotAssetHubConfig = new ChainConfig({ balance: BalanceBuilder().substrate().assets().account(), destination: moonbeam, destinationFee: { - amount: FeeBuilder() - .xcmPaymentApi() - .xcmPaymentFee({ isAssetReserveChain: false }), + amount: FeeBuilder().xcmPaymentApi().xcmPaymentFee({ + isAssetReserveChain: false, + shouldTransferAssetPrecedeAsset: true, + }), asset: usdt, balance: BalanceBuilder().substrate().assets().account(), }, @@ -84,9 +85,10 @@ export const polkadotAssetHubConfig = new ChainConfig({ balance: BalanceBuilder().substrate().assets().account(), destination: moonbeam, destinationFee: { - amount: FeeBuilder() - .xcmPaymentApi() - .xcmPaymentFee({ isAssetReserveChain: false }), + amount: FeeBuilder().xcmPaymentApi().xcmPaymentFee({ + isAssetReserveChain: false, + shouldTransferAssetPrecedeAsset: true, + }), asset: usdt, balance: BalanceBuilder().substrate().assets().account(), }, @@ -128,9 +130,10 @@ export const polkadotAssetHubConfig = new ChainConfig({ balance: BalanceBuilder().substrate().assets().account(), destination: moonbeam, destinationFee: { - amount: FeeBuilder() - .xcmPaymentApi() - .xcmPaymentFee({ isAssetReserveChain: false }), + amount: FeeBuilder().xcmPaymentApi().xcmPaymentFee({ + isAssetReserveChain: false, + shouldTransferAssetPrecedeAsset: true, + }), asset: usdt, balance: BalanceBuilder().substrate().assets().account(), }, @@ -150,9 +153,10 @@ export const polkadotAssetHubConfig = new ChainConfig({ balance: BalanceBuilder().substrate().assets().account(), destination: moonbeam, destinationFee: { - amount: FeeBuilder() - .xcmPaymentApi() - .xcmPaymentFee({ isAssetReserveChain: false }), + amount: FeeBuilder().xcmPaymentApi().xcmPaymentFee({ + isAssetReserveChain: false, + shouldTransferAssetPrecedeAsset: true, + }), asset: usdt, balance: BalanceBuilder().substrate().assets().account(), },