aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src/utils.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-21 01:13:30 +0800
committerFabio Berger <me@fabioberger.com>2018-06-21 01:13:30 +0800
commit247f8c8557a501ea5081615d9b031c9e4b7aeec7 (patch)
tree51b9a9de386d7fbe453a7fc5c1e0e827fd6ecdca /packages/order-utils/src/utils.ts
parent3ce449e16739896f81b171d130afbb5774829d64 (diff)
downloaddexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar
dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar.gz
dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar.bz2
dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar.lz
dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar.xz
dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar.zst
dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.zip
Fix orderValidationUtils where was confusing a makerAssetAmount as a takerAssetAmount
Diffstat (limited to 'packages/order-utils/src/utils.ts')
-rw-r--r--packages/order-utils/src/utils.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/order-utils/src/utils.ts b/packages/order-utils/src/utils.ts
index 6149316f6..7aaaf0609 100644
--- a/packages/order-utils/src/utils.ts
+++ b/packages/order-utils/src/utils.ts
@@ -12,4 +12,11 @@ export const utils = {
const milisecondsInSecond = 1000;
return new BigNumber(Date.now() / milisecondsInSecond).round();
},
+ getPartialAmount(numerator: BigNumber, denominator: BigNumber, target: BigNumber): BigNumber {
+ const fillMakerTokenAmount = numerator
+ .mul(target)
+ .div(denominator)
+ .round(0);
+ return fillMakerTokenAmount;
+ },
};