web3x
Version:
Typescript port of web3.js
54 lines (53 loc) • 1.74 kB
TypeScript
/// <reference types="node" />
import { Address } from '../address';
import { RawTransactionResponse, TransactionResponse } from './transaction-response-formatter';
export interface RawBlockHeaderResponse {
hash: string | null;
parentHash: string;
sha3Uncles: string;
miner: string;
stateRoot: string;
transactionsRoot: string;
receiptsRoot: string;
logsBloom: string | null;
difficulty: string;
number: string | null;
gasLimit: string;
gasUsed: string;
timestamp: string;
extraData: string;
nonce: string | null;
}
export interface RawBlockResponse extends RawBlockHeaderResponse {
totalDifficulty: string;
size: string;
transactions: (RawTransactionResponse | string)[];
uncles: string[];
}
export interface BlockHeaderResponse {
hash: Buffer | null;
parentHash: Buffer;
sha3Uncles: Buffer;
miner: Address;
stateRoot: Buffer;
transactionsRoot: Buffer;
receiptsRoot: Buffer;
logsBloom: Buffer | null;
difficulty: string;
number: number | null;
gasLimit: number;
gasUsed: number;
timestamp: number;
extraData: Buffer;
nonce: Buffer | null;
}
export interface BlockResponse<T = TransactionResponse | Buffer> extends BlockHeaderResponse {
totalDifficulty: string;
size: number;
transactions: T[];
uncles: string[];
}
export declare function toRawBlockHeaderResponse(block: BlockHeaderResponse): RawBlockHeaderResponse;
export declare function toRawBlockResponse(block: BlockResponse): RawBlockResponse;
export declare function fromRawBlockHeaderResponse(block: RawBlockHeaderResponse): BlockHeaderResponse;
export declare function fromRawBlockResponse(block: RawBlockResponse): BlockResponse;