aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src/utils.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-12 01:21:32 +0800
committerFabio Berger <me@fabioberger.com>2018-06-12 01:21:32 +0800
commit21f7722f1023cc9d1848737b7c986f7df7a07122 (patch)
treea4b9c57fa75fb8c92bf44ed968df8b7112f478de /packages/order-utils/src/utils.ts
parente4afe603f9c4dd5128f2446f9fe075516a3d4894 (diff)
downloaddexon-sol-tools-21f7722f1023cc9d1848737b7c986f7df7a07122.tar
dexon-sol-tools-21f7722f1023cc9d1848737b7c986f7df7a07122.tar.gz
dexon-sol-tools-21f7722f1023cc9d1848737b7c986f7df7a07122.tar.bz2
dexon-sol-tools-21f7722f1023cc9d1848737b7c986f7df7a07122.tar.lz
dexon-sol-tools-21f7722f1023cc9d1848737b7c986f7df7a07122.tar.xz
dexon-sol-tools-21f7722f1023cc9d1848737b7c986f7df7a07122.tar.zst
dexon-sol-tools-21f7722f1023cc9d1848737b7c986f7df7a07122.zip
Move OrderValidationUtils (+ tests) and ExchangeTransferSimulator to order-utils
Diffstat (limited to 'packages/order-utils/src/utils.ts')
-rw-r--r--packages/order-utils/src/utils.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/order-utils/src/utils.ts b/packages/order-utils/src/utils.ts
index 3b465cece..6149316f6 100644
--- a/packages/order-utils/src/utils.ts
+++ b/packages/order-utils/src/utils.ts
@@ -1,3 +1,5 @@
+import { BigNumber } from '@0xproject/utils';
+
export const utils = {
getSignatureTypeIndexIfExists(signature: string): number {
// tslint:disable-next-line:custom-no-magic-numbers
@@ -6,4 +8,8 @@ export const utils = {
const signatureTypeInt = parseInt(signatureTypeHex, base);
return signatureTypeInt;
},
+ getCurrentUnixTimestampSec(): BigNumber {
+ const milisecondsInSecond = 1000;
+ return new BigNumber(Date.now() / milisecondsInSecond).round();
+ },
};