aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-watcher/src/utils/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/order-watcher/src/utils/utils.ts')
-rw-r--r--packages/order-watcher/src/utils/utils.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/order-watcher/src/utils/utils.ts b/packages/order-watcher/src/utils/utils.ts
new file mode 100644
index 000000000..af1125632
--- /dev/null
+++ b/packages/order-watcher/src/utils/utils.ts
@@ -0,0 +1,13 @@
+import { BigNumber } from '@0xproject/utils';
+
+export const utils = {
+ spawnSwitchErr(name: string, value: any): Error {
+ return new Error(`Unexpected switch value: ${value} encountered for ${name}`);
+ },
+ getCurrentUnixTimestampSec(): BigNumber {
+ return new BigNumber(Date.now() / 1000).round();
+ },
+ getCurrentUnixTimestampMs(): BigNumber {
+ return new BigNumber(Date.now());
+ },
+};