aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/0x.js')
-rw-r--r--packages/0x.js/.npmignore1
-rw-r--r--packages/0x.js/CHANGELOG.md34
-rw-r--r--packages/0x.js/README.md9
-rw-r--r--packages/0x.js/package.json7
-rw-r--r--packages/0x.js/src/artifacts/TokenRegistry.json2
-rw-r--r--packages/0x.js/src/contract_wrappers/contract_wrapper.ts18
-rw-r--r--packages/0x.js/src/contract_wrappers/exchange_wrapper.ts4
-rw-r--r--packages/0x.js/src/contract_wrappers/generated/.gitignore1
-rw-r--r--packages/0x.js/src/globals.d.ts5
-rw-r--r--packages/0x.js/src/index.ts2
-rw-r--r--packages/0x.js/src/order_watcher/event_watcher.ts10
-rw-r--r--packages/0x.js/src/types.ts11
-rw-r--r--packages/0x.js/src/utils/filter_utils.ts24
-rw-r--r--packages/0x.js/test/0x.js_test.ts4
-rw-r--r--packages/0x.js/test/event_watcher_test.ts13
-rw-r--r--packages/0x.js/tsconfig.json6
16 files changed, 74 insertions, 77 deletions
diff --git a/packages/0x.js/.npmignore b/packages/0x.js/.npmignore
index 7fd911797..6a3eb57bd 100644
--- a/packages/0x.js/.npmignore
+++ b/packages/0x.js/.npmignore
@@ -8,3 +8,4 @@ test/
/contract_templates/
/generated_docs/
/scripts/
+/lib/src/monorepo_scripts/
diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md
index fa3b3db91..ca6b985d3 100644
--- a/packages/0x.js/CHANGELOG.md
+++ b/packages/0x.js/CHANGELOG.md
@@ -2,7 +2,6 @@
## v0.34.0 - _TBD_
- * Update Kovan EtherToken artifact address to match TokenRegistry.
* Fix the bug causing `zeroEx.exchange.fillOrdersUpToAsync` validation to fail if there were some extra orders passed (#470)
## v0.33.2 - _March 18, 2018_
@@ -42,10 +41,7 @@
## v0.31.0 - _January 30, 2018_
- * Add the `shouldAddPersonalMessagePrefix` parameter to `signOrderHashAsync` so that the
- caller can decide on whether to add the personalMessage prefix before relaying the request
- to the signer. Parity Signer, Ledger and TestRPC add the prefix themselves, Metamask expects
- it to have already been added. (#349)
+ * Add the `shouldAddPersonalMessagePrefix` parameter to `signOrderHashAsync` so that the caller can decide on whether to add the personalMessage prefix before relaying the request to the signer. Parity Signer, Ledger and TestRPC add the prefix themselves, Metamask expects it to have already been added. (#349)
## v0.30.2 - _January 29, 2018_
@@ -238,11 +234,11 @@
* Added `zeroEx.token.setUnlimitedAllowanceAsync` (#137)
* Added `zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS` (#137)
-## v0.10.4 - _Aug 24, 2017_
+## v0.10.4 - _August 24, 2017_
* Fixed a bug where checksummed addresses were being pulled from artifacts and not lower-cased. (#135)
-## v0.10.1 - _Aug 24, 2017_
+## v0.10.1 - _August 24, 2017_
* Added `zeroEx.exchange.validateFillOrderThrowIfInvalidAsync` (#128)
* Added `zeroEx.exchange.validateFillOrKillOrderThrowIfInvalidAsync` (#128)
@@ -257,20 +253,20 @@
* Added clear error message when checksummed address is passed to a public method (#124)
* Fixes the description of `shouldThrowOnInsufficientBalanceOrAllowance` in docs (#127)
-## v0.9.3 - _Aug 22, 2017_
+## v0.9.3 - _August 22, 2017_
* Update contract artifacts to include latest Kovan and Mainnet deploys (#118)
-## v0.9.2 - _Aug 21, 2017_
+## v0.9.2 - _August 21, 2017_
* *This version was unpublished because of a publishing issue.*
* Update contract artifacts to include latest Kovan and Mainnet deploys (#118)
-## v0.9.1 - _Aug. 16, 2017_
+## v0.9.1 - _August 16, 2017_
* Fixed the bug causing `zeroEx.token.getBalanceAsync()` to fail if no addresses available (#120)
-## v0.9.0 - _Jul. 26, 2017_
+## v0.9.0 - _July 26, 2017_
* Migrated to the new version of smart contracts (#101)
* Removed the ability to call methods on multiple authorized Exchange smart contracts (#106)
@@ -281,7 +277,7 @@
* Updated to typescript v2.4 (#104)
* Fixed an issue with incorrect balance/allowance validation when ZRX is one of the tokens traded (#109)
-## v0.8.0 - _Jul. 4, 2017_
+## v0.8.0 - _July 4, 2017_
* Added the ability to call methods on different authorized versions of the Exchange smart contract (#82)
* Updated contract artifacts to reflect latest changes to the smart contracts (0xproject/contracts#59)
@@ -294,35 +290,35 @@
* `zeroEx.tokenRegistry.invalidateContractInstance`
* Fixed the bug where `zeroEx.setProviderAsync` didn't invalidate etherToken contract's instance
-## v0.7.1 - _Jun. 26, 2017_
+## v0.7.1 - _June 26, 2017_
* Added the ability to convert Ether to wrapped Ether tokens and back via `zeroEx.etherToken.depostAsync` and `zeroEx.etherToken.withdrawAsync` (#81)
-## v0.7.0 - _Jun. 22, 2017_
+## v0.7.0 - _June 22, 2017_
* Added Kovan smart contract artifacts (#78)
* Started returning fillAmount from `fillOrderAsync` and `fillUpToAsync` (#72)
* Started returning cancelledAmount from `cancelOrderAsync` (#72)
* Renamed type `LogCancelArgs` to `LogCancelContractEventArgs` and `LogFillArgs` to `LogFillContractEventArgs`
-## v0.6.2 - _Jun. 21, 2017_
+## v0.6.2 - _June 21, 2017_
* Reduced bundle size
* Improved documentation
-## v0.6.1 - _Jun. 19, 2017_
+## v0.6.1 - _June 19, 2017_
* Improved documentation
-## v0.6.0 - _Jun. 19, 2017_
+## v0.6.0 - _June 19, 2017_
* Made `ZeroEx` class accept `Web3Provider` instance instead of `Web3` instance
* Added types for contract event arguments
-## v0.5.2 - _Jun. 15, 2017_
+## v0.5.2 - _June 15, 2017_
* Fixed the bug in `postpublish` script that caused that only unminified UMD bundle was uploaded to release page
-## v0.5.1 - _Jun. 15, 2017_
+## v0.5.1 - _June 15, 2017_
* Added `postpublish` script to publish to Github Releases with assets.
diff --git a/packages/0x.js/README.md b/packages/0x.js/README.md
index 2d0394726..5b17dac8b 100644
--- a/packages/0x.js/README.md
+++ b/packages/0x.js/README.md
@@ -20,11 +20,10 @@ import { ZeroEx } from '0x.js';
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
-```
-"include": [
- "./node_modules/web3-typescript-typings/index.d.ts",
- "./node_modules/ethers-typescript-typings/index.d.ts"
-]
+```json
+"compilerOptions": {
+ "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+}
```
#### UMD:
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json
index 5f5b32aac..49d96235c 100644
--- a/packages/0x.js/package.json
+++ b/packages/0x.js/package.json
@@ -68,9 +68,7 @@
"awesome-typescript-loader": "^3.1.3",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
- "chai-as-promised-typescript-typings": "^0.0.12",
"chai-bignumber": "^2.0.1",
- "chai-typescript-typings": "^0.0.6",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"json-loader": "^0.5.4",
@@ -99,18 +97,17 @@
"@0xproject/types": "^0.4.1",
"@0xproject/utils": "^0.4.3",
"@0xproject/web3-wrapper": "^0.3.1",
+ "@0xproject/typescript-typings": "^0.0.1",
"bintrees": "^1.0.2",
"bn.js": "^4.11.8",
"ethereumjs-abi": "^0.6.4",
"ethereumjs-blockstream": "^2.0.6",
"ethereumjs-util": "^5.1.1",
"ethers-contracts": "^2.2.1",
- "ethers-typescript-typings": "^0.0.4",
"js-sha3": "^0.7.0",
"lodash": "^4.17.4",
"uuid": "^3.1.0",
- "web3": "^0.20.0",
- "web3-typescript-typings": "^0.10.2"
+ "web3": "^0.20.0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/0x.js/src/artifacts/TokenRegistry.json b/packages/0x.js/src/artifacts/TokenRegistry.json
index 95bee4b1d..0f583628c 100644
--- a/packages/0x.js/src/artifacts/TokenRegistry.json
+++ b/packages/0x.js/src/artifacts/TokenRegistry.json
@@ -538,7 +538,7 @@
"address": "0x4e9aad8184de8833365fea970cd9149372fdf1e6"
},
"42": {
- "address": "0xd0a1e359811322d97991e03f863a0c30c2cf029c"
+ "address": "0xf18e504561f4347bea557f3d4558f559dddbae7f"
},
"50": {
"address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082"
diff --git a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
index ad7727de5..6c96428ed 100644
--- a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
@@ -1,4 +1,4 @@
-import { BlockParamLiteral, LogWithDecodedArgs, RawLog } from '@0xproject/types';
+import { BlockParamLiteral, ContractAbi, FilterObject, LogEntry, LogWithDecodedArgs, RawLog } from '@0xproject/types';
import { AbiDecoder, intervalUtils } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Block, BlockAndLogStreamer } from 'ethereumjs-blockstream';
@@ -35,7 +35,7 @@ export class ContractWrapper {
private _abiDecoder?: AbiDecoder;
private _blockAndLogStreamerIfExists?: BlockAndLogStreamer;
private _blockAndLogStreamIntervalIfExists?: NodeJS.Timer;
- private _filters: { [filterToken: string]: Web3.FilterObject };
+ private _filters: { [filterToken: string]: FilterObject };
private _filterCallbacks: {
[filterToken: string]: EventCallback<ContractEventArgs>;
};
@@ -75,7 +75,7 @@ export class ContractWrapper {
address: string,
eventName: ContractEvents,
indexFilterValues: IndexedFilterValues,
- abi: Web3.ContractAbi,
+ abi: ContractAbi,
callback: EventCallback<ArgsType>,
): string {
const filter = filterUtils.getFilter(address, eventName, indexFilterValues, abi);
@@ -92,7 +92,7 @@ export class ContractWrapper {
eventName: ContractEvents,
blockRange: BlockRange,
indexFilterValues: IndexedFilterValues,
- abi: Web3.ContractAbi,
+ abi: ContractAbi,
): Promise<Array<LogWithDecodedArgs<ArgsType>>> {
const filter = filterUtils.getFilter(address, eventName, indexFilterValues, abi, blockRange);
const logs = await this._web3Wrapper.getLogsAsync(filter);
@@ -100,7 +100,7 @@ export class ContractWrapper {
return logsWithDecodedArguments;
}
protected _tryToDecodeLogOrNoop<ArgsType extends ContractEventArgs>(
- log: Web3.LogEntry,
+ log: LogEntry,
): LogWithDecodedArgs<ArgsType> | RawLog {
if (_.isUndefined(this._abiDecoder)) {
throw new Error(InternalZeroExError.NoAbiDecoder);
@@ -111,7 +111,7 @@ export class ContractWrapper {
protected async _getContractAbiAndAddressFromArtifactsAsync(
artifact: Artifact,
addressIfExists?: string,
- ): Promise<[Web3.ContractAbi, string]> {
+ ): Promise<[ContractAbi, string]> {
let contractAddress: string;
if (_.isUndefined(addressIfExists)) {
if (_.isUndefined(artifact.networks[this._networkId])) {
@@ -125,7 +125,7 @@ export class ContractWrapper {
if (!doesContractExist) {
throw new Error(CONTRACT_NAME_TO_NOT_FOUND_ERROR[artifact.contract_name]);
}
- const abiAndAddress: [Web3.ContractAbi, string] = [artifact.abi, contractAddress];
+ const abiAndAddress: [ContractAbi, string] = [artifact.abi, contractAddress];
return abiAndAddress;
}
protected _getContractAddress(artifact: Artifact, addressIfExists?: string): string {
@@ -139,8 +139,8 @@ export class ContractWrapper {
return addressIfExists;
}
}
- private _onLogStateChanged<ArgsType extends ContractEventArgs>(isRemoved: boolean, log: Web3.LogEntry): void {
- _.forEach(this._filters, (filter: Web3.FilterObject, filterToken: string) => {
+ private _onLogStateChanged<ArgsType extends ContractEventArgs>(isRemoved: boolean, log: LogEntry): void {
+ _.forEach(this._filters, (filter: FilterObject, filterToken: string) => {
if (filterUtils.matchesFilter(log, filter)) {
const decodedLog = this._tryToDecodeLogOrNoop(log) as LogWithDecodedArgs<ArgsType>;
const logEvent = {
diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
index 59bd4db6b..6b5a75a9a 100644
--- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
@@ -3,6 +3,7 @@ import {
BlockParamLiteral,
DecodedLogArgs,
ECSignature,
+ LogEntry,
LogWithDecodedArgs,
Order,
SignedOrder,
@@ -10,7 +11,6 @@ import {
import { AbiDecoder, BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
-import * as Web3 from 'web3';
import { artifacts } from '../artifacts';
import {
@@ -863,7 +863,7 @@ export class ExchangeWrapper extends ContractWrapper {
* Checks if logs contain LogError, which is emitted by Exchange contract on transaction failure.
* @param logs Transaction logs as returned by `zeroEx.awaitTransactionMinedAsync`
*/
- public throwLogErrorsAsErrors(logs: Array<LogWithDecodedArgs<DecodedLogArgs> | Web3.LogEntry>): void {
+ public throwLogErrorsAsErrors(logs: Array<LogWithDecodedArgs<DecodedLogArgs> | LogEntry>): void {
const errLog = _.find(logs, {
event: ExchangeEvents.LogError,
});
diff --git a/packages/0x.js/src/contract_wrappers/generated/.gitignore b/packages/0x.js/src/contract_wrappers/generated/.gitignore
deleted file mode 100644
index 72e8ffc0d..000000000
--- a/packages/0x.js/src/contract_wrappers/generated/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*
diff --git a/packages/0x.js/src/globals.d.ts b/packages/0x.js/src/globals.d.ts
index e2c321f38..3e8ea21bc 100644
--- a/packages/0x.js/src/globals.d.ts
+++ b/packages/0x.js/src/globals.d.ts
@@ -37,12 +37,13 @@ declare module 'ethereumjs-abi' {
// truffle-hdwallet-provider declarations
declare module 'truffle-hdwallet-provider' {
+ import { JSONRPCRequestPayload, JSONRPCResponsePayload } from '@0xproject/types';
import * as Web3 from 'web3';
class HDWalletProvider implements Web3.Provider {
constructor(mnemonic: string, rpcUrl: string);
public sendAsync(
- payload: Web3.JSONRPCRequestPayload,
- callback: (err: Error, result: Web3.JSONRPCResponsePayload) => void,
+ payload: JSONRPCRequestPayload,
+ callback: (err: Error, result: JSONRPCResponsePayload) => void,
): void;
}
export = HDWalletProvider;
diff --git a/packages/0x.js/src/index.ts b/packages/0x.js/src/index.ts
index 7885fb82a..e353a1d3d 100644
--- a/packages/0x.js/src/index.ts
+++ b/packages/0x.js/src/index.ts
@@ -16,7 +16,6 @@ export {
MethodOpts,
OrderTransactionOpts,
TransactionOpts,
- FilterObject,
LogEvent,
DecodedLogEvent,
EventWatcherCallback,
@@ -28,6 +27,7 @@ export {
export {
BlockParamLiteral,
+ FilterObject,
BlockParam,
ContractEventArg,
LogWithDecodedArgs,
diff --git a/packages/0x.js/src/order_watcher/event_watcher.ts b/packages/0x.js/src/order_watcher/event_watcher.ts
index e67b93251..246ab8292 100644
--- a/packages/0x.js/src/order_watcher/event_watcher.ts
+++ b/packages/0x.js/src/order_watcher/event_watcher.ts
@@ -1,9 +1,7 @@
+import { BlockParamLiteral, LogEntry } from '@0xproject/types';
import { intervalUtils } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
-import * as Web3 from 'web3';
-
-import { BlockParamLiteral } from '@0xproject/types';
import { EventWatcherCallback, ZeroExError } from '../types';
import { assert } from '../utils/assert';
@@ -23,7 +21,7 @@ export class EventWatcher {
private _web3Wrapper: Web3Wrapper;
private _pollingIntervalMs: number;
private _intervalIdIfExists?: NodeJS.Timer;
- private _lastEvents: Web3.LogEntry[] = [];
+ private _lastEvents: LogEntry[] = [];
constructor(web3Wrapper: Web3Wrapper, pollingIntervalIfExistsMs: undefined | number) {
this._web3Wrapper = web3Wrapper;
this._pollingIntervalMs = _.isUndefined(pollingIntervalIfExistsMs)
@@ -69,7 +67,7 @@ export class EventWatcher {
await this._emitDifferencesAsync(newEvents, LogEventState.Added, callback);
this._lastEvents = pendingEvents;
}
- private async _getEventsAsync(): Promise<Web3.LogEntry[]> {
+ private async _getEventsAsync(): Promise<LogEntry[]> {
const eventFilter = {
fromBlock: BlockParamLiteral.Pending,
toBlock: BlockParamLiteral.Pending,
@@ -78,7 +76,7 @@ export class EventWatcher {
return events;
}
private async _emitDifferencesAsync(
- logs: Web3.LogEntry[],
+ logs: LogEntry[],
logEventState: LogEventState,
callback: EventWatcherCallback,
): Promise<void> {
diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts
index 65342b694..38cfb6306 100644
--- a/packages/0x.js/src/types.ts
+++ b/packages/0x.js/src/types.ts
@@ -3,7 +3,10 @@ import { BigNumber } from '@0xproject/utils';
import {
BlockParam,
BlockParamLiteral,
+ ContractAbi,
ContractEventArg,
+ FilterObject,
+ LogEntryEvent,
LogWithDecodedArgs,
Order,
SignedOrder,
@@ -48,7 +51,7 @@ export type OrderAddresses = [string, string, string, string, string];
export type OrderValues = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber];
-export type LogEvent = Web3.LogEntryEvent;
+export type LogEvent = LogEntryEvent;
export interface DecodedLogEvent<ArgsType> {
isRemoved: boolean;
log: LogWithDecodedArgs<ArgsType>;
@@ -197,7 +200,7 @@ export type ArtifactContractName = 'ZRX' | 'TokenTransferProxy' | 'TokenRegistry
export interface Artifact {
contract_name: ArtifactContractName;
- abi: Web3.ContractAbi;
+ abi: ContractAbi;
networks: {
[networkId: number]: {
address: string;
@@ -222,7 +225,7 @@ export interface ValidateOrderFillableOpts {
* flag when running Parity).
*/
export interface MethodOpts {
- defaultBlock?: Web3.BlockParam;
+ defaultBlock?: BlockParam;
}
/*
@@ -242,8 +245,6 @@ export interface OrderTransactionOpts extends TransactionOpts {
shouldValidate?: boolean;
}
-export type FilterObject = Web3.FilterObject;
-
export enum TradeSide {
Maker = 'maker',
Taker = 'taker',
diff --git a/packages/0x.js/src/utils/filter_utils.ts b/packages/0x.js/src/utils/filter_utils.ts
index 97205ace3..c5df7321e 100644
--- a/packages/0x.js/src/utils/filter_utils.ts
+++ b/packages/0x.js/src/utils/filter_utils.ts
@@ -1,8 +1,16 @@
+import {
+ ConstructorAbi,
+ ContractAbi,
+ EventAbi,
+ FallbackAbi,
+ FilterObject,
+ LogEntry,
+ MethodAbi,
+} from '@0xproject/types';
import * as ethUtil from 'ethereumjs-util';
import * as jsSHA3 from 'js-sha3';
import * as _ from 'lodash';
import * as uuid from 'uuid/v4';
-import * as Web3 from 'web3';
import { BlockRange, ContractEvents, IndexedFilterValues } from '../types';
@@ -16,15 +24,15 @@ export const filterUtils = {
address: string,
eventName: ContractEvents,
indexFilterValues: IndexedFilterValues,
- abi: Web3.ContractAbi,
+ abi: ContractAbi,
blockRange?: BlockRange,
- ): Web3.FilterObject {
- const eventAbi = _.find(abi, { name: eventName }) as Web3.EventAbi;
+ ): FilterObject {
+ const eventAbi = _.find(abi, { name: eventName }) as EventAbi;
const eventSignature = filterUtils.getEventSignatureFromAbiByName(eventAbi, eventName);
const topicForEventSignature = ethUtil.addHexPrefix(jsSHA3.keccak256(eventSignature));
const topicsForIndexedArgs = filterUtils.getTopicsForIndexedArgs(eventAbi, indexFilterValues);
const topics = [topicForEventSignature, ...topicsForIndexedArgs];
- let filter: Web3.FilterObject = {
+ let filter: FilterObject = {
address,
topics,
};
@@ -36,12 +44,12 @@ export const filterUtils = {
}
return filter;
},
- getEventSignatureFromAbiByName(eventAbi: Web3.EventAbi, eventName: ContractEvents): string {
+ getEventSignatureFromAbiByName(eventAbi: EventAbi, eventName: ContractEvents): string {
const types = _.map(eventAbi.inputs, 'type');
const signature = `${eventAbi.name}(${types.join(',')})`;
return signature;
},
- getTopicsForIndexedArgs(abi: Web3.EventAbi, indexFilterValues: IndexedFilterValues): Array<string | null> {
+ getTopicsForIndexedArgs(abi: EventAbi, indexFilterValues: IndexedFilterValues): Array<string | null> {
const topics: Array<string | null> = [];
for (const eventInput of abi.inputs) {
if (!eventInput.indexed) {
@@ -60,7 +68,7 @@ export const filterUtils = {
}
return topics;
},
- matchesFilter(log: Web3.LogEntry, filter: Web3.FilterObject): boolean {
+ matchesFilter(log: LogEntry, filter: FilterObject): boolean {
if (!_.isUndefined(filter.address) && log.address !== filter.address) {
return false;
}
diff --git a/packages/0x.js/test/0x.js_test.ts b/packages/0x.js/test/0x.js_test.ts
index d61847d1d..70e85aa52 100644
--- a/packages/0x.js/test/0x.js_test.ts
+++ b/packages/0x.js/test/0x.js_test.ts
@@ -216,7 +216,7 @@ describe('ZeroEx library', () => {
s: '0x050aa3cc1f2c435e67e114cdce54b9527b4f50548342401bc5d2b77adbdacb02',
};
stubs = [
- Sinon.stub((zeroEx as any)._web3Wrapper, 'signTransactionAsync').returns(Promise.resolve(signature)),
+ Sinon.stub((zeroEx as any)._web3Wrapper, 'signMessageAsync').returns(Promise.resolve(signature)),
Sinon.stub(ZeroEx, 'isValidSignature').returns(true),
];
@@ -237,7 +237,7 @@ describe('ZeroEx library', () => {
s: '0x2dea66f25a608bbae457e020fb6decb763deb8b7192abab624997242da248960',
};
stubs = [
- Sinon.stub((zeroEx as any)._web3Wrapper, 'signTransactionAsync').returns(Promise.resolve(signature)),
+ Sinon.stub((zeroEx as any)._web3Wrapper, 'signMessageAsync').returns(Promise.resolve(signature)),
Sinon.stub(ZeroEx, 'isValidSignature').returns(true),
];
diff --git a/packages/0x.js/test/event_watcher_test.ts b/packages/0x.js/test/event_watcher_test.ts
index 93ee9cd1c..2fa6c0580 100644
--- a/packages/0x.js/test/event_watcher_test.ts
+++ b/packages/0x.js/test/event_watcher_test.ts
@@ -1,4 +1,5 @@
import { web3Factory } from '@0xproject/dev-utils';
+import { LogEntry } from '@0xproject/types';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import * as _ from 'lodash';
@@ -21,7 +22,7 @@ describe('EventWatcher', () => {
let stubs: Sinon.SinonStub[] = [];
let eventWatcher: EventWatcher;
let web3Wrapper: Web3Wrapper;
- const logA: Web3.LogEntry = {
+ const logA: LogEntry = {
address: '0x71d271f8b14adef568f8f28f1587ce7271ac4ca5',
blockHash: null,
blockNumber: null,
@@ -31,7 +32,7 @@ describe('EventWatcher', () => {
transactionHash: '0x004881d38cd4a8f72f1a0d68c8b9b8124504706041ff37019c1d1ed6bfda8e17',
transactionIndex: 0,
};
- const logB: Web3.LogEntry = {
+ const logB: LogEntry = {
address: '0x8d12a197cb00d4747a1fe03395095ce2a5cc6819',
blockHash: null,
blockNumber: null,
@@ -41,7 +42,7 @@ describe('EventWatcher', () => {
transactionHash: '0x01ef3c048b18d9b09ea195b4ed94cf8dd5f3d857a1905ff886b152cfb1166f25',
transactionIndex: 0,
};
- const logC: Web3.LogEntry = {
+ const logC: LogEntry = {
address: '0x1d271f8b174adef58f1587ce68f8f27271ac4ca5',
blockHash: null,
blockNumber: null,
@@ -64,7 +65,7 @@ describe('EventWatcher', () => {
eventWatcher.unsubscribe();
});
it('correctly emits initial log events', (done: DoneCallback) => {
- const logs: Web3.LogEntry[] = [logA, logB];
+ const logs: LogEntry[] = [logA, logB];
const expectedLogEvents = [
{
removed: false,
@@ -89,8 +90,8 @@ describe('EventWatcher', () => {
eventWatcher.subscribe(callback);
});
it('correctly computes the difference and emits only changes', (done: DoneCallback) => {
- const initialLogs: Web3.LogEntry[] = [logA, logB];
- const changedLogs: Web3.LogEntry[] = [logA, logC];
+ const initialLogs: LogEntry[] = [logA, logB];
+ const changedLogs: LogEntry[] = [logA, logC];
const expectedLogEvents = [
{
removed: false,
diff --git a/packages/0x.js/tsconfig.json b/packages/0x.js/tsconfig.json
index a6b5c71c2..ddf5a910e 100644
--- a/packages/0x.js/tsconfig.json
+++ b/packages/0x.js/tsconfig.json
@@ -8,10 +8,6 @@
"./src/**/*",
"./test/**/*",
"../../node_modules/types-bn/index.d.ts",
- "../../node_modules/types-ethereumjs-util/index.d.ts",
- "../../node_modules/ethers-typescript-typings/index.d.ts",
- "../../node_modules/web3-typescript-typings/index.d.ts",
- "../../node_modules/chai-typescript-typings/index.d.ts",
- "../../node_modules/chai-as-promised-typescript-typings/index.d.ts"
+ "../../node_modules/types-ethereumjs-util/index.d.ts"
]
}