diff --git a/packages/widget/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx b/packages/widget/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx index 8d644fb62..e31cddedd 100644 --- a/packages/widget/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +++ b/packages/widget/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx @@ -29,7 +29,7 @@ import { formatTokenAmount } from '../../utils'; import { ContactSupportButton } from './ContactSupportButton'; import { Container } from './TransactionDetailsPage.style'; import type { ExtendedTransactionInfo, StatusResponse } from '@lifi/sdk'; -import { buildRouteExecutionFromTransactionHistory } from '../../utils/converters'; +import { buildRouteFromTxHistory } from '../../utils/converters'; export const TransactionDetailsPage: React.FC = () => { // const data = useTransactionHistoryById(); @@ -45,10 +45,7 @@ export const TransactionDetailsPage: React.FC = () => { const transactionHistory: StatusResponse = state?.transactionHistory; - const routeExecution = buildRouteExecutionFromTransactionHistory( - transactionHistory, - tools, - ); + const routeExecution = buildRouteFromTxHistory(transactionHistory, tools); const headerStoreContext = useHeaderStoreContext(); const [open, setOpen] = useState(false); diff --git a/packages/widget/src/pages/TransactionHistoryPage/TransactionHistoryItem.tsx b/packages/widget/src/pages/TransactionHistoryPage/TransactionHistoryItem.tsx index cb748f0ad..deba1ff5d 100644 --- a/packages/widget/src/pages/TransactionHistoryPage/TransactionHistoryItem.tsx +++ b/packages/widget/src/pages/TransactionHistoryPage/TransactionHistoryItem.tsx @@ -36,7 +36,6 @@ export const TransactionHistoryItem: React.FC<{ ); if (!sending.token?.chainId || !receiving.token?.chainId) { - // @eugene how to handle this case? return null; } diff --git a/packages/widget/src/utils/converters.ts b/packages/widget/src/utils/converters.ts index cd2d3f28d..6fc7feddb 100644 --- a/packages/widget/src/utils/converters.ts +++ b/packages/widget/src/utils/converters.ts @@ -10,9 +10,7 @@ import type { import type { RouteExecution } from '../stores'; import type { ToolsResponse } from '@lifi/sdk'; -const buildProcessFromTransactionHistory = ( - txHistory: StatusResponse, -): Process[] => { +const buildProcessFromTxHistory = (txHistory: StatusResponse): Process[] => { const sending = txHistory.sending as ExtendedTransactionInfo; const receiving = txHistory.receiving as ExtendedTransactionInfo; @@ -77,7 +75,7 @@ const buildProcessFromTransactionHistory = ( return process; }; -export const buildRouteExecutionFromTransactionHistory = ( +export const buildRouteFromTxHistory = ( txHistory: StatusResponse, tools?: ToolsResponse, ) => { @@ -192,7 +190,7 @@ export const buildRouteExecutionFromTransactionHistory = ( integrator: '', execution: { status: 'DONE', // can be FAILED - process: buildProcessFromTransactionHistory(txHistory), + process: buildProcessFromTxHistory(txHistory), fromAmount: sending.amount, toAmount: receiving.amount, toToken: receiving.token,