From ef40a108cfa6d59db233715f2228ae00c92a5647 Mon Sep 17 00:00:00 2001 From: gomes <17035424+gomesalexandre@users.noreply.github.com> Date: Mon, 6 Jan 2025 01:27:34 +0300 Subject: [PATCH] fix: new swapper flow incorrect Tx link base URL (#8459) --- .../TradeConfirm/ExpandedStepperSteps.tsx | 26 +++++++++++++------ .../components/TradeConfirm/TxLabel.tsx | 10 ++++--- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/components/MultiHopTrade/components/TradeConfirm/ExpandedStepperSteps.tsx b/src/components/MultiHopTrade/components/TradeConfirm/ExpandedStepperSteps.tsx index 48093fd7b05..bd48748f8c2 100644 --- a/src/components/MultiHopTrade/components/TradeConfirm/ExpandedStepperSteps.tsx +++ b/src/components/MultiHopTrade/components/TradeConfirm/ExpandedStepperSteps.tsx @@ -156,8 +156,9 @@ export const ExpandedStepperSteps = ({ activeTradeQuote }: ExpandedStepperStepsP {firstHopAllowanceReset.txHash && tradeQuoteFirstHop && firstHopSellAccountId && ( )} @@ -182,8 +183,9 @@ export const ExpandedStepperSteps = ({ activeTradeQuote }: ExpandedStepperStepsP {firstHopAllowanceApproval.txHash && tradeQuoteFirstHop && firstHopSellAccountId && ( )} @@ -214,15 +216,17 @@ export const ExpandedStepperSteps = ({ activeTradeQuote }: ExpandedStepperStepsP {firstHopSwap.sellTxHash && ( )} {firstHopSwap.buyTxHash && firstHopSwap.buyTxHash !== firstHopSwap.sellTxHash && ( )} @@ -235,6 +239,7 @@ export const ExpandedStepperSteps = ({ activeTradeQuote }: ExpandedStepperStepsP firstHopStreamingProgress, firstHopSwap.buyTxHash, firstHopSwap.sellTxHash, + swapperName, tradeQuoteFirstHop, ]) @@ -245,8 +250,9 @@ export const ExpandedStepperSteps = ({ activeTradeQuote }: ExpandedStepperStepsP {lastHopAllowanceReset.txHash && tradeQuoteLastHop && lastHopSellAccountId && ( )} @@ -271,8 +277,9 @@ export const ExpandedStepperSteps = ({ activeTradeQuote }: ExpandedStepperStepsP {lastHopAllowanceApproval.txHash && tradeQuoteLastHop && lastHopSellAccountId && ( )} @@ -303,15 +310,17 @@ export const ExpandedStepperSteps = ({ activeTradeQuote }: ExpandedStepperStepsP {lastHopSwap.sellTxHash && ( )} {lastHopSwap.buyTxHash && lastHopSwap.buyTxHash !== lastHopSwap.sellTxHash && ( )} @@ -324,6 +333,7 @@ export const ExpandedStepperSteps = ({ activeTradeQuote }: ExpandedStepperStepsP lastHopSwap.buyTxHash, lastHopSwap.sellTxHash, secondHopStreamingProgress, + swapperName, tradeQuoteLastHop, ]) diff --git a/src/components/MultiHopTrade/components/TradeConfirm/TxLabel.tsx b/src/components/MultiHopTrade/components/TradeConfirm/TxLabel.tsx index efd81eaac7e..d8202fab49f 100644 --- a/src/components/MultiHopTrade/components/TradeConfirm/TxLabel.tsx +++ b/src/components/MultiHopTrade/components/TradeConfirm/TxLabel.tsx @@ -1,17 +1,20 @@ import { Link } from '@chakra-ui/react' import type { AccountId } from '@shapeshiftoss/caip' +import type { SwapSource } from '@shapeshiftoss/swapper' import { MiddleEllipsis } from 'components/MiddleEllipsis/MiddleEllipsis' import { useSafeTxQuery } from 'hooks/queries/useSafeTx' import { getTxLink } from 'lib/getTxLink' export const TxLabel = ({ txHash, - explorerTxLink, + explorerBaseUrl, accountId, + swapperName, }: { txHash: string - explorerTxLink: string + explorerBaseUrl: string accountId: AccountId + swapperName: SwapSource | undefined }) => { const { data: maybeSafeTx } = useSafeTxQuery({ maybeSafeTxHash: txHash, @@ -19,10 +22,11 @@ export const TxLabel = ({ }) const txLink = getTxLink({ - defaultExplorerBaseUrl: explorerTxLink, + defaultExplorerBaseUrl: explorerBaseUrl, maybeSafeTx, tradeId: txHash, accountId, + name: swapperName, }) return txLink ? (