Skip to content

Commit

Permalink
feat(interest): we have to pass origin coin and do proper formating
Browse files Browse the repository at this point in the history
  • Loading branch information
milan-bc committed Apr 12, 2021
1 parent 5b2e26c commit 6d7af9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@ export const generateInterestAccount = (

export const generateProvisionalPaymentAmount = (
coin: CoinType,
amount: number
amount: number,
orgCoin?: CoinType
): string | number => {
if (coin === 'BTC' || coin === 'BCH') {
return parseInt(convertStandardToBase(coin, amount))
}

if (coin === 'ETH' && orgCoin && orgCoin === 'USDT') {
return parseInt(convertStandardToBase(orgCoin, amount))
}

return convertStandardToBase(coin, amount)
}
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ export default ({
)
const paymentAmount = generateProvisionalPaymentAmount(
payment.coin,
value
value,
coin
)
payment = yield payment.amount(paymentAmount)
yield put(A.setPaymentSuccess(payment.value()))
Expand Down

0 comments on commit 6d7af9e

Please sign in to comment.