diff --git a/explorer/gql/graphql.tsx b/explorer/gql/graphql.tsx index 9be12716..5d29ce90 100644 --- a/explorer/gql/graphql.tsx +++ b/explorer/gql/graphql.tsx @@ -18290,7 +18290,7 @@ export type TransfersByAccountIdQueryVariables = Exact<{ }>; -export type TransfersByAccountIdQuery = { __typename?: 'query_root', consensus_transfers_aggregate: { __typename?: 'consensus_transfers_aggregate', aggregate?: { __typename?: 'consensus_transfers_aggregate_fields', count: number } | null }, consensus_transfers: Array<{ __typename?: 'consensus_transfers', id: string, extrinsic_id: string, event_id: string, from: string, to: string, value: any, fee: any, success: boolean, timestamp: any }> }; +export type TransfersByAccountIdQuery = { __typename?: 'query_root', consensus_transfers_aggregate: { __typename?: 'consensus_transfers_aggregate', aggregate?: { __typename?: 'consensus_transfers_aggregate_fields', count: number } | null }, consensus_transfers: Array<{ __typename?: 'consensus_transfers', id: string, block_height: any, extrinsic_id: string, event_id: string, from: string, to: string, value: any, fee: any, success: boolean, timestamp: any }> }; export type BalanceHistoryByAccountIdQueryVariables = Exact<{ limit: Scalars['Int']['input']; @@ -19165,6 +19165,7 @@ export const TransfersByAccountIdDocument = gql` where: $where ) { id + block_height extrinsic_id event_id from diff --git a/explorer/src/components/Consensus/Account/AccountTransfersList.tsx b/explorer/src/components/Consensus/Account/AccountTransfersList.tsx index b7ca6025..cdb43579 100644 --- a/explorer/src/components/Consensus/Account/AccountTransfersList.tsx +++ b/explorer/src/components/Consensus/Account/AccountTransfersList.tsx @@ -29,6 +29,7 @@ import { downloadFullData } from 'utils/downloadFullData' import { bigNumberToNumber } from 'utils/number' import { formatExtrinsicId } from 'utils/string' import { countTablePages } from 'utils/table' +import { utcToLocalRelativeTime } from 'utils/time' import { QUERY_ACCOUNT_TRANSFERS } from './query' type Props = { @@ -40,7 +41,7 @@ type Row = TransfersByAccountIdQuery['consensus_transfers'][0] export const AccountTransfersList: FC = ({ accountId }) => { const { ref, inView } = useInView() const [sorting, setSorting] = useState([ - { id: TransferColumn.CreatedAt, desc: true }, + { id: TransferColumn.BlockHeight, desc: true }, ]) const [pagination, setPagination] = useState({ pageSize: PAGE_SIZE, @@ -117,7 +118,7 @@ export const AccountTransfersList: FC = ({ accountId }) => { const columns = useMemo( () => [ { - accessorKey: 'created_at', + accessorKey: 'block_height', header: 'Block', enableSorting: true, cell: ({ row }: Cell) => ( @@ -127,11 +128,11 @@ export const AccountTransfersList: FC = ({ accountId }) => { href={INTERNAL_ROUTES.blocks.id.page( network, Routes.consensus, - row.original.created_at, + row.original.block_height, )} className='hover:text-primaryAccent' > -
{row.original.created_at}
+
{row.original.block_height}
), @@ -236,7 +237,7 @@ export const AccountTransfersList: FC = ({ accountId }) => { enableSorting: true, cell: ({ row }: Cell) => (
- {row.original.timestamp(row.original.date)} + {utcToLocalRelativeTime(row.original.timestamp)}
), }, diff --git a/explorer/src/components/Consensus/Account/BalanceHistory.tsx b/explorer/src/components/Consensus/Account/BalanceHistory.tsx index 626cb9cd..77f72f11 100644 --- a/explorer/src/components/Consensus/Account/BalanceHistory.tsx +++ b/explorer/src/components/Consensus/Account/BalanceHistory.tsx @@ -37,7 +37,7 @@ type Row = BalanceHistoryByAccountIdQuery['consensus_account_histories'][0] export const BalanceHistory: FC = ({ accountId }) => { const { ref, inView } = useInView() const [sorting, setSorting] = useState([ - { id: TransferColumn.CreatedAt, desc: true }, + { id: TransferColumn.BlockHeight, desc: true }, ]) const [pagination, setPagination] = useState({ pageSize: PAGE_SIZE, @@ -53,7 +53,7 @@ export const BalanceHistory: FC = ({ accountId }) => { ? sorting[0].id.endsWith('aggregate') ? { [sorting[0].id]: sorting[0].desc ? { count: OrderBy.Desc } : { count: OrderBy.Asc } } : { [sorting[0].id]: sorting[0].desc ? OrderBy.Desc : OrderBy.Asc } - : { id: OrderBy.Asc }, + : { [TransferColumn.BlockHeight]: OrderBy.Asc }, [sorting], ) diff --git a/explorer/src/components/Consensus/Account/query.ts b/explorer/src/components/Consensus/Account/query.ts index 2f5327c4..e590071e 100644 --- a/explorer/src/components/Consensus/Account/query.ts +++ b/explorer/src/components/Consensus/Account/query.ts @@ -158,6 +158,7 @@ export const QUERY_ACCOUNT_TRANSFERS = gql` } consensus_transfers(order_by: $orderBy, limit: $limit, offset: $offset, where: $where) { id + block_height extrinsic_id event_id from