aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-09-19 22:48:57 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-09-19 22:48:57 +0800
commita03b1d4d6cc5548f4c2f07a933a4c2cc6be3b053 (patch)
treea1abe139a77260d3520526fcc8f9cc8a5203c715 /packages
parent14345ab24e0cd8db7bd2804b169acfaf18040ea4 (diff)
downloaddexon-0x-contracts-a03b1d4d6cc5548f4c2f07a933a4c2cc6be3b053.tar.gz
dexon-0x-contracts-a03b1d4d6cc5548f4c2f07a933a4c2cc6be3b053.tar.zst
dexon-0x-contracts-a03b1d4d6cc5548f4c2f07a933a4c2cc6be3b053.zip
Move ObjectMap to shared types
Diffstat (limited to 'packages')
-rw-r--r--packages/types/CHANGELOG.json9
-rw-r--r--packages/types/src/index.ts4
-rw-r--r--packages/website/ts/types.ts6
-rw-r--r--packages/website/ts/utils/analytics.ts3
-rw-r--r--packages/website/ts/utils/token_address_overrides.ts2
5 files changed, 17 insertions, 7 deletions
diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json
index 008ff8ff4..8448f4ae6 100644
--- a/packages/types/CHANGELOG.json
+++ b/packages/types/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "1.1.0",
+ "changes": [
+ {
+ "note": "Add ObjectMap type",
+ "pr": 1037
+ }
+ ]
+ },
+ {
"version": "1.0.1",
"changes": [
{
diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts
index 48a9e23d1..25803e8c8 100644
--- a/packages/types/src/index.ts
+++ b/packages/types/src/index.ts
@@ -239,3 +239,7 @@ export enum StatusCodes {
MethodNotAllowed = 405,
GatewayTimeout = 504,
}
+
+export interface ObjectMap<T> {
+ [key: string]: T;
+}
diff --git a/packages/website/ts/types.ts b/packages/website/ts/types.ts
index 5fe9eef99..3c6d3df4d 100644
--- a/packages/website/ts/types.ts
+++ b/packages/website/ts/types.ts
@@ -1,4 +1,4 @@
-import { SignedOrder } from '@0xproject/types';
+import { ObjectMap, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Provider } from 'ethereum-types';
import * as React from 'react';
@@ -519,10 +519,6 @@ export interface OutdatedWrappedEtherByNetworkId {
export type ItemByAddress<T> = ObjectMap<T>;
-export interface ObjectMap<T> {
- [key: string]: T;
-}
-
export type TokenStateByAddress = ItemByAddress<TokenState>;
export interface TokenState {
diff --git a/packages/website/ts/utils/analytics.ts b/packages/website/ts/utils/analytics.ts
index 62dbff2b9..3aae317b0 100644
--- a/packages/website/ts/utils/analytics.ts
+++ b/packages/website/ts/utils/analytics.ts
@@ -1,6 +1,7 @@
import { assetDataUtils } from '@0xproject/order-utils';
+import { ObjectMap } from '@0xproject/types';
import * as _ from 'lodash';
-import { ObjectMap, PortalOrder } from 'ts/types';
+import { PortalOrder } from 'ts/types';
import { utils } from 'ts/utils/utils';
export interface HeapAnalytics {
diff --git a/packages/website/ts/utils/token_address_overrides.ts b/packages/website/ts/utils/token_address_overrides.ts
index 8353358bc..e7e916273 100644
--- a/packages/website/ts/utils/token_address_overrides.ts
+++ b/packages/website/ts/utils/token_address_overrides.ts
@@ -1,4 +1,4 @@
-import { ObjectMap } from 'ts/types';
+import { ObjectMap } from '@0xproject/types';
import { constants } from 'ts/utils/constants';
// Map of networkId -> tokenSymbol -> tokenAddress