aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-26 21:11:33 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-10 18:24:34 +0800
commitcf8678b97995d341aaf76345b0a4ab98163b6de2 (patch)
treea79df2e34b2d9e427b3ea294882e4ac13cf35da4
parent67722c0fb8b9509ed44c2b69bdefcfc5081df20a (diff)
downloaddexon-sol-tools-cf8678b97995d341aaf76345b0a4ab98163b6de2.tar
dexon-sol-tools-cf8678b97995d341aaf76345b0a4ab98163b6de2.tar.gz
dexon-sol-tools-cf8678b97995d341aaf76345b0a4ab98163b6de2.tar.bz2
dexon-sol-tools-cf8678b97995d341aaf76345b0a4ab98163b6de2.tar.lz
dexon-sol-tools-cf8678b97995d341aaf76345b0a4ab98163b6de2.tar.xz
dexon-sol-tools-cf8678b97995d341aaf76345b0a4ab98163b6de2.tar.zst
dexon-sol-tools-cf8678b97995d341aaf76345b0a4ab98163b6de2.zip
Introduce BlockWithoutTransactionData and BlockWithTransactionData
-rw-r--r--packages/web3-typescript-typings/index.d.ts19
1 files changed, 11 insertions, 8 deletions
diff --git a/packages/web3-typescript-typings/index.d.ts b/packages/web3-typescript-typings/index.d.ts
index c2d239e75..4bd6bf371 100644
--- a/packages/web3-typescript-typings/index.d.ts
+++ b/packages/web3-typescript-typings/index.d.ts
@@ -121,22 +121,22 @@ declare module 'web3' {
solidity(sourceString: string, cb?: (err: any, result: any) => void): object,
}
- getBlock(hashStringOrBlockNumber: string|Web3.BlockParam): Web3.Block;
+ getBlock(hashStringOrBlockNumber: string|Web3.BlockParam): Web3.BlockWithoutTransactionData;
getBlock(hashStringOrBlockNumber: string|Web3.BlockParam,
- callback: (err: Error, blockObj: Web3.Block) => void): void;
+ callback: (err: Error, blockObj: Web3.BlockWithoutTransactionData) => void): void;
getBlock(hashStringOrBlockNumber: string|Web3.BlockParam,
- returnTransactionObjects: true): Web3.BlockWithTransactions;
+ returnTransactionObjects: true): Web3.BlockWithTransactionData;
getBlock(hashStringOrBlockNumber: string|Web3.BlockParam, returnTransactionObjects: true,
- callback: (err: Error, blockObj: Web3.BlockWithTransactions) => void): void;
+ callback: (err: Error, blockObj: Web3.BlockWithTransactionData) => void): void;
getBlockTransactionCount(hashStringOrBlockNumber: string|Web3.BlockParam): number;
getBlockTransactionCount(hashStringOrBlockNumber: string|Web3.BlockParam,
callback: (err: Error, blockTransactionCount: number) => void): void;
// TODO returnTransactionObjects
- getUncle(hashStringOrBlockNumber: string|Web3.BlockParam, uncleNumber: number): Web3.Block;
+ getUncle(hashStringOrBlockNumber: string|Web3.BlockParam, uncleNumber: number): Web3.BlockWithoutTransactionData;
getUncle(hashStringOrBlockNumber: string|Web3.BlockParam, uncleNumber: number,
- callback: (err: Error, uncle: Web3.Block) => void): void;
+ callback: (err: Error, uncle: Web3.BlockWithoutTransactionData) => void): void;
getTransaction(transactionHash: string): Web3.Transaction;
getTransaction(transactionHash: string,
@@ -232,7 +232,7 @@ declare module 'web3' {
stopWatching(): void;
}
- interface Block {
+ interface AbstractBlock {
number: number|null;
hash: string|null;
parentHash: string;
@@ -251,9 +251,12 @@ declare module 'web3' {
timestamp: number;
uncles: Array<string>;
}
- interface BlockWithTransactions extends Block {
+ interface BlockWithoutTransactionData extends AbstractBlock {
transactions: Array<string>;
}
+ interface BlockWithTransactionData extends AbstractBlock {
+ transactions: Array<Transaction>;
+ }
interface Transaction {
hash: string;