aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web3-wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'packages/web3-wrapper')
-rw-r--r--packages/web3-wrapper/CHANGELOG.json34
-rw-r--r--packages/web3-wrapper/CHANGELOG.md25
-rw-r--r--packages/web3-wrapper/package.json16
-rw-r--r--packages/web3-wrapper/src/index.ts4
-rw-r--r--packages/web3-wrapper/src/types.ts6
-rw-r--r--packages/web3-wrapper/src/web3_wrapper.ts25
6 files changed, 88 insertions, 22 deletions
diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json
index 0b83ad13d..975f83037 100644
--- a/packages/web3-wrapper/CHANGELOG.json
+++ b/packages/web3-wrapper/CHANGELOG.json
@@ -1,6 +1,25 @@
[
{
- "version": "0.7.3",
+ "version": "1.1.0",
+ "changes": [
+ {
+ "note": "Add `getTransactionByHashAsync` method",
+ "pr": 847
+ }
+ ]
+ },
+ {
+ "timestamp": 1532357734,
+ "version": "1.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1532043000,
+ "version": "1.0.0",
"changes": [
{
"note": "Export `marshaller` utility file.",
@@ -9,6 +28,19 @@
{
"note": "Add `getNodeTypeAsync` method",
"pr": 812
+ },
+ {
+ "note": "Stop exporting uniqueVersionIds object",
+ "pr": 897
+ }
+ ]
+ },
+ {
+ "timestamp": 1531919263,
+ "version": "0.7.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
}
]
},
diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md
index f6795100e..b17baaeeb 100644
--- a/packages/web3-wrapper/CHANGELOG.md
+++ b/packages/web3-wrapper/CHANGELOG.md
@@ -1,10 +1,24 @@
<!--
-This file is auto-generated using the monorepo-scripts package. Don't edit directly.
+changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
+## v1.0.1 - _July 23, 2018_
+
+ * Dependencies updated
+
+## v1.0.0 - _July 20, 2018_
+
+ * Export `marshaller` utility file. (#829)
+ * Add `getNodeTypeAsync` method (#812)
+ * Stop exporting uniqueVersionIds object (#897)
+
+## v0.7.3 - _July 18, 2018_
+
+ * Dependencies updated
+
## v0.7.2 - _July 9, 2018_
* Dependencies updated
@@ -15,7 +29,14 @@ CHANGELOG
## v0.7.0 - _June 4, 2018_
- * Add default parameters when sending a raw payload
+ * Add `web3Wrapper.getContractCodeAsync` (#675)
+ * Add `web3Wrapper.getTransactionTraceAsync` (#675)
+ * Add `web3Wrapper.getBlockWithTransactionDataAsync` (#675)
+ * Add exported uniqueVersionIds object (#622)
+ * Update increaseTimeAsync to work with Geth (#622)
+ * Make callAsync throw if raw call result is 0x (null) (#622)
+ * Add new setHeadAsync method (#622)
+ * Improve performance of awaitTransactionMinedAsync by immediately checking if the transaction was already mined instead of waiting for the first interval. (#688)
## v0.6.4 - _May 22, 2018_
diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json
index 1f4854baa..d9c577ea9 100644
--- a/packages/web3-wrapper/package.json
+++ b/packages/web3-wrapper/package.json
@@ -1,6 +1,6 @@
{
"name": "@0xproject/web3-wrapper",
- "version": "0.7.2",
+ "version": "1.0.0",
"engines": {
"node": ">=6.12"
},
@@ -45,8 +45,8 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md",
"devDependencies": {
- "@0xproject/monorepo-scripts": "^0.2.2",
- "@0xproject/tslint-config": "^0.4.21",
+ "@0xproject/monorepo-scripts": "^1.0.0",
+ "@0xproject/tslint-config": "^1.0.0",
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
@@ -64,11 +64,11 @@
"typescript": "2.7.1"
},
"dependencies": {
- "@0xproject/assert": "0.3.0",
- "@0xproject/json-schemas": "^1.0.0",
- "@0xproject/typescript-typings": "^0.4.2",
- "@0xproject/utils": "^0.7.2",
- "ethereum-types": "^0.0.2",
+ "@0xproject/assert": "^1.0.0",
+ "@0xproject/json-schemas": "^1.0.0-rc.1",
+ "@0xproject/typescript-typings": "^1.0.0",
+ "@0xproject/utils": "^1.0.0",
+ "ethereum-types": "^1.0.0",
"ethereumjs-util": "^5.1.1",
"ethers": "3.0.22",
"lodash": "^4.17.4"
diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts
index 19fe0836c..4433b4b54 100644
--- a/packages/web3-wrapper/src/index.ts
+++ b/packages/web3-wrapper/src/index.ts
@@ -1,3 +1,3 @@
-export { Web3Wrapper, uniqueVersionIds, NodeType } from './web3_wrapper';
-export { Web3WrapperErrors } from './types';
+export { Web3Wrapper } from './web3_wrapper';
+export { Web3WrapperErrors, NodeType } from './types';
export { marshaller } from './marshaller';
diff --git a/packages/web3-wrapper/src/types.ts b/packages/web3-wrapper/src/types.ts
index b7b6bd68a..e81039186 100644
--- a/packages/web3-wrapper/src/types.ts
+++ b/packages/web3-wrapper/src/types.ts
@@ -57,3 +57,9 @@ export interface TxDataRPC extends CallTxDataBaseRPC {
export interface CallDataRPC extends CallTxDataBaseRPC {
from?: string;
}
+
+// NodeType represents the type of the backing Ethereum node.
+export enum NodeType {
+ Geth = 'GETH',
+ Ganache = 'GANACHE',
+}
diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts
index e828708f0..dd35e2094 100644
--- a/packages/web3-wrapper/src/web3_wrapper.ts
+++ b/packages/web3-wrapper/src/web3_wrapper.ts
@@ -14,6 +14,7 @@ import {
Provider,
RawLogEntry,
TraceParams,
+ Transaction,
TransactionReceipt,
TransactionReceiptWithDecodedLogs,
TransactionTrace,
@@ -22,24 +23,18 @@ import {
import * as _ from 'lodash';
import { marshaller } from './marshaller';
-import { BlockWithoutTransactionDataRPC, BlockWithTransactionDataRPC, Web3WrapperErrors } from './types';
+import { BlockWithoutTransactionDataRPC, BlockWithTransactionDataRPC, NodeType, Web3WrapperErrors } from './types';
import { utils } from './utils';
const BASE_TEN = 10;
// These are unique identifiers contained in the response of the
// web3_clientVersion call.
-export const uniqueVersionIds = {
+const uniqueVersionIds = {
geth: 'Geth',
ganache: 'EthereumJS TestRPC',
};
-// NodeType represents the type of the backing Ethereum node.
-export enum NodeType {
- Geth = 'GETH',
- Ganache = 'GANACHE',
-}
-
/**
* An alternative to the Web3.js library that provides a consistent, clean, promise-based interface.
*/
@@ -227,6 +222,19 @@ export class Web3Wrapper {
return transactionReceipt;
}
/**
+ * Retrieves the transaction data for a given transaction
+ * @param txHash Transaction hash
+ * @returns The raw transaction data
+ */
+ public async getTransactionByHashAsync(txHash: string): Promise<Transaction> {
+ assert.isHexString('txHash', txHash);
+ const transaction = await this._sendRawPayloadAsync<Transaction>({
+ method: 'eth_getTransactionByHash',
+ params: [txHash],
+ });
+ return transaction;
+ }
+ /**
* Retrieves an accounts Ether balance in wei
* @param owner Account whose balance you wish to check
* @returns Balance in wei
@@ -298,7 +306,6 @@ export class Web3Wrapper {
*/
public async signMessageAsync(address: string, message: string): Promise<string> {
assert.isETHAddressHex('address', address);
- assert.isETHAddressHex('address', address);
assert.isString('message', message); // TODO: Should this be stricter? Hex string?
const signData = await this._sendRawPayloadAsync<string>({
method: 'eth_sign',