Files
explore/ui/tx/details/TxDetailsSetMaxGasLimit.tsx
Igor StuevandGitHub 5a37b28b9c Tx page: show historical $ value (#3272)
* Tx page: show historical $ value

* review fixes

* review fixes 2
2026-03-02 14:37:43 +03:00

44 lines
1.3 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import BigNumber from 'bignumber.js';
import React from 'react';
import type { Transaction } from 'types/api/transaction';
import config from 'configs/app';
import * as DetailedInfo from 'ui/shared/DetailedInfo/DetailedInfo';
import DetailedInfoNativeCoinValue from 'ui/shared/DetailedInfo/DetailedInfoNativeCoinValue';
import TxDetailsGasUsage from './TxDetailsGasUsage';
interface Props {
data: Transaction;
}
const TxDetailsSetMaxGasLimit = ({ data }: Props) => {
if (!config.UI.views.tx.additionalFields?.set_max_gas_limit) {
return null;
}
const maxGasLimit = BigNumber(data.gas_limit || 0).multipliedBy(BigNumber(data.gas_price || 0));
return (
<>
<DetailedInfo.ItemLabel
hint="The maximum network fee the sender is willing to pay for this transaction"
>
User’s set max gas limit
</DetailedInfo.ItemLabel>
<DetailedInfoNativeCoinValue
amount={ maxGasLimit.toString() }
exchangeRate={ 'exchange_rate' in data ? data.exchange_rate : null }
historicalExchangeRate={ 'historic_exchange_rate' in data ? data.historic_exchange_rate : null }
hasExchangeRateToggle
unitsTooltip="gwei"
copyOriginalValue
/>
<TxDetailsGasUsage data={ data }/>
</>
);
};
export default React.memo(TxDetailsSetMaxGasLimit);