diff --git a/src/block/BlockTransactionResults.tsx b/src/block/BlockTransactionResults.tsx index f9cfc27..969e4a4 100644 --- a/src/block/BlockTransactionResults.tsx +++ b/src/block/BlockTransactionResults.tsx @@ -9,9 +9,11 @@ import { useFeeToggler } from "../search/useFeeToggler"; import { RuntimeContext } from "../useRuntime"; import { SelectionContext, useSelection } from "../useSelection"; import { pageCollector, useResolvedAddresses } from "../useResolvedAddresses"; -import { ProcessedTransaction } from "../types"; +import { ChecksummedAddress, ProcessedTransaction } from "../types"; import { PAGE_SIZE } from "../params"; import { useMultipleETHUSDOracle } from "../usePriceOracle"; +import { useAppConfigContext } from "../useAppConfig"; +import { useMultipleMetadata } from "../useSourcify"; type BlockTransactionResultsProps = { blockTag: BlockTag; @@ -34,6 +36,21 @@ const BlockTransactionResults: React.FC = ({ const blockTags = useMemo(() => [blockTag], [blockTag]); const priceMap = useMultipleETHUSDOracle(provider, blockTags); + const addresses = useMemo((): ChecksummedAddress[] => { + if (!page) { + return []; + } + + return page.map((t) => t.to).filter((to): to is string => to !== undefined); + }, [page]); + const { sourcifySource } = useAppConfigContext(); + const metadatas = useMultipleMetadata( + undefined, + addresses, + provider?.network.chainId, + sourcifySource + ); + return (
@@ -63,6 +80,7 @@ const BlockTransactionResults: React.FC = ({ resolvedAddresses={resolvedAddresses} feeDisplay={feeDisplay} priceMap={priceMap} + metadatas={metadatas} /> ))}
diff --git a/src/search/TransactionItem.tsx b/src/search/TransactionItem.tsx index 3393d88..5c8740a 100644 --- a/src/search/TransactionItem.tsx +++ b/src/search/TransactionItem.tsx @@ -27,7 +27,7 @@ type TransactionItemProps = { selectedAddress?: string; feeDisplay: FeeDisplay; priceMap: Record; - metadatas?: + metadatas: | Record | undefined; };