import { BigNumber } from '../utils/bignumber'; import { Arrayish } from '../utils/bytes'; import { BigNumberish } from '../utils/bignumber'; import { Network } from '../utils/networks'; import { OnceBlockable } from '../utils/web'; import { Transaction } from '../utils/transaction'; export interface Block { hash: string; parentHash: string; number: number; timestamp: number; nonce: string; difficulty: number; gasLimit: BigNumber; gasUsed: BigNumber; miner: string; extraData: string; transactions: Array; } export declare type BlockTag = string | number; export declare type Filter = { fromBlock?: BlockTag; toBlock?: BlockTag; address?: string; topics?: Array>; }; export interface Log { blockNumber?: number; blockHash?: string; transactionIndex?: number; removed?: boolean; transactionLogIndex?: number; address: string; data: string; topics: Array; transactionHash?: string; logIndex?: number; } export interface TransactionReceipt { contractAddress?: string; transactionIndex?: number; root?: string; gasUsed?: BigNumber; logsBloom?: string; blockHash?: string; transactionHash?: string; logs?: Array; blockNumber?: number; confirmations?: number; cumulativeGasUsed?: BigNumber; byzantium: boolean; status?: number; } export declare type TransactionRequest = { to?: string | Promise; from?: string | Promise; nonce?: number | string | Promise; gasLimit?: BigNumberish | Promise; gasPrice?: BigNumberish | Promise; data?: Arrayish | Promise; value?: BigNumberish | Promise; chainId?: number | Promise; }; export interface TransactionResponse extends Transaction { blockNumber?: number; blockHash?: string; timestamp?: number; confirmations: number; from: string; raw?: string; wait: (confirmations?: number) => Promise; } export declare type EventType = string | Array | Filter; export declare type Listener = (...args: Array) => void; export declare abstract class Provider implements OnceBlockable { abstract getNetwork(): Promise; abstract getBlockNumber(): Promise; abstract getGasPrice(): Promise; abstract getBalance(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract getTransactionCount(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract getCode(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract getStorageAt(addressOrName: string | Promise, position: BigNumberish | Promise, blockTag?: BlockTag | Promise): Promise; abstract sendTransaction(signedTransaction: string | Promise): Promise; abstract call(transaction: TransactionRequest, blockTag?: BlockTag | Promise): Promise; abstract estimateGas(transaction: TransactionRequest): Promise; abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise, includeTransactions?: boolean): Promise; abstract getTransaction(transactionHash: string): Promise; abstract getTransactionReceipt(transactionHash: string): Promise; abstract getLogs(filter: Filter): Promise>; abstract resolveName(name: string | Promise): Promise; abstract lookupAddress(address: string | Promise): Promise; abstract on(eventName: EventType, listener: Listener): Provider; abstract once(eventName: EventType, listener: Listener): Provider; abstract listenerCount(eventName?: EventType): number; abstract listeners(eventName: EventType): Array; abstract removeAllListeners(eventName: EventType): Provider; abstract removeListener(eventName: EventType, listener: Listener): Provider; abstract waitForTransaction(transactionHash: string, timeout?: number): Promise; constructor(); static isProvider(value: any): value is Provider; }