Skip to content

Commit

Permalink
fix moonAsset retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello committed Oct 3, 2024
1 parent 6b2ce5d commit 448fdd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ export function polkadotXcm() {
const feeAssetTransferTx = transfer(
...builder
.build({
asset: AssetAmount.fromChainAsset(moonAsset, {
amount: CROSS_CHAIN_FEE + BUY_EXECUTION_FEE,
}),
asset: AssetAmount.fromChainAsset(
source.getChainAsset(moonAsset),
{
amount: CROSS_CHAIN_FEE + BUY_EXECUTION_FEE,
},
),
destination: moonChain,
destinationAddress,
destinationAddress: computedOriginAccount,
destinationApi: moonApi,
fee,
source: source as AnyParachain,
Expand Down
5 changes: 2 additions & 3 deletions packages/mrl/src/getTransferData/getTransferData.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
import type { MoonChainTransferData } from '../mrl.interfaces';

const MOON_CHAIN_AUTOMATIC_GAS_ESTIMATION = {
[moonbeam.key]: 657226n,
[moonbeam.key]: 1273110n,
[moonbaseAlpha.key]: 1271922n,
};

Expand All @@ -58,7 +58,6 @@ export function getMoonChainFeeValueOnSource({
const isSameAssetPayingMoonChainFee = sourceData.balance.isSame(
moonChainData.fee,
);

return !isDestinationMoonChain &&
isSourceParachain &&
isSameAssetPayingMoonChainFee
Expand Down Expand Up @@ -125,7 +124,7 @@ export async function buildTransfer({
destinationAddress,
destinationApi,
fee: destinationFee,
isAutomatic: route.mrl.isAutomatic,
isAutomatic: route.mrl.isAutomatic, // TODO
moonApi,
moonAsset: moonChain.nativeAsset,
moonChain,
Expand Down

0 comments on commit 448fdd5

Please sign in to comment.