Add max fee per gas/max priority fee per gas
This commit is contained in:
parent
bc8bf0cf93
commit
e967abf61e
|
@ -92,7 +92,10 @@ const Transaction: React.FC = () => {
|
||||||
value: _response.value,
|
value: _response.value,
|
||||||
tokenTransfers,
|
tokenTransfers,
|
||||||
tokenMetas,
|
tokenMetas,
|
||||||
|
type: _response.type ?? 0,
|
||||||
fee: _response.gasPrice!.mul(_receipt.gasUsed),
|
fee: _response.gasPrice!.mul(_receipt.gasUsed),
|
||||||
|
maxFeePerGas: _response.maxFeePerGas,
|
||||||
|
maxPriorityFeePerGas: _response.maxPriorityFeePerGas,
|
||||||
gasPrice: _response.gasPrice!,
|
gasPrice: _response.gasPrice!,
|
||||||
gasLimit: _response.gasLimit,
|
gasLimit: _response.gasLimit,
|
||||||
gasUsed: _receipt.gasUsed,
|
gasUsed: _receipt.gasUsed,
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
type TransactionTypeProps = {
|
||||||
|
type: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
const TransactionType: React.FC<TransactionTypeProps> = ({ type }) => {
|
||||||
|
let description: string;
|
||||||
|
switch (type) {
|
||||||
|
case 0:
|
||||||
|
description = "legacy";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
description = "EIP-2930";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
description = "EIP-1559";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
description = "unknown";
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
{type} <span className="font-bold">({description})</span>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default React.memo(TransactionType);
|
|
@ -15,6 +15,7 @@ import Copy from "../components/Copy";
|
||||||
import Timestamp from "../components/Timestamp";
|
import Timestamp from "../components/Timestamp";
|
||||||
import InternalTransactionOperation from "../components/InternalTransactionOperation";
|
import InternalTransactionOperation from "../components/InternalTransactionOperation";
|
||||||
import MethodName from "../components/MethodName";
|
import MethodName from "../components/MethodName";
|
||||||
|
import TransactionType from "../components/TransactionType";
|
||||||
import GasValue from "../components/GasValue";
|
import GasValue from "../components/GasValue";
|
||||||
import FormattedBalance from "../components/FormattedBalance";
|
import FormattedBalance from "../components/FormattedBalance";
|
||||||
import TokenTransferItem from "../TokenTransferItem";
|
import TokenTransferItem from "../TokenTransferItem";
|
||||||
|
@ -130,6 +131,29 @@ const Details: React.FC<DetailsProps> = ({
|
||||||
{ethers.utils.formatEther(txData.value)} Ether
|
{ethers.utils.formatEther(txData.value)} Ether
|
||||||
</span>
|
</span>
|
||||||
</InfoRow>
|
</InfoRow>
|
||||||
|
<InfoRow title="Type (EIP-2718)">
|
||||||
|
<TransactionType type={txData.type} />
|
||||||
|
</InfoRow>
|
||||||
|
{txData.type === 2 && (
|
||||||
|
<>
|
||||||
|
<InfoRow title="Max Fee Per Gas">
|
||||||
|
<span>
|
||||||
|
<FormattedBalance value={txData.maxFeePerGas!} /> Ether (
|
||||||
|
<FormattedBalance value={txData.maxFeePerGas!} decimals={9} /> Gwei)
|
||||||
|
</span>
|
||||||
|
</InfoRow>
|
||||||
|
<InfoRow title="Max Priority Fee Per Gas">
|
||||||
|
<span>
|
||||||
|
<FormattedBalance value={txData.maxPriorityFeePerGas!} /> Ether (
|
||||||
|
<FormattedBalance
|
||||||
|
value={txData.maxPriorityFeePerGas!}
|
||||||
|
decimals={9}
|
||||||
|
/>{" "}
|
||||||
|
Gwei)
|
||||||
|
</span>
|
||||||
|
</InfoRow>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<InfoRow title="Transaction Fee">
|
<InfoRow title="Transaction Fee">
|
||||||
<FormattedBalance value={txData.fee} /> Ether
|
<FormattedBalance value={txData.fee} /> Ether
|
||||||
</InfoRow>
|
</InfoRow>
|
||||||
|
|
|
@ -49,6 +49,9 @@ export type TransactionData = {
|
||||||
value: BigNumber;
|
value: BigNumber;
|
||||||
tokenTransfers: TokenTransfer[];
|
tokenTransfers: TokenTransfer[];
|
||||||
tokenMetas: TokenMetas;
|
tokenMetas: TokenMetas;
|
||||||
|
type: number;
|
||||||
|
maxFeePerGas?: BigNumber | undefined;
|
||||||
|
maxPriorityFeePerGas?: BigNumber | undefined;
|
||||||
fee: BigNumber;
|
fee: BigNumber;
|
||||||
gasPrice: BigNumber;
|
gasPrice: BigNumber;
|
||||||
gasLimit: BigNumber;
|
gasLimit: BigNumber;
|
||||||
|
|
Loading…
Reference in New Issue