aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-16 22:18:47 +0800
committerFabio Berger <me@fabioberger.com>2018-05-16 22:18:47 +0800
commit78623ae3bdba39b629a22aa2d15d8aee5e6225ab (patch)
treef44871dc1b081669c83cf041cebe559ecb57bace /packages/subproviders
parent136c6d01b3f01e6db8aab01c4b4b7315abadba24 (diff)
parent4de6221825447e77d7b1ee6bab28ce3407939301 (diff)
downloaddexon-sol-tools-78623ae3bdba39b629a22aa2d15d8aee5e6225ab.tar
dexon-sol-tools-78623ae3bdba39b629a22aa2d15d8aee5e6225ab.tar.gz
dexon-sol-tools-78623ae3bdba39b629a22aa2d15d8aee5e6225ab.tar.bz2
dexon-sol-tools-78623ae3bdba39b629a22aa2d15d8aee5e6225ab.tar.lz
dexon-sol-tools-78623ae3bdba39b629a22aa2d15d8aee5e6225ab.tar.xz
dexon-sol-tools-78623ae3bdba39b629a22aa2d15d8aee5e6225ab.tar.zst
dexon-sol-tools-78623ae3bdba39b629a22aa2d15d8aee5e6225ab.zip
Merge branch 'development' into v2-prototype
* development: (29 commits) Do not remove artifacts when running `clean` fix style errors Fix circular dependency Add my profile image to images Add myself to about page Add dogfood configs to website Revert to lerna:run lint Do lint sequentially Exclude monorepo-scripts from tslint as test Fix prettier Add hover state to top tokens Change to weekly txn volume Change minimum Node version to 6.12 Document Node.js version requirement and add it to package.json Apply prettier to some files which were not formatted correctly Fix TSLint issues Fix TSLint issues Update ethereeumjs-testrpc to ganache-cli Fix infinite loop Add changelog entries for packages where executable binary exporting fixed ... # Conflicts: # packages/contracts/package.json # packages/contracts/util/formatters.ts # packages/contracts/util/signed_order_utils.ts # packages/migrations/package.json # yarn.lock
Diffstat (limited to 'packages/subproviders')
-rw-r--r--packages/subproviders/README.md18
-rw-r--r--packages/subproviders/package.json7
-rw-r--r--packages/subproviders/src/subproviders/base_wallet_subprovider.ts6
-rw-r--r--packages/subproviders/src/subproviders/empty_wallet_subprovider.ts2
-rw-r--r--packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts2
-rw-r--r--packages/subproviders/src/subproviders/ganache.ts2
-rw-r--r--packages/subproviders/src/subproviders/injected_web3.ts2
-rw-r--r--packages/subproviders/src/subproviders/ledger.ts4
-rw-r--r--packages/subproviders/src/subproviders/mnemonic_wallet.ts2
-rw-r--r--packages/subproviders/src/subproviders/subprovider.ts2
-rw-r--r--packages/subproviders/test/chai_setup.ts2
-rw-r--r--packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts2
12 files changed, 21 insertions, 30 deletions
diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md
index 8c8807895..90c9b7bbe 100644
--- a/packages/subproviders/README.md
+++ b/packages/subproviders/README.md
@@ -42,28 +42,16 @@ yarn install
### Build
-If this is your **first** time building this package, you must first build **all** packages within the monorepo. This is because packages that depend on other packages located inside this monorepo are symlinked when run from **within** the monorepo. This allows you to make changes across multiple packages without first publishing dependent packages to NPM. To build all packages, run the following from the monorepo root directory:
+To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-yarn lerna:rebuild
+PKG=@0xproject/subproviders yarn build
```
Or continuously rebuild on change:
```bash
-yarn dev
-```
-
-You can also build this specific package by running the following from within its directory:
-
-```bash
-yarn build
-```
-
-or continuously rebuild on change:
-
-```bash
-yarn build:watch
+PKG=@0xproject/subproviders yarn watch
```
### Clean
diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json
index 92377f118..d9eda98f3 100644
--- a/packages/subproviders/package.json
+++ b/packages/subproviders/package.json
@@ -1,11 +1,14 @@
{
"name": "@0xproject/subproviders",
"version": "0.10.1",
+ "engines": {
+ "node" : ">=6.12"
+ },
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"license": "Apache-2.0",
"scripts": {
- "build:watch": "tsc -w",
+ "watch": "tsc -w",
"clean": "shx rm -rf lib scripts",
"build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"lint": "tslint --project .",
@@ -19,7 +22,7 @@
"test:unit": "run-s clean build run_mocha_unit",
"test:integration": "run-s clean build run_mocha_integration",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js",
- "docs:stage": "yarn build && node ./scripts/stage_docs.js",
+ "docs:stage": "node scripts/stage_docs.js",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES",
"upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json"
},
diff --git a/packages/subproviders/src/subproviders/base_wallet_subprovider.ts b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts
index f68d7eb29..a04be68e1 100644
--- a/packages/subproviders/src/subproviders/base_wallet_subprovider.ts
+++ b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts
@@ -8,13 +8,13 @@ import { Callback, ErrorCallback, PartialTxParams, ResponseWithTxParams, WalletS
import { Subprovider } from './subprovider';
export abstract class BaseWalletSubprovider extends Subprovider {
- protected static _validateTxParams(txParams: PartialTxParams) {
+ protected static _validateTxParams(txParams: PartialTxParams): void {
if (!_.isUndefined(txParams.to)) {
assert.isETHAddressHex('to', txParams.to);
}
assert.isHexString('nonce', txParams.nonce);
}
- private static _validateSender(sender: string) {
+ private static _validateSender(sender: string): void {
if (_.isUndefined(sender) || !addressUtils.isAddress(sender)) {
throw new Error(WalletSubproviderErrors.SenderInvalidOrNotSupplied);
}
@@ -33,7 +33,7 @@ export abstract class BaseWalletSubprovider 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: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
+ public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback): Promise<void> {
let accounts;
let txParams;
switch (payload.method) {
diff --git a/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts b/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts
index 8f152dc0a..bd7a4b6d9 100644
--- a/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts
+++ b/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts
@@ -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 async-suffix
- public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
+ public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback): Promise<void> {
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 54fd7bcb9..6c49f20cf 100644
--- a/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts
+++ b/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts
@@ -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 async-suffix
- public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
+ public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback): Promise<void> {
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 debd7ecf0..9ab764048 100644
--- a/packages/subproviders/src/subproviders/ganache.ts
+++ b/packages/subproviders/src/subproviders/ganache.ts
@@ -28,7 +28,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 async-suffix
- public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
+ public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback): Promise<void> {
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 3ca0c4bd0..73b870cd5 100644
--- a/packages/subproviders/src/subproviders/injected_web3.ts
+++ b/packages/subproviders/src/subproviders/injected_web3.ts
@@ -31,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 async-suffix
- public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) {
+ public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback): Promise<void> {
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 563e5a56a..347eda55f 100644
--- a/packages/subproviders/src/subproviders/ledger.ts
+++ b/packages/subproviders/src/subproviders/ledger.ts
@@ -74,7 +74,7 @@ export class LedgerSubprovider extends BaseWalletSubprovider {
* Set a desired derivation path when computing the available user addresses
* @param basDerivationPath The desired derivation path (e.g `44'/60'/0'`)
*/
- public setPath(basDerivationPath: string) {
+ public setPath(basDerivationPath: string): void {
this._baseDerivationPath = basDerivationPath;
}
/**
@@ -192,7 +192,7 @@ export class LedgerSubprovider extends BaseWalletSubprovider {
this._connectionLock.release();
return ledgerEthereumClient;
}
- private async _destroyLedgerClientAsync() {
+ private async _destroyLedgerClientAsync(): Promise<void> {
await this._connectionLock.acquire();
if (_.isUndefined(this._ledgerClientIfExists)) {
this._connectionLock.release();
diff --git a/packages/subproviders/src/subproviders/mnemonic_wallet.ts b/packages/subproviders/src/subproviders/mnemonic_wallet.ts
index 080bfeb4c..f29864a74 100644
--- a/packages/subproviders/src/subproviders/mnemonic_wallet.ts
+++ b/packages/subproviders/src/subproviders/mnemonic_wallet.ts
@@ -56,7 +56,7 @@ export class MnemonicWalletSubprovider extends BaseWalletSubprovider {
* Set a desired derivation path when computing the available user addresses
* @param baseDerivationPath The desired derivation path (e.g `44'/60'/0'`)
*/
- public setPath(baseDerivationPath: string) {
+ public setPath(baseDerivationPath: string): void {
this._baseDerivationPath = baseDerivationPath;
this._derivedKeyInfo = this._initialDerivedKeyInfo(this._baseDerivationPath);
}
diff --git a/packages/subproviders/src/subproviders/subprovider.ts b/packages/subproviders/src/subproviders/subprovider.ts
index 2118f52c8..56d2381a0 100644
--- a/packages/subproviders/src/subproviders/subprovider.ts
+++ b/packages/subproviders/src/subproviders/subprovider.ts
@@ -11,7 +11,7 @@ export abstract class Subprovider {
// tslint:disable-next-line:underscore-private-and-protected
private engine: any;
// Ported from: https://github.com/MetaMask/provider-engine/blob/master/util/random-id.js
- private static _getRandomId() {
+ private static _getRandomId(): number {
const extraDigits = 3;
// 13 time digits
const datePart = new Date().getTime() * Math.pow(10, extraDigits);
diff --git a/packages/subproviders/test/chai_setup.ts b/packages/subproviders/test/chai_setup.ts
index a281bab6c..6c24dc222 100644
--- a/packages/subproviders/test/chai_setup.ts
+++ b/packages/subproviders/test/chai_setup.ts
@@ -3,7 +3,7 @@ import chaiAsPromised = require('chai-as-promised');
import * as dirtyChai from 'dirty-chai';
export const chaiSetup = {
- configure() {
+ configure(): void {
chai.config.includeStack = true;
chai.use(dirtyChai);
chai.use(chaiAsPromised);
diff --git a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
index 14176c145..1a3db7672 100644
--- a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
+++ b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
@@ -39,7 +39,7 @@ describe('NonceTrackerSubprovider', () => {
'0x5e1d3a76fbf824220eafc8c79ad578ad2b67d01b0c2425eb1f1347e8f50882ab',
'0x5bd428537f05f9830e93792f90ea6a3e2d1ee84952dd96edbae9f658f831ab13',
];
- function createFixtureSubprovider() {
+ function createFixtureSubprovider(): FixtureSubprovider {
let isFirstGetTransactionCount = true;
const fixedBlockNumberAndTransactionCountProvider = new FixtureSubprovider({
eth_getBlockByNumber: '0x01',