aboutsummaryrefslogblamecommitdiffstats
path: root/packages/0x.js/src/utils/utils.ts
blob: af1125632a59ba21780edf1b6c06c366c19a7413 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
                                             
 
                      


                                                                                      





                                                        
  
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());
    },
};