Commit 4890ad11 authored by ianlapham's avatar ianlapham

update logic for txn eth value on GA

parent 7786537c
......@@ -623,13 +623,19 @@ export default function ExchangePage({ initialCurrency, sending = false, params
}
}
let estimate, method, args, value
let estimate, method, args, value, ethTransactionSize
let inputEthPerToken = 1
if (inputCurrency !== 'ETH') {
inputEthPerToken = inputReserveToken && inputReserveETH ? inputReserveETH / inputReserveToken : null
if (inputCurrency === 'ETH') {
ethTransactionSize = inputValueFormatted
} else if (outputCurrency === 'ETH') {
// we want input value * exchangeRate
ethTransactionSize = inputValueFormatted * amountFormatter(exchangeRate, 18, 6, false)
} else {
const tokenBalance = inputReserveETH && new BigNumber(inputReserveToken.toString())
const ethBalance = inputReserveETH && new BigNumber(inputReserveETH.toString())
let ethRate = ethBalance && ethBalance.div(tokenBalance)
ethTransactionSize = inputValueFormatted * ethRate
}
let ethTransactionSize = inputEthPerToken * inputValueFormatted
// params for GA event
let action = ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment