diff --git a/packages/bridge-ui/src/components/Transactions.svelte b/packages/bridge-ui/src/components/Transactions.svelte index 4c94295c9a..38ed8804e0 100644 --- a/packages/bridge-ui/src/components/Transactions.svelte +++ b/packages/bridge-ui/src/components/Transactions.svelte @@ -23,7 +23,7 @@ - {#each $transactions as transaction} + {#each $transactions as transaction (transaction.hash)} { - const depositValue = ethers.utils.parseUnits( - tx.data.Message.DepositValue.toString(), - 'wei', - ); return { status: tx.status, message: { @@ -60,8 +56,8 @@ class RelayerAPIService implements RelayerAPI { callValue: tx.data.Message.CallValue, srcChainId: BigNumber.from(tx.data.Message.SrcChainId), destChainId: BigNumber.from(tx.data.Message.DestChainId), - depositValue: depositValue, - processingFee: BigNumber.from(tx.data.Message.ProcessingFee), + depositValue: BigNumber.from(`${tx.data.Message.DepositValue}`), + processingFee: BigNumber.from(`${tx.data.Message.ProcessingFee}`), refundAddress: tx.data.Message.RefundAddress, }, amountInWei: tx.amount, @@ -73,9 +69,7 @@ class RelayerAPIService implements RelayerAPI { }; }); - const bridgeTxs: BridgeTransaction[] = []; - - await Promise.all( + const bridgeTxs: BridgeTransaction[] = await Promise.all( (txs || []).map(async (tx) => { if (tx.message.owner.toLowerCase() !== address.toLowerCase()) return; @@ -116,7 +110,9 @@ class RelayerAPIService implements RelayerAPI { ); const event = events.find( - (e) => e.args.message.owner.toLowerCase() === address.toLowerCase(), + (e) => + e.args.message.owner.toLowerCase() === address.toLowerCase() && + e.args.message.depositValue.eq(tx.message.depositValue), ); if (!event) { @@ -172,12 +168,12 @@ class RelayerAPIService implements RelayerAPI { from: tx.from, }; - bridgeTxs.push(bridgeTx); + return bridgeTx; }), ); + bridgeTxs.reverse(); bridgeTxs.sort((tx) => (tx.status === MessageStatus.New ? -1 : 1)); - return bridgeTxs; }