aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src/utils.ts
diff options
context:
space:
mode:
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();
+ },
};