Skip to content

Commit

Permalink
fix: recalculate token transfers tx gas
Browse files Browse the repository at this point in the history
  • Loading branch information
tiendn committed Mar 16, 2023
1 parent 4902bac commit 4ed795b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import TransactionTag from 'components/Tag/TransactionTag'
import Timer from 'components/Timer'
import Typography from 'components/Typography'
import { LinkText } from 'components/Typography/LinkText'
import { BigNumber } from 'ethers'
import { formatEther } from 'ethers/lib/utils'
import numeral from 'numeral'
import { CONFIG } from 'utils/constants'
import { convertBalanceToView, ellipseBetweenText, LinkMaker } from 'utils/helper'
Expand All @@ -22,6 +24,7 @@ const AddressTokenTransfer = ({ data }: Props) => {
const txsHashLength = isMobile ? CONFIG.TXS_MOBILE_SPLIT_LENGTH : CONFIG.TXS_DESKTOP_SPLIT_LENGTH

const type = useTransactionType(data.from, data.to)
const fee = formatEther(BigNumber.from(data.gasUsed).mul(data.gasPrice).toString())
return (
<GradientRow
style={{ justifyContent: 'space-between' }}
Expand Down Expand Up @@ -78,9 +81,7 @@ const AddressTokenTransfer = ({ data }: Props) => {

<br />
<span className="text text-xs contrast-color-70">Fee: </span>
<span className="money money-xs contrast-color-70">
{numeral(parseInt(data.gasUsed) / 10 ** 9).format('0,0.000000000')} ASA
</span>
<span className="money money-xs contrast-color-70">{numeral(fee).format('0,0.00000')} ASA</span>
</div>

<div className={clsx('col col-2 margin-left-xs', style.colStatus)}>
Expand Down

0 comments on commit 4ed795b

Please sign in to comment.