diff options
Diffstat (limited to 'packages/web3-wrapper')
-rw-r--r-- | packages/web3-wrapper/CHANGELOG.json | 13 | ||||
-rw-r--r-- | packages/web3-wrapper/CHANGELOG.md | 9 | ||||
-rw-r--r-- | packages/web3-wrapper/README.md | 10 | ||||
-rw-r--r-- | packages/web3-wrapper/package.json | 16 | ||||
-rw-r--r-- | packages/web3-wrapper/src/index.ts | 2 | ||||
-rw-r--r-- | packages/web3-wrapper/src/marshaller.ts | 2 | ||||
-rw-r--r-- | packages/web3-wrapper/src/utils.ts | 2 | ||||
-rw-r--r-- | packages/web3-wrapper/src/web3_wrapper.ts | 19 | ||||
-rw-r--r-- | packages/web3-wrapper/tslint.json | 2 |
9 files changed, 49 insertions, 26 deletions
diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index be5c1fef6..6b554110f 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,5 +1,15 @@ [ { + "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 + } + ] + }, + { "version": "3.1.0", "changes": [ { @@ -11,7 +21,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..90d62953a 100644 --- a/packages/web3-wrapper/CHANGELOG.md +++ b/packages/web3-wrapper/CHANGELOG.md @@ -5,6 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## 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 +45,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 +85,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 4d033e130..579957747 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.0", "engines": { "node": ">=6.12" }, @@ -35,7 +35,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md", "devDependencies": { - "@0xproject/tslint-config": "^1.0.8", + "@0x/tslint-config": "^1.0.9", "@types/ganache-core": "^2.1.0", "@types/lodash": "4.14.104", "chai": "^4.0.1", @@ -53,11 +53,11 @@ "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.14", + "@0x/json-schemas": "^2.0.0", + "@0x/typescript-typings": "^3.0.3", + "@0x/utils": "^2.0.3", + "ethereum-types": "^1.1.1", "ethereumjs-util": "^5.1.1", "ethers": "~4.0.4", "lodash": "^4.17.5" 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..56877fef3 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,7 +151,7 @@ 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([]); @@ -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; } /** 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"] } |