diff --git a/.changelog/544.feature.md b/.changelog/544.feature.md new file mode 100644 index 000000000..3aa4cf015 --- /dev/null +++ b/.changelog/544.feature.md @@ -0,0 +1 @@ +At address page, recognize contracts, and use appropriate title diff --git a/src/app/components/Account/index.tsx b/src/app/components/Account/index.tsx index 0b23bbdd8..4ddccf593 100644 --- a/src/app/components/Account/index.tsx +++ b/src/app/components/Account/index.tsx @@ -19,6 +19,7 @@ import Link from '@mui/material/Link' import { DashboardLink } from '../../pages/DashboardPage/DashboardLink' import { getNameForTicker, Ticker } from '../../../types/ticker' import { TokenPriceInfo } from '../../../coin-gecko/api' +import { TransactionLink } from '../Transactions/TransactionLink' export const StyledAvatarContainer = styled('dt')(({ theme }) => ({ '&&': { @@ -58,6 +59,7 @@ export const Account: FC = ({ account, isLoading, tokenPriceInfo, const { isMobile } = useScreenSize() const balance = account?.balances[0]?.balance ?? '0' const address = account ? account.address_eth ?? account.address : undefined + const creationTxHash = account?.evm_contract?.creation_tx // TODO: use evm_hash if available const transactionsLabel = account ? account.stats.num_txns.toLocaleString() : '' const transactionsAnchor = account @@ -97,6 +99,15 @@ export const Account: FC = ({ account, isLoading, tokenPriceInfo, + {creationTxHash && ( + <> +
{t('common.createdAt')}
+
+ +
+ + )} +
{t('common.balance')}
{t('common.valueInToken', { value: balance, ticker: tickerName })}
diff --git a/src/app/pages/AccountDetailsPage/index.tsx b/src/app/pages/AccountDetailsPage/index.tsx index 3251b5fc0..fdd34f916 100644 --- a/src/app/pages/AccountDetailsPage/index.tsx +++ b/src/app/pages/AccountDetailsPage/index.tsx @@ -23,6 +23,7 @@ export const AccountDetailsPage: FC = () => { const { account, isLoading, isError } = useAccount(scope, address) const tokenPriceInfo = useTokenPrice(account?.ticker || Ticker.ROSE) + const isContract = !!account?.evm_contract const showErc20 = showEmptyAccountDetails || !!account?.tokenBalances[EvmTokenType.ERC20].length const erc20Link = useHref(`tokens/erc-20#${accountTokenContainerId}`) @@ -33,7 +34,11 @@ export const AccountDetailsPage: FC = () => { return ( - +