diff options
Diffstat (limited to 'packages/web3-wrapper')
-rw-r--r-- | packages/web3-wrapper/CHANGELOG.json | 18 | ||||
-rw-r--r-- | packages/web3-wrapper/CHANGELOG.md | 16 | ||||
-rw-r--r-- | packages/web3-wrapper/README.md | 18 | ||||
-rw-r--r-- | packages/web3-wrapper/package.json | 21 | ||||
-rw-r--r-- | packages/web3-wrapper/src/web3_wrapper.ts | 21 | ||||
-rw-r--r-- | packages/web3-wrapper/test/utils/chai_setup.ts | 2 |
6 files changed, 60 insertions, 36 deletions
diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index c87ef3bac..35e4383fd 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,5 +1,23 @@ [ { + "timestamp": 1525477860, + "version": "0.6.3", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1525428773, + "version": "0.6.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "timestamp": 1524044013, "version": "0.6.1", "changes": [ diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md index f5bda9ad9..3358c9a01 100644 --- a/packages/web3-wrapper/CHANGELOG.md +++ b/packages/web3-wrapper/CHANGELOG.md @@ -5,11 +5,19 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v0.6.3 - _May 5, 2018_ + + * Dependencies updated + +## v0.6.2 - _May 4, 2018_ + + * Dependencies updated + ## v0.6.1 - _April 18, 2018_ * Dependencies updated -## v0.6.0 - _April 12, 2018_ +## v0.6.0 - _April 11, 2018_ * Make `isAddress` and `toWei` static (#501) * Add static methods `toUnitAmount` and `toBaseUnitAmount` (#501) @@ -24,19 +32,19 @@ CHANGELOG * Rename `signTransactionAsync` to `signMessageAsync` for clarity (#465) -## v0.3.0 - _March 18, 2018_ +## v0.3.0 - _March 17, 2018_ * Add `web3Wrapper.takeSnapshotAsync`, `web3Wrapper.revertSnapshotAsync`, `web3Wrapper.mineBlockAsync`, `web3Wrapper.increaseTimeAsync` (#426) * Add `web3Wrapper.isZeroExWeb3Wrapper` for runtime instanceOf checks (#426) * Add a `getProvider` method (#444) -## v0.2.0 - _March 4, 2018_ +## v0.2.0 - _March 3, 2018_ * Ensure all returned user addresses are lowercase (#373) * Add `web3Wrapper.callAsync` (#413) * Make `web3Wrapper.estimateGas` accept whole `txData` instead of `data` (#413) * Remove `web3Wrapper.getContractInstance` (#413) -## v0.1.12 - _February 9, 2018_ +## v0.1.12 - _February 8, 2018_ * Fix publishing issue where .npmignore was not properly excluding undesired content (#389) diff --git a/packages/web3-wrapper/README.md b/packages/web3-wrapper/README.md index d752a9de0..bfa98deff 100644 --- a/packages/web3-wrapper/README.md +++ b/packages/web3-wrapper/README.md @@ -40,28 +40,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/web3-wrapper 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/web3-wrapper yarn watch ``` ### Clean diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index 118330707..c0fa45433 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -1,21 +1,24 @@ { "name": "@0xproject/web3-wrapper", - "version": "0.6.1", + "version": "0.6.3", + "engines": { + "node" : ">=6.12" + }, "description": "Wraps around web3 and gives a nicer interface", "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "clean": "shx rm -rf lib scripts", - "lint": "tslint --project . 'src/**/*.ts'", + "lint": "tslint --project .", "test": "run-s clean build run_mocha", "test:circleci": "yarn test:coverage", "run_mocha": "mocha lib/test/**/*_test.js --bail --exit", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "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" }, @@ -40,8 +43,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.18", - "@0xproject/tslint-config": "^0.4.16", + "@0xproject/monorepo-scripts": "^0.1.19", + "@0xproject/tslint-config": "^0.4.17", "@types/lodash": "4.14.104", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -58,9 +61,9 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/types": "^0.6.1", - "@0xproject/typescript-typings": "^0.2.0", - "@0xproject/utils": "^0.5.2", + "@0xproject/types": "^0.6.3", + "@0xproject/typescript-typings": "^0.3.1", + "@0xproject/utils": "^0.6.1", "ethers": "^3.0.15", "lodash": "^4.17.4", "web3": "^0.20.0" diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index 5e6ff3239..c60d5fe33 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -29,7 +29,7 @@ export class Web3Wrapper { public isZeroExWeb3Wrapper = true; public abiDecoder: AbiDecoder; private _web3: Web3; - private _defaults: Partial<TxData>; + private _txDefaults: Partial<TxData>; private _jsonRpcRequestId: number; /** * Check if an address is a valid Ethereum address @@ -83,10 +83,10 @@ export class Web3Wrapper { * Instantiates a new Web3Wrapper. * @param provider The Web3 provider instance you would like the Web3Wrapper to use for interacting with * the backing Ethereum node. - * @param defaults Override TxData defaults sent with RPC requests to the backing Ethereum node. + * @param txDefaults Override TxData defaults sent with RPC requests to the backing Ethereum node. * @return An instance of the Web3Wrapper class. */ - constructor(provider: Provider, defaults?: Partial<TxData>) { + constructor(provider: Provider, txDefaults?: Partial<TxData>) { if (_.isUndefined((provider as any).sendAsync)) { // Web3@1.0 provider doesn't support synchronous http requests, // so it only has an async `send` method, instead of a `send` and `sendAsync` in web3@0.x.x` @@ -96,7 +96,7 @@ export class Web3Wrapper { this.abiDecoder = new AbiDecoder([]); this._web3 = new Web3(); this._web3.setProvider(provider); - this._defaults = defaults || {}; + this._txDefaults = txDefaults || {}; this._jsonRpcRequestId = 0; } /** @@ -104,7 +104,7 @@ export class Web3Wrapper { * @return TxData defaults (e.g gas, gasPrice, nonce, etc...) */ public getContractDefaults(): Partial<TxData> { - return this._defaults; + return this._txDefaults; } /** * Retrieve the Web3 provider @@ -117,7 +117,7 @@ export class Web3Wrapper { * Update the used Web3 provider * @param provider The new Web3 provider to be set */ - public setProvider(provider: Provider) { + public setProvider(provider: Provider): void { this._web3.setProvider(provider); } /** @@ -324,9 +324,16 @@ export class Web3Wrapper { const txHash = await promisify<string>(this._web3.eth.sendTransaction)(txData); return txHash; } + /** + * Waits for a transaction to be mined and returns the transaction receipt. + * @param txHash Transaction hash + * @param pollingIntervalMs How often (in ms) should we check if the transaction is mined. + * @param timeoutMs How long (in ms) to poll for transaction mined until aborting. + * @return Transaction receipt with decoded log args. + */ public async awaitTransactionMinedAsync( txHash: string, - pollingIntervalMs = 1000, + pollingIntervalMs: number = 1000, timeoutMs?: number, ): Promise<TransactionReceiptWithDecodedLogs> { let timeoutExceeded = false; diff --git a/packages/web3-wrapper/test/utils/chai_setup.ts b/packages/web3-wrapper/test/utils/chai_setup.ts index 078edd309..1a8733093 100644 --- a/packages/web3-wrapper/test/utils/chai_setup.ts +++ b/packages/web3-wrapper/test/utils/chai_setup.ts @@ -4,7 +4,7 @@ import ChaiBigNumber = require('chai-bignumber'); import * as dirtyChai from 'dirty-chai'; export const chaiSetup = { - configure() { + configure(): void { chai.config.includeStack = true; chai.use(ChaiBigNumber()); chai.use(dirtyChai); |