Provider<T extends _ProviderImpl> class
A Provider is an abstraction of a connection to the Ethereum network, providing a concise, consistent interface to standard Ethereum node functionality.
The ethers.js library provides several options which should cover the vast majority of use-cases, but also includes the necessary functions and classes for sub-classing if a more custom configuration is necessary.
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- impl → T
-
Internal JS Object, should not be used directly.
finalinherited
-
ready
→ Future<
Network> -
Returns a Future which will stall until the
Network
has heen established, ignoring errors due to the target node not being active yet.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call<
T> (String method, [List args = const []]) → Future< T> -
Call Ethers provider
method
withargs
. -
getBalance(
String address, [dynamic blockTag]) → Future< BigInt> -
Returns the balance of
address
as of theblockTag
. -
getBlock(
int blockNumber) → Future< Block> -
Get the
Block
from the network byblockNumber
, where the Block.transactions is a list of transaction hashes. -
getBlockNumber(
) → Future< int> - Returns the block number (or height) of the most recently mined block.
-
getBlockWithTransaction(
int blockNumber) → Future< BlockWithTransaction> -
Get the
BlockWithTransaction
atblockNumber
from the network, where the BlockWithTransaction.transactions is an Array of TransactionResponse. -
getCode(
String address, [dynamic blockTag]) → Future< String> -
Returns the contract code of
address
as of theblockTag
block height. If there is no contract currently deployed, the result is0x
. -
getFeeData(
) → Future< FeeData> -
Returns the current recommended
FeeData
to use in a transaction. -
getGasPrice(
) → Future< BigInt> - Returns the current gas price.
-
getLastestBlock(
) → Future< Block> -
Get the lastest
Block
from the network. -
getLastestBlockWithTransaction(
) → Future< BlockWithTransaction> -
Get the lastest
BlockWithTransaction
from the network. -
getLogs(
EventFilter< _EventFilterImpl> filter) → Future<List< Log< >_LogImpl> > -
Returns the List of Log matching the
filter
. -
getNetwork(
) → Future< Network> -
Returns the
Network
that this is connected to. -
getStorageAt(
String address, int pos, [dynamic blockTag]) → Future< String> -
Returns the
Bytes32
value of the positionpos
ataddress
, as of theblockTag
. -
getTransaction(
String hash) → Future< TransactionResponse?> -
Returns the
TransactionResponse
withhash
ornull
if the transaction is unknown. -
getTransactionCount(
String address, [dynamic blockTag]) → Future< int> -
Returns the number of transactions
address
has ever sent, as ofblockTag
. -
getTransactionReceipt(
String hash) → Future< TransactionReceipt?> -
Returns the
TransactionReceipt
forhash
ornull
if the transaction has not been mined. -
lookupAddress(
String address) → Future< String?> -
Performs a reverse lookup of the address in ENS using the Reverse Registrar. If the name does not exist, or the forward lookup does not match,
null
is returned. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on(
dynamic event, Function listener) → dynamic -
Add a
listener
to be triggered for eachevent
. -
onBlock(
void listener(int blockNumber)) → void -
Add a
listener
to be triggered for each new Block; -
once(
dynamic event, Function listener) → dynamic -
Add a
listener
to be triggered once forevent
. -
onceBlock(
void listener(int blockNumber)) → void -
Add a
listener
to be triggered once for new Block; -
onceFilter(
EventFilter< _EventFilterImpl> filter, Function listener) → void -
Add a
listener
to be triggered once forfilter
; -
onFilter(
EventFilter< _EventFilterImpl> filter, Function listener) → void -
Add a
listener
to be triggered forfilter
; -
rawCall<
String> ({TransactionRequest? transactionRequest, TransactionResponse? transactionResponse, dynamic blockTag}) → Future< String> -
Returns the result of executing the transaction in raw hex string, using either
transactionRequest
ortransactionResponse
. -
resolveName(
String name) → Future< String?> -
Looks up the address of name. If the name is not owned, or does not have a Resolver configured, or the Resolver does not have an address configured,
null
is returned. -
sendTransaction(
String data) → Future< TransactionResponse> -
Submits transaction
data
to the network to be mined. -
toString(
) → String -
A string representation of this object.
inherited
-
waitForTransaction(
String transactionHash, [int confirms = 1, Duration? timeout]) → Future< TransactionReceipt> -
Returns a Future of
TransactionReceipt
which will not resolve untiltransactionHash
is mined.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited