aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils/order_utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/src/utils/order_utils.ts')
-rw-r--r--packages/contracts/src/utils/order_utils.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/contracts/src/utils/order_utils.ts b/packages/contracts/src/utils/order_utils.ts
index 2a8791e4c..40643fa75 100644
--- a/packages/contracts/src/utils/order_utils.ts
+++ b/packages/contracts/src/utils/order_utils.ts
@@ -4,6 +4,13 @@ import { BigNumber } from '@0xproject/utils';
import { CancelOrder, MatchOrder } from './types';
export const orderUtils = {
+ getPartialAmount(numerator: BigNumber, denominator: BigNumber, target: BigNumber): BigNumber {
+ const partialAmount = numerator
+ .mul(target)
+ .div(denominator)
+ .floor();
+ return partialAmount;
+ },
createFill: (signedOrder: SignedOrder, takerAssetFillAmount?: BigNumber) => {
const fill = {
order: orderUtils.getOrderWithoutExchangeAddress(signedOrder),