From 07e496f476fa46cebf3efbe6aaa6d12d7d38d647 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sun, 1 Aug 2021 07:04:58 -0300 Subject: [PATCH] Add block total tx count info --- src/transaction/Details.tsx | 2 +- src/types.ts | 1 + src/useErigonHooks.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 7346b0c..f49b6d1 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -229,7 +229,7 @@ const Details: React.FC = ({ {txData.nonce} - {txData.transactionIndex} + {txData.transactionIndex} / {txData.blockTransactionCount - 1} diff --git a/src/types.ts b/src/types.ts index 482828e..8a2cb8a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -40,6 +40,7 @@ export type TransactionData = { status: boolean; blockNumber: number; transactionIndex: number; + blockTransactionCount: number; confirmations: number; timestamp: number; miner?: string; diff --git a/src/useErigonHooks.ts b/src/useErigonHooks.ts index c3c0398..588940e 100644 --- a/src/useErigonHooks.ts +++ b/src/useErigonHooks.ts @@ -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,