Skip to main content

Class: Provider

Implements

  • OnceBlockable

Constructors

constructor

new Provider()

Properties

_isProvider

Readonly _isProvider: boolean

Methods

addListener

addListener(eventName, listener): Provider

Parameters

NameType
eventNameEventType
listenerListener

Returns

Provider


call

Abstract call(transaction, blockTag?): Promise\<string>

Parameters

NameType
transactionDeferrable\<TransactionRequest>
blockTag?BlockTag | Promise\<BlockTag>

Returns

Promise\<string>


emit

Abstract emit(eventName, ...args): boolean

Parameters

NameType
eventNameEventType
...argsany[]

Returns

boolean


estimateGas

Abstract estimateGas(transaction): Promise\<BigNumber>

Parameters

NameType
transactionDeferrable\<TransactionRequest>

Returns

Promise\<BigNumber>


getBalance

Abstract getBalance(addressOrName, blockTag?): Promise\<BigNumber>

Parameters

NameType
addressOrNamestring | Promise\<string>
blockTag?BlockTag | Promise\<BlockTag>

Returns

Promise\<BigNumber>


getBlock

Abstract getBlock(blockHashOrBlockTag): Promise\<Block>

Parameters

NameType
blockHashOrBlockTagBlockTag | Promise\<BlockTag>

Returns

Promise\<Block>


getBlockNumber

Abstract getBlockNumber(): Promise\<number>

Returns

Promise\<number>


getBlockWithTransactions

Abstract getBlockWithTransactions(blockHashOrBlockTag): Promise\<BlockWithTransactions>

Parameters

NameType
blockHashOrBlockTagBlockTag | Promise\<BlockTag>

Returns

Promise\<BlockWithTransactions>


getCode

Abstract getCode(addressOrName, blockTag?): Promise\<string>

Parameters

NameType
addressOrNamestring | Promise\<string>
blockTag?BlockTag | Promise\<BlockTag>

Returns

Promise\<string>


getFeeData

getFeeData(): Promise\<FeeData>

Returns

Promise\<FeeData>


getGasPrice

Abstract getGasPrice(): Promise\<BigNumber>

Returns

Promise\<BigNumber>


getLogs

Abstract getLogs(filter): Promise\<Log[]>

Parameters

NameType
filterFilter

Returns

Promise\<Log[]>


getNetwork

Abstract getNetwork(): Promise\<Network>

Returns

Promise\<Network>


getStorageAt

Abstract getStorageAt(addressOrName, position, blockTag?): Promise\<string>

Parameters

NameType
addressOrNamestring | Promise\<string>
positionBigNumberish | Promise\<BigNumberish>
blockTag?BlockTag | Promise\<BlockTag>

Returns

Promise\<string>


getTransaction

Abstract getTransaction(transactionHash): Promise\<TransactionResponse>

Parameters

NameType
transactionHashstring

Returns

Promise\<TransactionResponse>


getTransactionCount

Abstract getTransactionCount(addressOrName, blockTag?): Promise\<number>

Parameters

NameType
addressOrNamestring | Promise\<string>
blockTag?BlockTag | Promise\<BlockTag>

Returns

Promise\<number>


getTransactionReceipt

Abstract getTransactionReceipt(transactionHash): Promise\<TransactionReceipt>

Parameters

NameType
transactionHashstring

Returns

Promise\<TransactionReceipt>


listenerCount

Abstract listenerCount(eventName?): number

Parameters

NameType
eventName?EventType

Returns

number


listeners

Abstract listeners(eventName?): Listener[]

Parameters

NameType
eventName?EventType

Returns

Listener[]


lookupAddress

Abstract lookupAddress(address): Promise\<null | string>

Parameters

NameType
addressstring | Promise\<string>

Returns

Promise\<null | string>


off

Abstract off(eventName, listener?): Provider

Parameters

NameType
eventNameEventType
listener?Listener

Returns

Provider


on

Abstract on(eventName, listener): Provider

Parameters

NameType
eventNameEventType
listenerListener

Returns

Provider


once

Abstract once(eventName, listener): Provider

Parameters

NameType
eventNameEventType
listenerListener

Returns

Provider

Implementation of

OnceBlockable.once


removeAllListeners

Abstract removeAllListeners(eventName?): Provider

Parameters

NameType
eventName?EventType

Returns

Provider


removeListener

removeListener(eventName, listener): Provider

Parameters

NameType
eventNameEventType
listenerListener

Returns

Provider


resolveName

Abstract resolveName(name): Promise\<null | string>

Parameters

NameType
namestring | Promise\<string>

Returns

Promise\<null | string>


sendTransaction

Abstract sendTransaction(signedTransaction): Promise\<TransactionResponse>

Parameters

NameType
signedTransactionstring | Promise\<string>

Returns

Promise\<TransactionResponse>


waitForTransaction

Abstract waitForTransaction(transactionHash, confirmations?, timeout?): Promise\<TransactionReceipt>

Parameters

NameType
transactionHashstring
confirmations?number
timeout?number

Returns

Promise\<TransactionReceipt>


isProvider

Static isProvider(value): value is Provider

Parameters

NameType
valueany

Returns

value is Provider