aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers/src/utils/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contract-wrappers/src/utils/utils.ts')
-rw-r--r--packages/contract-wrappers/src/utils/utils.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/contract-wrappers/src/utils/utils.ts b/packages/contract-wrappers/src/utils/utils.ts
new file mode 100644
index 000000000..af1125632
--- /dev/null
+++ b/packages/contract-wrappers/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());
+ },
+};