Add block base fee info to tx details page

This commit is contained in:
Willian Mitsuda 2021-07-28 14:49:40 -03:00
parent 31287796f0
commit 9484ed59e2
3 changed files with 15 additions and 0 deletions

View File

@ -94,6 +94,7 @@ const Transaction: React.FC = () => {
tokenMetas, tokenMetas,
type: _response.type ?? 0, type: _response.type ?? 0,
fee: _response.gasPrice!.mul(_receipt.gasUsed), fee: _response.gasPrice!.mul(_receipt.gasUsed),
blockBaseFeePerGas: _block.baseFeePerGas,
maxFeePerGas: _response.maxFeePerGas, maxFeePerGas: _response.maxFeePerGas,
maxPriorityFeePerGas: _response.maxPriorityFeePerGas, maxPriorityFeePerGas: _response.maxPriorityFeePerGas,
gasPrice: _response.gasPrice!, gasPrice: _response.gasPrice!,

View File

@ -135,6 +135,19 @@ const Details: React.FC<DetailsProps> = ({
<InfoRow title="Type (EIP-2718)"> <InfoRow title="Type (EIP-2718)">
<TransactionType type={txData.type} /> <TransactionType type={txData.type} />
</InfoRow> </InfoRow>
{txData.blockBaseFeePerGas && (
<InfoRow title="Block Base Fee">
<span>
<FormattedBalance value={txData.blockBaseFeePerGas} decimals={9} />{" "}
Gwei (
<FormattedBalance
value={txData.blockBaseFeePerGas}
decimals={0}
/>{" "}
wei)
</span>
</InfoRow>
)}
{txData.type === 2 && ( {txData.type === 2 && (
<> <>
<InfoRow title="Max Fee Per Gas"> <InfoRow title="Max Fee Per Gas">

View File

@ -53,6 +53,7 @@ export type TransactionData = {
maxFeePerGas?: BigNumber | undefined; maxFeePerGas?: BigNumber | undefined;
maxPriorityFeePerGas?: BigNumber | undefined; maxPriorityFeePerGas?: BigNumber | undefined;
fee: BigNumber; fee: BigNumber;
blockBaseFeePerGas?: BigNumber | undefined | null;
gasPrice: BigNumber; gasPrice: BigNumber;
gasUsed: BigNumber; gasUsed: BigNumber;
gasLimit: BigNumber; gasLimit: BigNumber;