2018-08-02 20:43:09 -04:00
|
|
|
import { BigNumber } from '../utils/bignumber';
|
|
|
|
import { Provider } from './abstract-provider';
|
|
|
|
import { Block, BlockTag, EventType, Filter, Listener, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from './abstract-provider';
|
|
|
|
import { BigNumberish } from '../utils/bignumber';
|
|
|
|
import { Transaction } from '../utils/transaction';
|
|
|
|
import { Network, Networkish } from '../utils/networks';
|
|
|
|
export declare class BaseProvider extends Provider {
|
|
|
|
private _network;
|
|
|
|
private _events;
|
2018-11-12 17:27:47 -05:00
|
|
|
protected _emitted: {
|
|
|
|
[eventName: string]: number | 'pending';
|
|
|
|
};
|
2018-08-02 20:43:09 -04:00
|
|
|
private _pollingInterval;
|
|
|
|
private _poller;
|
|
|
|
private _lastBlockNumber;
|
|
|
|
private _balances;
|
2018-10-04 20:25:07 -04:00
|
|
|
private _fastBlockNumber;
|
|
|
|
private _fastBlockNumberPromise;
|
|
|
|
private _fastQueryDate;
|
2018-08-02 20:43:09 -04:00
|
|
|
/**
|
|
|
|
* ready
|
|
|
|
*
|
|
|
|
* A Promise<Network> that resolves only once the provider is ready.
|
|
|
|
*
|
|
|
|
* Sub-classes that call the super with a network without a chainId
|
|
|
|
* MUST set this. Standard named networks have a known chainId.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
protected ready: Promise<Network>;
|
|
|
|
constructor(network: Networkish | Promise<Network>);
|
|
|
|
private _doPoll;
|
|
|
|
resetEventsBlock(blockNumber: number): void;
|
|
|
|
readonly network: Network;
|
|
|
|
getNetwork(): Promise<Network>;
|
|
|
|
readonly blockNumber: number;
|
|
|
|
polling: boolean;
|
|
|
|
pollingInterval: number;
|
2018-10-04 20:25:07 -04:00
|
|
|
_getFastBlockNumber(): Promise<number>;
|
|
|
|
_setFastBlockNumber(blockNumber: number): void;
|
|
|
|
waitForTransaction(transactionHash: string, confirmations?: number): Promise<TransactionReceipt>;
|
2018-08-02 20:43:09 -04:00
|
|
|
getBlockNumber(): Promise<number>;
|
|
|
|
getGasPrice(): Promise<BigNumber>;
|
|
|
|
getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>;
|
|
|
|
getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>;
|
|
|
|
getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
|
|
getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
|
|
sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>;
|
|
|
|
_wrapTransaction(tx: Transaction, hash?: string): TransactionResponse;
|
2018-10-11 16:50:52 -04:00
|
|
|
call(transaction: TransactionRequest, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
2018-08-02 20:43:09 -04:00
|
|
|
estimateGas(transaction: TransactionRequest): Promise<BigNumber>;
|
2018-09-06 16:41:02 -04:00
|
|
|
getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block>;
|
2018-08-02 20:43:09 -04:00
|
|
|
getTransaction(transactionHash: string): Promise<TransactionResponse>;
|
|
|
|
getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
|
|
|
|
getLogs(filter: Filter): Promise<Array<Log>>;
|
|
|
|
getEtherPrice(): Promise<number>;
|
|
|
|
private _resolveNames;
|
|
|
|
private _getResolver;
|
|
|
|
resolveName(name: string | Promise<string>): Promise<string>;
|
|
|
|
lookupAddress(address: string | Promise<string>): Promise<string>;
|
|
|
|
static checkTransactionResponse(transaction: any): TransactionResponse;
|
|
|
|
doPoll(): void;
|
|
|
|
perform(method: string, params: any): Promise<any>;
|
|
|
|
protected _startPending(): void;
|
|
|
|
protected _stopPending(): void;
|
|
|
|
private _addEventListener;
|
|
|
|
on(eventName: EventType, listener: Listener): Provider;
|
|
|
|
once(eventName: EventType, listener: Listener): Provider;
|
|
|
|
addEventListener(eventName: EventType, listener: Listener): Provider;
|
|
|
|
emit(eventName: EventType, ...args: Array<any>): boolean;
|
|
|
|
listenerCount(eventName?: EventType): number;
|
|
|
|
listeners(eventName: EventType): Array<Listener>;
|
|
|
|
removeAllListeners(eventName: EventType): Provider;
|
|
|
|
removeListener(eventName: EventType, listener: Listener): Provider;
|
|
|
|
}
|