Commit caea207d authored by tom's avatar tom

address api fixes

parent 2d1d77e9
...@@ -20,10 +20,10 @@ export interface Address { ...@@ -20,10 +20,10 @@ export interface Address {
} }
export interface AddressCounters { export interface AddressCounters {
transaction_count: string; transactions_count: string;
token_transfer_count: string; token_transfers_count: string;
gas_usage_count: string; gas_usage_count: string;
validation_count: string | null; validations_count: string | null;
} }
export interface AddressTokenBalance { export interface AddressTokenBalance {
......
...@@ -55,6 +55,7 @@ const AddressDetails = ({ addressQuery }: Props) => { ...@@ -55,6 +55,7 @@ const AddressDetails = ({ addressQuery }: Props) => {
} }
const explorers = appConfig.network.explorers.filter(({ paths }) => paths.address); const explorers = appConfig.network.explorers.filter(({ paths }) => paths.address);
const validationsCount = Number(countersQuery.data.validations_count);
return ( return (
<Box> <Box>
...@@ -117,13 +118,13 @@ const AddressDetails = ({ addressQuery }: Props) => { ...@@ -117,13 +118,13 @@ const AddressDetails = ({ addressQuery }: Props) => {
title="Transactions" title="Transactions"
hint="Number of transactions related to this address." hint="Number of transactions related to this address."
> >
{ Number(countersQuery.data.transaction_count).toLocaleString() } { Number(countersQuery.data.transactions_count).toLocaleString() }
</DetailsInfoItem> </DetailsInfoItem>
<DetailsInfoItem <DetailsInfoItem
title="Transfers" title="Transfers"
hint="Number of transfers to/from this address." hint="Number of transfers to/from this address."
> >
{ Number(countersQuery.data.token_transfer_count).toLocaleString() } { Number(countersQuery.data.token_transfers_count).toLocaleString() }
</DetailsInfoItem> </DetailsInfoItem>
<DetailsInfoItem <DetailsInfoItem
title="Gas used" title="Gas used"
...@@ -131,12 +132,12 @@ const AddressDetails = ({ addressQuery }: Props) => { ...@@ -131,12 +132,12 @@ const AddressDetails = ({ addressQuery }: Props) => {
> >
{ BigNumber(countersQuery.data.gas_usage_count).toFormat() } { BigNumber(countersQuery.data.gas_usage_count).toFormat() }
</DetailsInfoItem> </DetailsInfoItem>
{ countersQuery.data.validation_count && ( { !Object.is(validationsCount, NaN) && validationsCount > 0 && (
<DetailsInfoItem <DetailsInfoItem
title="Blocks validated" title="Blocks validated"
hint="Number of blocks validated by this validator." hint="Number of blocks validated by this validator."
> >
{ Number(countersQuery.data.validation_count).toLocaleString() } { validationsCount.toLocaleString() }
</DetailsInfoItem> </DetailsInfoItem>
) } ) }
</Grid> </Grid>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment