Skip to content
This repository has been archived by the owner on Aug 28, 2019. It is now read-only.

Commit

Permalink
fix: more accommodating limits (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 authored Apr 3, 2019
1 parent 5dbdd48 commit 8ebf2d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/service/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ class Service extends EventEmitter {
const { limits } = this.getPair(pairId);

if (limits) {
if (amount > limits.maximal) throw Errors.EXCEED_MAXIMAL_AMOUNT(amount, limits.maximal);
if (amount < limits.minimal) throw Errors.BENEATH_MINIMAL_AMOUNT(amount, limits.minimal);
if (Math.floor(amount) > limits.maximal) throw Errors.EXCEED_MAXIMAL_AMOUNT(amount, limits.maximal);
if (Math.ceil(amount) < limits.minimal) throw Errors.BENEATH_MINIMAL_AMOUNT(amount, limits.minimal);
} else {
throw Errors.CURRENCY_NOT_SUPPORTED_BY_BACKEND(pairId);
}
Expand Down

0 comments on commit 8ebf2d3

Please sign in to comment.