diff --git a/src/address/AddressTransactionResults.tsx b/src/address/AddressTransactionResults.tsx index 1a95535..fcdffeb 100644 --- a/src/address/AddressTransactionResults.tsx +++ b/src/address/AddressTransactionResults.tsx @@ -20,6 +20,7 @@ import { useParams, useSearchParams } from "react-router-dom"; import { ChecksummedAddress, ProcessedTransaction } from "../types"; import { useContractsMetadata } from "../hooks"; import { useAddressBalance, useContractCreator } from "../useErigonHooks"; +import { BlockNumberContext } from "../useBlockTagContext"; type AddressTransactionResultsProps = { address: ChecksummedAddress; @@ -133,34 +134,39 @@ const AddressTransactionResults: React.FC = ({ return ( - {balance && ( - -
- - {!balance.isZero() && priceMap["latest"] !== undefined && ( - - + {balance && ( + +
+ + {!balance.isZero() && priceMap["latest"] !== undefined && ( + + + + )} +
+
+ )} + {creator && ( + +
+
+ - - )} -
- - )} - {creator && ( - -
-
- - + +
+
+ +
-
- -
-
-
- )} + + )} + = ({ const toHasCode = useHasCode( provider, address, - blockNumber !== undefined ? blockNumber - 1 : undefined + blockNumber !== undefined + ? blockNumber === "latest" + ? "latest" + : blockNumber - 1 + : undefined ); return ( diff --git a/src/useBlockTagContext.tsx b/src/useBlockTagContext.tsx index 8504fca..5cf2094 100644 --- a/src/useBlockTagContext.tsx +++ b/src/useBlockTagContext.tsx @@ -10,6 +10,8 @@ import { createContext, useContext } from "react"; * at the time (block) the transaction happened it was still an EOA (create2), * so it should be displayed as an EOA. */ -export const BlockNumberContext = createContext(undefined); +export const BlockNumberContext = createContext( + undefined +); export const useBlockNumberContext = () => useContext(BlockNumberContext);