RpcProvider class
High-level RPC provider with middleware support.
Constructors
-
RpcProvider(Transport transport, {List<
Middleware> middlewares = const []})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
middlewares
→ List<
Middleware> -
Middleware chain.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transport → Transport
-
The underlying transport.
final
Methods
-
batchCall<
T> (List< RpcRequest> requests) → Future<List< T> > - Sends multiple RPC requests in a batch.
-
call<
T> (String method, List params) → Future< T> - Sends an RPC request.
-
dispose(
) → void - Disposes of the provider.
-
estimateGas(
Map< String, dynamic> tx) → Future<BigInt> - Estimates gas for a transaction.
-
ethCall(
Map< String, dynamic> tx, [String block = 'latest']) → Future<String> - Executes a call without creating a transaction.
-
getBalance(
String address, [String block = 'latest']) → Future< BigInt> - Gets the balance of an address.
-
getBlockByHash(
String hash, [bool fullTx = false]) → Future< Map< String, dynamic> ?> - Gets a block by hash.
-
getBlockByNumber(
String block, [bool fullTx = false]) → Future< Map< String, dynamic> ?> - Gets a block by number.
-
getBlockNumber(
) → Future< BigInt> - Gets the current block number.
-
getChainId(
) → Future< int> - Gets the chain ID.
-
getCode(
String address, [String block = 'latest']) → Future< String> - Gets the code at an address.
-
getGasPrice(
) → Future< BigInt> - Gets the current gas price.
-
getLogs(
Map< String, dynamic> filter) → Future<List< Map< >String, dynamic> > - Gets logs matching a filter.
-
getStorageAt(
String address, String position, [String block = 'latest']) → Future< String> - Gets storage at a position.
-
getTransaction(
String hash) → Future< Map< String, dynamic> ?> - Gets a transaction by hash.
-
getTransactionCount(
String address, [String block = 'latest']) → Future< BigInt> - Gets the transaction count (nonce) for an address.
-
getTransactionReceipt(
String hash) → Future< Map< String, dynamic> ?> - Gets a transaction receipt.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendRawTransaction(
String signedTx) → Future< String> - Sends a raw signed transaction.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited