Skip to content

Commit

Permalink
fix(activity-feed): fix conversions in custodial activity feed and ad…
Browse files Browse the repository at this point in the history
…d refund address
  • Loading branch information
TheLeoB committed Dec 8, 2020
1 parent 124f78d commit 06eb5ba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import {
SBBillingAddressFormValuesType,
SBCheckoutFormValuesType
} from './types'
import { selectReceiveAddress } from '../utils/sagas'
import { UserDataType } from 'data/modules/types'
import BigNumber from 'bignumber.js'
import moment from 'moment'
Expand Down Expand Up @@ -270,13 +271,18 @@ export default ({
amount
)
)

const refundAddr =
direction === 'FROM_USERKEY'
? yield call(selectReceiveAddress, from, networks)
: undefined
const sellOrder: SwapOrderType = yield call(
api.createSwapOrder,
direction,
quote.quote.id,
cryptoAmt,
getFiatFromPair(pair.pair)
getFiatFromPair(pair.pair),
undefined,
refundAddr
)
// on chain
if (direction === 'FROM_USERKEY') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ const CustodialTxListItem: React.FC<Props> = props => {
data-e2e='orderAmountColumn'
>
<StyledCoinDisplay coin={props.coin} data-e2e='orderCoinAmt'>
{tx.amount.symbol in CoinTypeEnum && tx.type === 'SELL'
{tx.amount.symbol in CoinTypeEnum &&
(tx.type === 'DEPOSIT' || tx.type === 'WITHDRAWAL')
? tx.amountMinor
: tx.amount.symbol in CoinTypeEnum && tx.type === 'SELL'
? convertBaseToStandard('FIAT', tx.amountMinor)
: tx.amount.value}
</StyledCoinDisplay>
Expand All @@ -82,7 +85,10 @@ const CustodialTxListItem: React.FC<Props> = props => {
color='grey600'
data-e2e='orderFiatAmt'
>
{tx.amount.symbol in CoinTypeEnum && tx.type === 'SELL'
{tx.amount.symbol in CoinTypeEnum &&
(tx.type === 'DEPOSIT' || tx.type === 'WITHDRAWAL')
? tx.amountMinor
: tx.amount.symbol in CoinTypeEnum && tx.type === 'SELL'
? convertBaseToStandard('FIAT', tx.amountMinor)
: tx.amount.value}
</StyledFiatDisplay>
Expand Down

0 comments on commit 06eb5ba

Please sign in to comment.