aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web3-wrapper/src/web3_wrapper.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-26 01:33:13 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-26 01:33:13 +0800
commitda4b70fcae1da2c35905a30b79707b3f27b9fa3a (patch)
tree65dbdb8f75c8e93cd788149610522f5bf5ada643 /packages/web3-wrapper/src/web3_wrapper.ts
parentad4c2b95e4722e6d227c26f436bedf7b06f5356a (diff)
parent05b35c0fdcbca7980d4195e96ec791c1c2d13398 (diff)
downloaddexon-0x-contracts-da4b70fcae1da2c35905a30b79707b3f27b9fa3a.tar.gz
dexon-0x-contracts-da4b70fcae1da2c35905a30b79707b3f27b9fa3a.tar.zst
dexon-0x-contracts-da4b70fcae1da2c35905a30b79707b3f27b9fa3a.zip
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/web3-wrapper/unexport-marshaller
Diffstat (limited to 'packages/web3-wrapper/src/web3_wrapper.ts')
-rw-r--r--packages/web3-wrapper/src/web3_wrapper.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts
index 4439eb284..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,
@@ -221,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
@@ -292,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',