import * as React from 'react'; import useTransactions from '../../src/hooks/useTransactions'; import { IChainId } from '../../src/state/type'; import { formatUnits } from 'viem'; const Transactions = () => { const { transactions } = useTransactions(); const transactionsRender = Object.keys(transactions) .map(key => { const intKey = Number(key) as IChainId; return transactions[intKey]; }) .filter(item => !!item) .flat() // .filter(item => item.historyType === 'Swap') .sort((a, b) => { return b.time - a.time; }); return (

History

{transactionsRender.map((item, index) => { return (

{item.chainId} {item.hash}

from:{item.fromAddress} to:{item.toAddress}

amount:{' '} {formatUnits( BigInt(item.toAmount), item.toSwapTokens?.decimals || 18 )}{' '} {` ${item.toSwapTokens?.symbol}`}

); })}
); }; export default Transactions;