Port getOrderHash

This commit is contained in:
Leonid Logvinov
2017-05-25 17:24:29 +02:00
parent f7b8378a6e
commit f2f39d9eb2
6 changed files with 107 additions and 1 deletions

21
src/ts/types.ts Normal file
View File

@@ -0,0 +1,21 @@
import * as _ from 'lodash';
import * as BigNumber from 'bignumber.js';
// Utility function to create a K:V from a list of strings
// Adapted from: https://basarat.gitbooks.io/typescript/content/docs/types/literal-types.html
function strEnum(values: string[]): {[key: string]: string} {
return _.reduce(values, (result, key) => {
result[key] = key;
return result;
}, Object.create(null));
}
export const SolidityTypes = strEnum([
'address',
'uint256',
'uint8',
'string',
'bool',
]);
export type SolidityTypes = keyof typeof SolidityTypes;