diff options
Diffstat (limited to 'packages/web3-wrapper')
-rw-r--r-- | packages/web3-wrapper/README.md | 6 | ||||
-rw-r--r-- | packages/web3-wrapper/package.json | 13 | ||||
-rw-r--r-- | packages/web3-wrapper/src/index.ts | 4 |
3 files changed, 17 insertions, 6 deletions
diff --git a/packages/web3-wrapper/README.md b/packages/web3-wrapper/README.md index 5b22aefd4..7ed66ca41 100644 --- a/packages/web3-wrapper/README.md +++ b/packages/web3-wrapper/README.md @@ -44,6 +44,12 @@ yarn install yarn build ``` +or + +```bash +yarn build:watch +``` + ### Lint ```bash diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index ec9ff3bb4..baae437a7 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -1,10 +1,11 @@ { "name": "@0xproject/web3-wrapper", - "version": "0.1.8", + "version": "0.1.9", "description": "Wraps around web3 and gives a nicer interface", "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { + "build:watch": "tsc -w", "build": "tsc", "clean": "shx rm -rf lib", "lint": "tslint --project . 'src/**/*.ts'" @@ -19,17 +20,17 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/web3-wrapper/README.md", "devDependencies": { - "@0xproject/tslint-config": "^0.4.5", - "@0xproject/types": "^0.1.7", + "@0xproject/tslint-config": "^0.4.6", + "@0xproject/types": "^0.1.8", "@types/lodash": "^4.14.86", "npm-run-all": "^4.1.2", "shx": "^0.2.2", "tslint": "5.8.0", - "typescript": "~2.6.1", - "web3-typescript-typings": "^0.9.7" + "typescript": "2.7.1", + "web3-typescript-typings": "^0.9.8" }, "dependencies": { - "@0xproject/utils": "^0.2.3", + "@0xproject/utils": "^0.2.4", "lodash": "^4.17.4", "web3": "^0.20.0" } diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts index c4826f2be..a2878fc2a 100644 --- a/packages/web3-wrapper/src/index.ts +++ b/packages/web3-wrapper/src/index.ts @@ -134,6 +134,10 @@ export class Web3Wrapper { const gas = await promisify<number>(this._web3.eth.estimateGas)({ data }); return gas; } + public async sendTransactionAsync(txData: Web3.TxData): Promise<string> { + const txHash = await promisify<string>(this._web3.eth.sendTransaction)(txData); + return txHash; + } private async _sendRawPayloadAsync<A>(payload: Web3.JSONRPCRequestPayload): Promise<A> { const sendAsync = this._web3.currentProvider.sendAsync.bind(this._web3.currentProvider); const response = await promisify<Web3.JSONRPCResponsePayload>(sendAsync)(payload); |