Return remainingFillableTakerAmount

This commit is contained in:
Leonid Logvinov 2017-11-13 17:59:18 -05:00
parent 0c91b66f45
commit 315e4015de
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4

View File

@ -78,6 +78,9 @@ export class OrderStateUtils {
.dividedToIntegerBy(totalTakerTokenAmount);
const fillableMakerTokenAmount = BigNumber.min([makerProxyAllowance, makerBalance]);
const remainingFillableMakerTokenAmount = BigNumber.min(fillableMakerTokenAmount, remainingMakerTokenAmount);
const remainingFillableTakerTokenAmount = remainingFillableMakerTokenAmount
.times(totalTakerTokenAmount)
.dividedToIntegerBy(totalMakerTokenAmount);
// TODO: Handle edge case where maker token is ZRX with fee
const orderRelevantState = {
makerBalance,
@ -87,6 +90,7 @@ export class OrderStateUtils {
filledTakerTokenAmount,
canceledTakerTokenAmount,
remainingFillableMakerTokenAmount,
remainingFillableTakerTokenAmount,
};
return orderRelevantState;
}