Skip to content

Commit

Permalink
CEX Withdraw: Allow all available balance when feeFromAmount is true
Browse files Browse the repository at this point in the history
  • Loading branch information
esen committed Jul 18, 2023
1 parent a8be7f2 commit f4b8fda
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ class CexWithdrawService {
}

private func syncAvailableBalance() {
let fee = calculateFee(amount: cexAsset.freeBalance, feeFromAmount: feeFromAmount)
_availableBalance = fee < cexAsset.freeBalance ? cexAsset.freeBalance - fee : 0
if feeFromAmount {
_availableBalance = cexAsset.freeBalance
} else {
let fee = calculateFee(amount: cexAsset.freeBalance, feeFromAmount: feeFromAmount)
_availableBalance = fee < cexAsset.freeBalance ? cexAsset.freeBalance - fee : 0
}
}

private func validateAmount() throws {
Expand Down

0 comments on commit f4b8fda

Please sign in to comment.