From d0fcf25c734f15df5c8a276425fc33320888e390 Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Fri, 27 Sep 2024 19:32:39 +0200 Subject: [PATCH] add setup for dev in fantom > moonbase route --- packages/config/src/chains.ts | 5 +++ .../config/src/mrl-configs/fantomTestnet.ts | 33 ++++++++++++++++++- .../mrl/src/getTransferData/getSourceData.ts | 3 +- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/packages/config/src/chains.ts b/packages/config/src/chains.ts index e801f6f4..f55b420f 100644 --- a/packages/config/src/chains.ts +++ b/packages/config/src/chains.ts @@ -460,6 +460,11 @@ export const fantomTestnet = new EvmChain({ ChainAsset.fromAsset(ftm, { decimals: 18, }), + // TODO should be WGLMR + ChainAsset.fromAsset(dev, { + address: '0x41E3CFDFC255A4bF3C8D3560Bc8D3D9b5080338e', + decimals: 18, + }), ], ecosystem: Ecosystem.AlphanetRelay, explorer: 'https://testnet.ftmscan.com', diff --git a/packages/config/src/mrl-configs/fantomTestnet.ts b/packages/config/src/mrl-configs/fantomTestnet.ts index 120e7cec..803b26ff 100644 --- a/packages/config/src/mrl-configs/fantomTestnet.ts +++ b/packages/config/src/mrl-configs/fantomTestnet.ts @@ -52,7 +52,7 @@ export const fantomTestnetRoutes = new ChainRoutes({ balance: BalanceBuilder().evm().erc20(), fee: { asset: ftmwh, - amount: 0.01, + amount: 0, }, }, mrl: { @@ -68,5 +68,36 @@ export const fantomTestnetRoutes = new ChainRoutes({ }, }, }, + { + source: { + asset: dev, + balance: BalanceBuilder().evm().erc20(), + destinationFee: { + asset: dev, + balance: BalanceBuilder().evm().erc20(), + }, + }, + destination: { + asset: dev, + chain: moonbaseAlpha, + balance: BalanceBuilder().substrate().system().account(), + fee: { + asset: dev, + amount: 0, + }, + }, + mrl: { + isAutomatic: false, + transfer: MrlBuilder().wormhole().wormhole().tokenTransfer(), + moonChain: { + asset: dev, + fee: { + asset: dev, + amount: 0.1, + balance: BalanceBuilder().substrate().system().account(), + }, + }, + }, + }, ], }); diff --git a/packages/mrl/src/getTransferData/getSourceData.ts b/packages/mrl/src/getTransferData/getSourceData.ts index 6f971303..4c7f4160 100644 --- a/packages/mrl/src/getTransferData/getSourceData.ts +++ b/packages/mrl/src/getTransferData/getSourceData.ts @@ -44,7 +44,6 @@ export async function getSourceData({ } const source = route.source.chain; - const destination = route.destination.chain; const asset = source.getChainAsset(route.source.asset); const feeAsset = route.source.fee ? source.getChainAsset(route.source.fee.asset) @@ -71,7 +70,7 @@ export async function getSourceData({ sourceAddress, }); - const existentialDeposit = await getExistentialDeposit(destination); + const existentialDeposit = await getExistentialDeposit(source); const min = await getAssetMin({ asset, builder: route.source.min,