Skip to content

Commit

Permalink
update txns (Uniswap#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlapham committed May 18, 2020
1 parent a7742fd commit 792f359
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/TxnList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,21 @@ function TxnList({ transactions, symbol0Override, symbol1Override, color }) {
let newTxn = {}

if (netToken0 < 0) {
newTxn.token0Symbol = swap.pair.token1.symbol
newTxn.token1Symbol = swap.pair.token0.symbol
} else if (netToken1 < 0) {
newTxn.token0Symbol = swap.pair.token0.symbol
newTxn.token1Symbol = swap.pair.token1.symbol
newTxn.token0Amount = Math.abs(netToken0)
newTxn.token1Amount = Math.abs(netToken1)
} else if (netToken1 < 0) {
newTxn.token0Symbol = swap.pair.token1.symbol
newTxn.token1Symbol = swap.pair.token0.symbol
newTxn.token0Amount = Math.abs(netToken1)
newTxn.token1Amount = Math.abs(netToken0)
}

newTxn.hash = swap.transaction.id
newTxn.timestamp = swap.transaction.timestamp
newTxn.type = TXN_TYPE.SWAP
newTxn.token0Amount = Math.abs(netToken0)
newTxn.token1Amount = Math.abs(netToken1)

newTxn.amountUSD = swap.amountUSD
newTxn.account = swap.to
return newTxns.push(newTxn)
Expand Down Expand Up @@ -275,7 +278,7 @@ function TxnList({ transactions, symbol0Override, symbol1Override, color }) {
<DashGrid style={{ height: '60px' }}>
<DataText area="txn" fontWeight="500">
<Link color={color} external href={urls.showTransaction(item.hash)}>
{getTransactionType(item.type, item.token0Symbol, item.token1Symbol)}
{getTransactionType(item.type, item.token1Symbol, item.token0Symbol)}
</Link>
</DataText>
<DataText area="value">
Expand Down

0 comments on commit 792f359

Please sign in to comment.