From 12dc8c0d158517b77ac548e0f102a45068f2f5e3 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Thu, 21 Dec 2017 14:44:09 -0500 Subject: Add missing calls to bigNumberConfigs in packages where we are instantiating BigNumbers --- packages/connect/package.json | 1 + packages/connect/src/http_client.ts | 5 ----- packages/connect/src/index.ts | 5 +++++ packages/web3-wrapper/src/index.ts | 8 +++++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/connect/package.json b/packages/connect/package.json index bf92f07d2..5daac8aae 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -38,6 +38,7 @@ "dependencies": { "@0xproject/assert": "^0.0.8", "@0xproject/json-schemas": "^0.7.0", + "@0xproject/utils": "^0.1.1", "bignumber.js": "~4.1.0", "isomorphic-fetch": "^2.2.1", "lodash": "^4.17.4", diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index 3bada2be0..028a6c07b 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -21,11 +21,6 @@ import { } from './types'; import {typeConverters} from './utils/type_converters'; -// TODO: move this and bigNumberConfigs in the 0x.js package into one place -BigNumber.config({ - EXPONENTIAL_AT: 1000, -}); - /** * This class includes all the functionality related to interacting with a set of HTTP endpoints * that implement the standard relayer API v0 diff --git a/packages/connect/src/index.ts b/packages/connect/src/index.ts index ec369a606..c0f847d09 100644 --- a/packages/connect/src/index.ts +++ b/packages/connect/src/index.ts @@ -1,3 +1,8 @@ +import {bigNumberConfigs} from '@0xproject/utils'; + +// Customize our BigNumber instances +bigNumberConfigs.configure(); + export {HttpClient} from './http_client'; export {WebSocketOrderbookChannel} from './ws_orderbook_channel'; export { diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts index dd94d683e..b48532204 100644 --- a/packages/web3-wrapper/src/index.ts +++ b/packages/web3-wrapper/src/index.ts @@ -1,5 +1,8 @@ import {TransactionReceipt, TxData} from '@0xproject/types'; -import {promisify} from '@0xproject/utils'; +import { + bigNumberConfigs, + promisify, +} from '@0xproject/utils'; import BigNumber from 'bignumber.js'; import * as _ from 'lodash'; import * as Web3 from 'web3'; @@ -15,6 +18,9 @@ interface RawLogEntry { topics: string[]; } +// Customize our BigNumber instances +bigNumberConfigs.configure(); + export class Web3Wrapper { private _web3: Web3; private _defaults: Partial; -- cgit From f8cbfea4a19bb5f55a7450e7817281b986365431 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Thu, 21 Dec 2017 15:40:09 -0500 Subject: Remove unused import --- packages/connect/src/http_client.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index 028a6c07b..924421f63 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -1,6 +1,5 @@ import {assert} from '@0xproject/assert'; import {schemas} from '@0xproject/json-schemas'; -import {BigNumber} from 'bignumber.js'; import 'isomorphic-fetch'; import * as _ from 'lodash'; import * as queryString from 'query-string'; -- cgit