From ca585db7fae9cde2bd51252c066002e5cee0b9c4 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Sun, 29 Sep 2024 14:35:50 +0200 Subject: [PATCH] Fix Asset Hub memecoings asset ordering in fee calculation --- .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(), },