aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders
diff options
context:
space:
mode:
Diffstat (limited to 'packages/subproviders')
-rw-r--r--packages/subproviders/.npmignore1
-rw-r--r--packages/subproviders/README.md8
-rw-r--r--packages/subproviders/package.json6
-rw-r--r--packages/subproviders/src/globals.d.ts8
-rw-r--r--packages/subproviders/src/index.ts2
-rw-r--r--packages/subproviders/src/subproviders/empty_wallet_subprovider.ts4
-rw-r--r--packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts4
-rw-r--r--packages/subproviders/src/subproviders/ganache.ts3
-rw-r--r--packages/subproviders/src/subproviders/injected_web3.ts3
-rw-r--r--packages/subproviders/src/subproviders/ledger.ts4
-rw-r--r--packages/subproviders/src/subproviders/nonce_tracker.ts17
-rw-r--r--packages/subproviders/src/subproviders/redundant_rpc.ts6
-rw-r--r--packages/subproviders/src/subproviders/subprovider.ts5
-rw-r--r--packages/subproviders/src/types.ts7
-rw-r--r--packages/subproviders/test/integration/ledger_subprovider_test.ts11
-rw-r--r--packages/subproviders/test/unit/ledger_subprovider_test.ts17
-rw-r--r--packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts5
-rw-r--r--packages/subproviders/tsconfig.json5
18 files changed, 54 insertions, 62 deletions
diff --git a/packages/subproviders/.npmignore b/packages/subproviders/.npmignore
index 05fa23a59..44df80fad 100644
--- a/packages/subproviders/.npmignore
+++ b/packages/subproviders/.npmignore
@@ -4,3 +4,4 @@ yarn-error.log
/scripts/
test/
tsconfig.json
+/lib/src/monorepo_scripts/
diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md
index a2bf75768..ac92b89d2 100644
--- a/packages/subproviders/README.md
+++ b/packages/subproviders/README.md
@@ -14,10 +14,10 @@ yarn add @0xproject/subproviders
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",
-]
+```json
+"compilerOptions": {
+ "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+}
```
## Contributing
diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json
index 96d3e7f00..411fe22dc 100644
--- a/packages/subproviders/package.json
+++ b/packages/subproviders/package.json
@@ -36,6 +36,7 @@
"@0xproject/assert": "^0.2.3",
"@0xproject/types": "^0.4.1",
"@0xproject/utils": "^0.4.3",
+ "@0xproject/typescript-typings": "^0.0.1",
"@ledgerhq/hw-app-eth": "^4.3.0",
"@ledgerhq/hw-transport-u2f": "^4.3.0",
"bn.js": "^4.11.8",
@@ -47,8 +48,7 @@
"lodash": "^4.17.4",
"semaphore-async-await": "^1.5.1",
"web3": "^0.20.0",
- "web3-provider-engine": "^13.0.1",
- "web3-typescript-typings": "^0.10.2"
+ "web3-provider-engine": "^13.0.1"
},
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.1.14",
@@ -59,8 +59,6 @@
"@types/node": "^8.0.53",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
- "chai-as-promised-typescript-typings": "^0.0.12",
- "chai-typescript-typings": "^0.0.6",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"mocha": "^4.0.1",
diff --git a/packages/subproviders/src/globals.d.ts b/packages/subproviders/src/globals.d.ts
index 2c86346f5..ebc4efe86 100644
--- a/packages/subproviders/src/globals.d.ts
+++ b/packages/subproviders/src/globals.d.ts
@@ -73,11 +73,11 @@ declare module 'web3-provider-engine/subproviders/subprovider' {
export = Subprovider;
}
declare module 'web3-provider-engine/subproviders/rpc' {
- import * as Web3 from 'web3';
+ import { JSONRPCRequestPayload } from '@0xproject/types';
class RpcSubprovider {
constructor(options: { rpcUrl: string });
public handleRequest(
- payload: Web3.JSONRPCRequestPayload,
+ payload: JSONRPCRequestPayload,
next: () => void,
end: (err: Error | null, data?: any) => void,
): void;
@@ -102,11 +102,11 @@ declare module 'web3-provider-engine/util/rpc-cache-utils' {
export = ProviderEngineRpcUtils;
}
declare module 'web3-provider-engine/subproviders/fixture' {
- import * as Web3 from 'web3';
+ import { JSONRPCRequestPayload } from '@0xproject/types';
class FixtureSubprovider {
constructor(staticResponses: any);
public handleRequest(
- payload: Web3.JSONRPCRequestPayload,
+ payload: JSONRPCRequestPayload,
next: () => void,
end: (err: Error | null, data?: any) => void,
): void;
diff --git a/packages/subproviders/src/index.ts b/packages/subproviders/src/index.ts
index d88792fd0..9786347e6 100644
--- a/packages/subproviders/src/index.ts
+++ b/packages/subproviders/src/index.ts
@@ -1,5 +1,6 @@
import Eth from '@ledgerhq/hw-app-eth';
import TransportU2F from '@ledgerhq/hw-transport-u2f';
+export { ECSignature } from '@0xproject/types';
import { LedgerEthereumClient } from './types';
@@ -15,7 +16,6 @@ export {
Callback,
ErrorCallback,
NextCallback,
- ECSignature,
LedgerWalletSubprovider,
LedgerCommunicationClient,
NonceSubproviderErrors,
diff --git a/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts b/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts
index dc570b152..595ec654d 100644
--- a/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts
+++ b/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts
@@ -1,4 +1,4 @@
-import * as Web3 from 'web3';
+import { JSONRPCRequestPayload } from '@0xproject/types';
import { Callback, ErrorCallback } from '../types';
@@ -18,7 +18,7 @@ export class EmptyWalletSubprovider extends Subprovider {
* @param end Callback to call if subprovider handled the request and wants to pass back the request.
*/
// tslint:disable-next-line:prefer-function-over-method
- public handleRequest(payload: Web3.JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
+ public handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
switch (payload.method) {
case 'eth_accounts':
end(null, []);
diff --git a/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts b/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts
index a6f978db1..966c37d8a 100644
--- a/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts
+++ b/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts
@@ -1,4 +1,4 @@
-import * as Web3 from 'web3';
+import { JSONRPCRequestPayload } from '@0xproject/types';
import { Callback, ErrorCallback } from '../types';
@@ -32,7 +32,7 @@ export class FakeGasEstimateSubprovider extends Subprovider {
* @param end Callback to call if subprovider handled the request and wants to pass back the request.
*/
// tslint:disable-next-line:prefer-function-over-method
- public handleRequest(payload: Web3.JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
+ public handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
switch (payload.method) {
case 'eth_estimateGas':
end(null, this._constantGasAmount);
diff --git a/packages/subproviders/src/subproviders/ganache.ts b/packages/subproviders/src/subproviders/ganache.ts
index fc0b9c3d2..785de792d 100644
--- a/packages/subproviders/src/subproviders/ganache.ts
+++ b/packages/subproviders/src/subproviders/ganache.ts
@@ -1,3 +1,4 @@
+import { JSONRPCRequestPayload } from '@0xproject/types';
import * as Ganache from 'ganache-core';
import * as Web3 from 'web3';
@@ -28,7 +29,7 @@ export class GanacheSubprovider extends Subprovider {
* @param end Callback to call if subprovider handled the request and wants to pass back the request.
*/
// tslint:disable-next-line:prefer-function-over-method
- public handleRequest(payload: Web3.JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
+ public handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
this._ganacheProvider.sendAsync(payload, (err: Error | null, result: any) => {
end(err, result && result.result);
});
diff --git a/packages/subproviders/src/subproviders/injected_web3.ts b/packages/subproviders/src/subproviders/injected_web3.ts
index cd9b0b603..edecd8bf6 100644
--- a/packages/subproviders/src/subproviders/injected_web3.ts
+++ b/packages/subproviders/src/subproviders/injected_web3.ts
@@ -1,3 +1,4 @@
+import { JSONRPCRequestPayload } from '@0xproject/types';
import * as _ from 'lodash';
import * as Web3 from 'web3';
@@ -30,7 +31,7 @@ export class InjectedWeb3Subprovider extends Subprovider {
* @param end Callback to call if subprovider handled the request and wants to pass back the request.
*/
// tslint:disable-next-line:prefer-function-over-method
- public handleRequest(payload: Web3.JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
+ public handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
switch (payload.method) {
case 'web3_clientVersion':
this._injectedWeb3.version.getNode(end);
diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts
index 8bc70d8b6..95784a391 100644
--- a/packages/subproviders/src/subproviders/ledger.ts
+++ b/packages/subproviders/src/subproviders/ledger.ts
@@ -1,11 +1,11 @@
import { assert } from '@0xproject/assert';
+import { JSONRPCRequestPayload } from '@0xproject/types';
import { addressUtils } from '@0xproject/utils';
import EthereumTx = require('ethereumjs-tx');
import ethUtil = require('ethereumjs-util');
import HDNode = require('hdkey');
import * as _ from 'lodash';
import { Lock } from 'semaphore-async-await';
-import * as Web3 from 'web3';
import {
Callback,
@@ -208,7 +208,7 @@ export class LedgerSubprovider extends Subprovider {
*/
// tslint:disable-next-line:async-suffix
public async handleRequest(
- payload: Web3.JSONRPCRequestPayload,
+ payload: JSONRPCRequestPayload,
next: Callback,
end: (err: Error | null, result?: any) => void,
) {
diff --git a/packages/subproviders/src/subproviders/nonce_tracker.ts b/packages/subproviders/src/subproviders/nonce_tracker.ts
index 249f16199..907330111 100644
--- a/packages/subproviders/src/subproviders/nonce_tracker.ts
+++ b/packages/subproviders/src/subproviders/nonce_tracker.ts
@@ -1,9 +1,8 @@
import * as _ from 'lodash';
-import { BlockParamLiteral } from '@0xproject/types';
+import { BlockParamLiteral, JSONRPCRequestPayload } from '@0xproject/types';
import EthereumTx = require('ethereumjs-tx');
import ethUtil = require('ethereumjs-util');
-import * as Web3 from 'web3';
import providerEngineUtils = require('web3-provider-engine/util/rpc-cache-utils');
import { Callback, ErrorCallback, NextCallback, NonceSubproviderErrors } from '../types';
@@ -19,7 +18,7 @@ const NONCE_TOO_LOW_ERROR_MESSAGE = 'Transaction nonce is too low';
*/
export class NonceTrackerSubprovider extends Subprovider {
private _nonceCache: { [address: string]: string } = {};
- private static _reconstructTransaction(payload: Web3.JSONRPCRequestPayload): EthereumTx {
+ private static _reconstructTransaction(payload: JSONRPCRequestPayload): EthereumTx {
const raw = payload.params[0];
if (_.isUndefined(raw)) {
throw new Error(NonceSubproviderErrors.EmptyParametersFound);
@@ -28,7 +27,7 @@ export class NonceTrackerSubprovider extends Subprovider {
const transaction = new EthereumTx(rawData);
return transaction;
}
- private static _determineAddress(payload: Web3.JSONRPCRequestPayload): string {
+ private static _determineAddress(payload: JSONRPCRequestPayload): string {
let address: string;
switch (payload.method) {
case 'eth_getTransactionCount':
@@ -55,11 +54,7 @@ export class NonceTrackerSubprovider extends Subprovider {
* @param end Callback to call if subprovider handled the request and wants to pass back the request.
*/
// tslint:disable-next-line:async-suffix
- public async handleRequest(
- payload: Web3.JSONRPCRequestPayload,
- next: NextCallback,
- end: ErrorCallback,
- ): Promise<void> {
+ public async handleRequest(payload: JSONRPCRequestPayload, next: NextCallback, end: ErrorCallback): Promise<void> {
switch (payload.method) {
case 'eth_getTransactionCount':
const requestDefaultBlock = providerEngineUtils.blockTagForPayload(payload);
@@ -92,7 +87,7 @@ export class NonceTrackerSubprovider extends Subprovider {
return next();
}
}
- private _handleSuccessfulTransaction(payload: Web3.JSONRPCRequestPayload): void {
+ private _handleSuccessfulTransaction(payload: JSONRPCRequestPayload): void {
const address = NonceTrackerSubprovider._determineAddress(payload);
const transaction = NonceTrackerSubprovider._reconstructTransaction(payload);
// Increment the nonce from the previous successfully submitted transaction
@@ -105,7 +100,7 @@ export class NonceTrackerSubprovider extends Subprovider {
const nextPrefixedHexNonce = `0x${nextHexNonce}`;
this._nonceCache[address] = nextPrefixedHexNonce;
}
- private _handleSendTransactionError(payload: Web3.JSONRPCRequestPayload, err: Error): void {
+ private _handleSendTransactionError(payload: JSONRPCRequestPayload, err: Error): void {
const address = NonceTrackerSubprovider._determineAddress(payload);
if (this._nonceCache[address] && _.includes(err.message, NONCE_TOO_LOW_ERROR_MESSAGE)) {
delete this._nonceCache[address];
diff --git a/packages/subproviders/src/subproviders/redundant_rpc.ts b/packages/subproviders/src/subproviders/redundant_rpc.ts
index ace2ed3c8..f8ff0915d 100644
--- a/packages/subproviders/src/subproviders/redundant_rpc.ts
+++ b/packages/subproviders/src/subproviders/redundant_rpc.ts
@@ -1,6 +1,6 @@
+import { JSONRPCRequestPayload } from '@0xproject/types';
import { promisify } from '@0xproject/utils';
import * as _ from 'lodash';
-import * as Web3 from 'web3';
import RpcSubprovider = require('web3-provider-engine/subproviders/rpc');
import { Callback } from '../types';
@@ -16,7 +16,7 @@ export class RedundantRPCSubprovider extends Subprovider {
private _rpcs: RpcSubprovider[];
private static async _firstSuccessAsync(
rpcs: RpcSubprovider[],
- payload: Web3.JSONRPCRequestPayload,
+ payload: JSONRPCRequestPayload,
next: Callback,
): Promise<any> {
let lastErr: Error | undefined;
@@ -55,7 +55,7 @@ export class RedundantRPCSubprovider extends Subprovider {
*/
// tslint:disable-next-line:async-suffix
public async handleRequest(
- payload: Web3.JSONRPCRequestPayload,
+ payload: JSONRPCRequestPayload,
next: Callback,
end: (err: Error | null, data?: any) => void,
): Promise<void> {
diff --git a/packages/subproviders/src/subproviders/subprovider.ts b/packages/subproviders/src/subproviders/subprovider.ts
index 4fa351e11..26ce19305 100644
--- a/packages/subproviders/src/subproviders/subprovider.ts
+++ b/packages/subproviders/src/subproviders/subprovider.ts
@@ -1,3 +1,4 @@
+import { JSONRPCRequestPayload, JSONRPCResponsePayload } from '@0xproject/types';
import promisify = require('es6-promisify');
import * as Web3 from 'web3';
@@ -37,9 +38,7 @@ export class Subprovider {
* @param payload JSON RPC payload
* @returns JSON RPC response payload
*/
- public async emitPayloadAsync(
- payload: Partial<JSONRPCRequestPayloadWithMethod>,
- ): Promise<Web3.JSONRPCResponsePayload> {
+ public async emitPayloadAsync(payload: Partial<JSONRPCRequestPayloadWithMethod>): Promise<JSONRPCResponsePayload> {
const finalPayload = Subprovider._createFinalPayload(payload);
const response = await promisify(this._engine.sendAsync, this._engine)(finalPayload);
return response;
diff --git a/packages/subproviders/src/types.ts b/packages/subproviders/src/types.ts
index 9bb9ff696..a1fec1882 100644
--- a/packages/subproviders/src/types.ts
+++ b/packages/subproviders/src/types.ts
@@ -1,8 +1,5 @@
-import { ECSignature } from '@0xproject/types';
+import { ECSignature, JSONRPCRequestPayload } from '@0xproject/types';
import * as _ from 'lodash';
-import * as Web3 from 'web3';
-
-export { ECSignature } from '@0xproject/types';
export interface LedgerCommunicationClient {
close: () => Promise<void>;
@@ -116,6 +113,6 @@ export type Callback = () => void;
export type OnNextCompleted = (err: Error | null, result: any, cb: Callback) => void;
export type NextCallback = (callback?: OnNextCompleted) => void;
-export interface JSONRPCRequestPayloadWithMethod extends Web3.JSONRPCRequestPayload {
+export interface JSONRPCRequestPayloadWithMethod extends JSONRPCRequestPayload {
method: string;
}
diff --git a/packages/subproviders/test/integration/ledger_subprovider_test.ts b/packages/subproviders/test/integration/ledger_subprovider_test.ts
index a94cfbe3a..969081ad5 100644
--- a/packages/subproviders/test/integration/ledger_subprovider_test.ts
+++ b/packages/subproviders/test/integration/ledger_subprovider_test.ts
@@ -1,3 +1,4 @@
+import { JSONRPCResponsePayload } from '@0xproject/types';
import Eth from '@ledgerhq/hw-app-eth';
// HACK: This depdency is optional and tslint skips optional depdencies
// tslint:disable-next-line:no-implicit-dependencies
@@ -97,7 +98,7 @@ describe('LedgerSubprovider', () => {
params: [],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
expect(response.result.length).to.be.equal(10);
done();
@@ -115,7 +116,7 @@ describe('LedgerSubprovider', () => {
params: [signer, messageHex],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
expect(response.result.length).to.be.equal(132);
expect(response.result.substr(0, 2)).to.be.equal('0x');
@@ -135,7 +136,7 @@ describe('LedgerSubprovider', () => {
params: [messageHex, signer],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
expect(response.result.length).to.be.equal(132);
expect(response.result.substr(0, 2)).to.be.equal('0x');
@@ -155,7 +156,7 @@ describe('LedgerSubprovider', () => {
params: [tx],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
expect(response.result.raw.length).to.be.equal(206);
expect(response.result.raw.substr(0, 2)).to.be.equal('0x');
@@ -193,7 +194,7 @@ describe('LedgerSubprovider', () => {
params: [tx],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
const result = response.result;
expect(result.length).to.be.equal(66);
diff --git a/packages/subproviders/test/unit/ledger_subprovider_test.ts b/packages/subproviders/test/unit/ledger_subprovider_test.ts
index 4c0803a29..3cb487f02 100644
--- a/packages/subproviders/test/unit/ledger_subprovider_test.ts
+++ b/packages/subproviders/test/unit/ledger_subprovider_test.ts
@@ -1,3 +1,4 @@
+import { JSONRPCResponsePayload } from '@0xproject/types';
import * as chai from 'chai';
import * as ethUtils from 'ethereumjs-util';
import * as _ from 'lodash';
@@ -112,7 +113,7 @@ describe('LedgerSubprovider', () => {
params: [],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
expect(response.result.length).to.be.equal(10);
expect(response.result[0]).to.be.equal(FAKE_ADDRESS);
@@ -128,7 +129,7 @@ describe('LedgerSubprovider', () => {
params: ['0x0000000000000000000000000000000000000000', messageHex],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
expect(response.result).to.be.equal(
'0xa6cc284bff14b42bdf5e9286730c152be91719d478605ec46b3bebcd0ae491480652a1a7b742ceb0213d1e744316e285f41f878d8af0b8e632cbca4c279132d001',
@@ -145,7 +146,7 @@ describe('LedgerSubprovider', () => {
params: [messageHex, '0x0000000000000000000000000000000000000000'],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
expect(response.result).to.be.equal(
'0xa6cc284bff14b42bdf5e9286730c152be91719d478605ec46b3bebcd0ae491480652a1a7b742ceb0213d1e744316e285f41f878d8af0b8e632cbca4c279132d001',
@@ -168,7 +169,7 @@ describe('LedgerSubprovider', () => {
params: [tx],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
expect(response.result.raw.length).to.be.equal(192);
expect(response.result.raw.substr(0, 2)).to.be.equal('0x');
@@ -186,7 +187,7 @@ describe('LedgerSubprovider', () => {
params: ['0x0000000000000000000000000000000000000000', nonHexMessage],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null');
expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world');
done();
@@ -201,7 +202,7 @@ describe('LedgerSubprovider', () => {
params: [nonHexMessage, '0x0000000000000000000000000000000000000000'],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null');
expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world');
done();
@@ -219,7 +220,7 @@ describe('LedgerSubprovider', () => {
params: [tx],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null');
expect(err.message).to.be.equal(LedgerSubproviderErrors.SenderInvalidOrNotSupplied);
done();
@@ -238,7 +239,7 @@ describe('LedgerSubprovider', () => {
params: [tx],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null');
expect(err.message).to.be.equal(LedgerSubproviderErrors.SenderInvalidOrNotSupplied);
done();
diff --git a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts
index c3170745c..a347ab765 100644
--- a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts
+++ b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts
@@ -1,3 +1,4 @@
+import { JSONRPCResponsePayload } from '@0xproject/types';
import * as chai from 'chai';
import * as _ from 'lodash';
import Web3 = require('web3');
@@ -26,7 +27,7 @@ describe('RedundantRpcSubprovider', () => {
params: [],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
expect(response.result.length).to.be.equal(10);
done();
@@ -46,7 +47,7 @@ describe('RedundantRpcSubprovider', () => {
params: [],
id: 1,
};
- const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => {
+ const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => {
expect(err).to.be.a('null');
expect(response.result.length).to.be.equal(10);
done();
diff --git a/packages/subproviders/tsconfig.json b/packages/subproviders/tsconfig.json
index 9a65a0a97..7b93af0da 100644
--- a/packages/subproviders/tsconfig.json
+++ b/packages/subproviders/tsconfig.json
@@ -6,10 +6,7 @@
"include": [
"./src/**/*",
"./test/**/*",
- "../../node_modules/chai-typescript-typings/index.d.ts",
- "../../node_modules/web3-typescript-typings/index.d.ts",
"../../node_modules/types-bn/index.d.ts",
- "../../node_modules/types-ethereumjs-util/index.d.ts",
- "../../node_modules/chai-as-promised-typescript-typings/index.d.ts"
+ "../../node_modules/types-ethereumjs-util/index.d.ts"
]
}