Add block total tx count info

This commit is contained in:
Willian Mitsuda 2021-08-01 07:04:58 -03:00
parent 5b5791236f
commit 07e496f476
3 changed files with 3 additions and 1 deletions

View File

@ -229,7 +229,7 @@ const Details: React.FC<DetailsProps> = ({
<InfoRow title="Nonce">{txData.nonce}</InfoRow>
<InfoRow title="Position in Block">
<span className="rounded px-2 py-1 bg-gray-100 text-gray-500 text-xs">
{txData.transactionIndex}
{txData.transactionIndex} / {txData.blockTransactionCount - 1}
</span>
</InfoRow>
<InfoRow title="Input Data">

View File

@ -40,6 +40,7 @@ export type TransactionData = {
status: boolean;
blockNumber: number;
transactionIndex: number;
blockTransactionCount: number;
confirmations: number;
timestamp: number;
miner?: string;

View File

@ -149,6 +149,7 @@ export const useTxData = (
status: _receipt.status === 1,
blockNumber: _receipt.blockNumber,
transactionIndex: _receipt.transactionIndex,
blockTransactionCount: _block.transactions.length,
confirmations: _receipt.confirmations,
timestamp: _block.timestamp,
miner: _block.miner,