diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-14 06:59:18 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-14 06:59:18 +0800 |
commit | 315e4015de71c0b829ffd20e991108084bfc7bda (patch) | |
tree | e00f1e7244e05c80d9659aca82a705d334c07d14 /packages/0x.js | |
parent | 0c91b66f45f0a6ec08cdfe6f2430f00c1291feb9 (diff) | |
download | dexon-0x-contracts-315e4015de71c0b829ffd20e991108084bfc7bda.tar.gz dexon-0x-contracts-315e4015de71c0b829ffd20e991108084bfc7bda.tar.zst dexon-0x-contracts-315e4015de71c0b829ffd20e991108084bfc7bda.zip |
Return remainingFillableTakerAmount
Diffstat (limited to 'packages/0x.js')
-rw-r--r-- | packages/0x.js/src/utils/order_state_utils.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/0x.js/src/utils/order_state_utils.ts b/packages/0x.js/src/utils/order_state_utils.ts index f82601cae..cc4933d39 100644 --- a/packages/0x.js/src/utils/order_state_utils.ts +++ b/packages/0x.js/src/utils/order_state_utils.ts @@ -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; } |