aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web3-wrapper
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-11-19 20:49:16 +0800
committerFabio Berger <me@fabioberger.com>2018-11-19 20:49:16 +0800
commit8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c (patch)
tree587ce5e026674e5665ad164995aac69462290aed /packages/web3-wrapper
parent7d2c975d7335155b85a7549c25b953d0afacf5cf (diff)
parent94de441de744ed53470335122a38e265c3a71aff (diff)
downloaddexon-sol-tools-8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c.tar
dexon-sol-tools-8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c.tar.gz
dexon-sol-tools-8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c.tar.bz2
dexon-sol-tools-8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c.tar.lz
dexon-sol-tools-8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c.tar.xz
dexon-sol-tools-8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c.tar.zst
dexon-sol-tools-8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c.zip
Merge branch 'development'
* development: (957 commits) fix(order_utils.py): publish docs to S3, not RTD (#1264) fix: make instant package private feat: refer to map file in postpublish configs feat: add new bundle name to bundle watch fix: tslint ignore rule in wrong place Update blog post feature Fix disclaimer on mobile Add smart contract docs to Developer Home Add Apache license link Fix capitalization in title Remove excess semi-colon Point directly to README for docs link Update icons Update LICENSE Fix disclaimer Add blogpost URL Add disclaimer Add launch kit to Developer home list of tools feat: Deploy contracts to Rinkeby fix: fix exceeds block gas limit error ...
Diffstat (limited to 'packages/web3-wrapper')
-rw-r--r--packages/web3-wrapper/CHANGELOG.json41
-rw-r--r--packages/web3-wrapper/CHANGELOG.md25
-rw-r--r--packages/web3-wrapper/README.md10
-rw-r--r--packages/web3-wrapper/package.json23
-rw-r--r--packages/web3-wrapper/src/index.ts2
-rw-r--r--packages/web3-wrapper/src/marshaller.ts2
-rw-r--r--packages/web3-wrapper/src/utils.ts2
-rw-r--r--packages/web3-wrapper/src/web3_wrapper.ts24
-rw-r--r--packages/web3-wrapper/tslint.json2
9 files changed, 97 insertions, 34 deletions
diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json
index be5c1fef6..b938f6986 100644
--- a/packages/web3-wrapper/CHANGELOG.json
+++ b/packages/web3-wrapper/CHANGELOG.json
@@ -1,5 +1,43 @@
[
{
+ "timestamp": 1542208198,
+ "version": "3.1.4",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1542134075,
+ "version": "3.1.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1542028948,
+ "version": "3.1.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "version": "3.1.1",
+ "changes": [
+ {
+ "note":
+ "Fix bug in `getTransactionByHashAsync` which was causing the return value to have the wrong type (raw fields instead of unmarshalled fields).",
+ "pr": 1177
+ }
+ ],
+ "timestamp": 1541740904
+ },
+ {
"version": "3.1.0",
"changes": [
{
@@ -11,7 +49,8 @@
"Web3Wrapper now throws when an RPC request contains an error field in the response. Previously errors could be swallowed and undefined returned.",
"pr": 1102
}
- ]
+ ],
+ "timestamp": 1539871071
},
{
"version": "3.0.3",
diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md
index 8f1dc0f3f..70a00ee1e 100644
--- a/packages/web3-wrapper/CHANGELOG.md
+++ b/packages/web3-wrapper/CHANGELOG.md
@@ -5,6 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v3.1.4 - _November 14, 2018_
+
+ * Dependencies updated
+
+## v3.1.3 - _November 13, 2018_
+
+ * Dependencies updated
+
+## v3.1.2 - _November 12, 2018_
+
+ * Dependencies updated
+
+## v3.1.1 - _November 9, 2018_
+
+ * Fix bug in `getTransactionByHashAsync` which was causing the return value to have the wrong type (raw fields instead of unmarshalled fields). (#1177)
+
+## v3.1.0 - _October 18, 2018_
+
+ * Add `signTypedData` to perform EIP712 `eth_signTypedData`. (#1102)
+ * Web3Wrapper now throws when an RPC request contains an error field in the response. Previously errors could be swallowed and undefined returned. (#1102)
+
## v3.0.3 - _October 4, 2018_
* Dependencies updated
@@ -40,7 +61,7 @@ CHANGELOG
* Stop exporting types: `CallTxDataBaseRPC` and `AbstractBlockRPC` (#924)
* Export `AbiDecoder` class (#924)
-## v1.2.0 - _August 13, 2018_
+## v1.2.0 - _August 14, 2018_
* Export marshaller to convert between RPC and user-space data formats (#938)
* Export RPC types (#938)
@@ -80,7 +101,7 @@ CHANGELOG
* Dependencies updated
-## v0.7.0 - _June 3, 2018_
+## v0.7.0 - _June 4, 2018_
* Add `web3Wrapper.getContractCodeAsync` (#675)
* Add `web3Wrapper.getTransactionTraceAsync` (#675)
diff --git a/packages/web3-wrapper/README.md b/packages/web3-wrapper/README.md
index 06c788101..4402de19c 100644
--- a/packages/web3-wrapper/README.md
+++ b/packages/web3-wrapper/README.md
@@ -1,4 +1,4 @@
-## @0xproject/web3-wrapper
+## @0x/web3-wrapper
Web3-wrapper is a JSON-RPC client for Ethereum nodes. It is a type-safe alternative to [Web3.js](https://github.com/ethereum/web3.js/) written in TypeScript.
@@ -7,14 +7,14 @@ Web3-wrapper is a JSON-RPC client for Ethereum nodes. It is a type-safe alternat
## Installation
```bash
-yarn add @0xproject/web3-wrapper
+yarn add @0x/web3-wrapper
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
- "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
+ "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"],
}
```
@@ -43,13 +43,13 @@ yarn install
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-PKG=@0xproject/web3-wrapper yarn build
+PKG=@0x/web3-wrapper yarn build
```
Or continuously rebuild on change:
```bash
-PKG=@0xproject/web3-wrapper yarn watch
+PKG=@0x/web3-wrapper yarn watch
```
### Clean
diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json
index ef31a68dc..2469f7627 100644
--- a/packages/web3-wrapper/package.json
+++ b/packages/web3-wrapper/package.json
@@ -1,6 +1,6 @@
{
- "name": "@0xproject/web3-wrapper",
- "version": "3.0.3",
+ "name": "@0x/web3-wrapper",
+ "version": "3.1.4",
"engines": {
"node": ">=6.12"
},
@@ -11,7 +11,7 @@
"build": "tsc -b",
"build:ci": "yarn build",
"clean": "shx rm -rf lib generated_docs",
- "lint": "tslint --project .",
+ "lint": "tslint --format stylish --project .",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s clean build test",
"test:circleci": "yarn test:coverage",
@@ -35,13 +35,12 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md",
"devDependencies": {
- "@0xproject/tslint-config": "^1.0.8",
+ "@0x/tslint-config": "^1.0.10",
"@types/ganache-core": "^2.1.0",
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
- "copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"ganache-core": "0xProject/ganache-core#monorepo-dep",
"make-promises-safe": "^1.1.0",
@@ -50,17 +49,17 @@
"nyc": "^11.0.1",
"shx": "^0.2.2",
"tslint": "5.11.0",
- "typedoc": "0.12.0",
+ "typedoc": "0.13.0",
"typescript": "3.0.1"
},
"dependencies": {
- "@0xproject/assert": "^1.0.13",
- "@0xproject/json-schemas": "^1.0.7",
- "@0xproject/typescript-typings": "^3.0.2",
- "@0xproject/utils": "^2.0.2",
- "ethereum-types": "^1.0.11",
+ "@0x/assert": "^1.0.17",
+ "@0x/json-schemas": "^2.1.1",
+ "@0x/typescript-typings": "^3.0.4",
+ "@0x/utils": "^2.0.5",
+ "ethereum-types": "^1.1.2",
"ethereumjs-util": "^5.1.1",
- "ethers": "4.0.0-beta.14",
+ "ethers": "~4.0.4",
"lodash": "^4.17.5"
},
"publishConfig": {
diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts
index 9bef06fd4..679563a2b 100644
--- a/packages/web3-wrapper/src/index.ts
+++ b/packages/web3-wrapper/src/index.ts
@@ -1,7 +1,7 @@
export { Web3Wrapper } from './web3_wrapper';
export { marshaller } from './marshaller';
-export { AbiDecoder } from '@0xproject/utils';
+export { AbiDecoder } from '@0x/utils';
export {
BlockParam,
diff --git a/packages/web3-wrapper/src/marshaller.ts b/packages/web3-wrapper/src/marshaller.ts
index 572a322d6..299c6a64c 100644
--- a/packages/web3-wrapper/src/marshaller.ts
+++ b/packages/web3-wrapper/src/marshaller.ts
@@ -1,4 +1,4 @@
-import { addressUtils } from '@0xproject/utils';
+import { addressUtils } from '@0x/utils';
import {
BlockParam,
BlockParamLiteral,
diff --git a/packages/web3-wrapper/src/utils.ts b/packages/web3-wrapper/src/utils.ts
index 0b568aac5..c68587632 100644
--- a/packages/web3-wrapper/src/utils.ts
+++ b/packages/web3-wrapper/src/utils.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
export const utils = {
diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts
index 726246f1a..be1713f20 100644
--- a/packages/web3-wrapper/src/web3_wrapper.ts
+++ b/packages/web3-wrapper/src/web3_wrapper.ts
@@ -1,6 +1,6 @@
-import { assert } from '@0xproject/assert';
-import { schemas } from '@0xproject/json-schemas';
-import { AbiDecoder, addressUtils, BigNumber, intervalUtils, promisify } from '@0xproject/utils';
+import { assert } from '@0x/assert';
+import { schemas } from '@0x/json-schemas';
+import { AbiDecoder, addressUtils, BigNumber, intervalUtils, promisify } from '@0x/utils';
import {
BlockParam,
BlockParamLiteral,
@@ -23,7 +23,13 @@ import {
import * as _ from 'lodash';
import { marshaller } from './marshaller';
-import { BlockWithoutTransactionDataRPC, BlockWithTransactionDataRPC, NodeType, Web3WrapperErrors } from './types';
+import {
+ BlockWithoutTransactionDataRPC,
+ BlockWithTransactionDataRPC,
+ NodeType,
+ TransactionRPC,
+ Web3WrapperErrors,
+} from './types';
import { utils } from './utils';
const BASE_TEN = 10;
@@ -145,13 +151,13 @@ export class Web3Wrapper {
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`
- // We re-assign the send method so that Web3@1.0 providers work with @0xproject/web3-wrapper
+ // We re-assign the send method so that Web3@1.0 providers work with @0x/web3-wrapper
(provider as any).sendAsync = (provider as any).send;
}
this.abiDecoder = new AbiDecoder([]);
this._provider = provider;
this._txDefaults = txDefaults || {};
- this._jsonRpcRequestId = 0;
+ this._jsonRpcRequestId = 1;
}
/**
* Get the contract defaults set to the Web3Wrapper instance
@@ -228,10 +234,11 @@ export class Web3Wrapper {
*/
public async getTransactionByHashAsync(txHash: string): Promise<Transaction> {
assert.isHexString('txHash', txHash);
- const transaction = await this.sendRawPayloadAsync<Transaction>({
+ const transactionRpc = await this.sendRawPayloadAsync<TransactionRPC>({
method: 'eth_getTransactionByHash',
params: [txHash],
});
+ const transaction = marshaller.unmarshalTransaction(transactionRpc);
return transaction;
}
/**
@@ -526,9 +533,6 @@ export class Web3Wrapper {
method: 'eth_call',
params: [callDataHex, marshalledDefaultBlock],
});
- if (rawCallResult === '0x') {
- throw new Error('Contract call failed (returned null)');
- }
return rawCallResult;
}
/**
diff --git a/packages/web3-wrapper/tslint.json b/packages/web3-wrapper/tslint.json
index ffaefe83a..dd9053357 100644
--- a/packages/web3-wrapper/tslint.json
+++ b/packages/web3-wrapper/tslint.json
@@ -1,3 +1,3 @@
{
- "extends": ["@0xproject/tslint-config"]
+ "extends": ["@0x/tslint-config"]
}