JsonRPCProvider class
A class that implements the JsonRPCProviderBase interface and provides methods for interacting with an Ethereum-like blockchain via the JSON-RPC protocol.
Constructors
- JsonRPCProvider.new(NetworkConfig chain, Client? httpClient)
- Creates a new instance of the JsonRPCProvider class.
Properties
Methods
-
estimateGas(
EthereumAddress to, String calldata) → Future< BigInt> - Asynchronously estimates the gas cost for a transaction to the specified address with the given calldata.
-
getBlockInformation(
{String blockNumber = 'latest', bool isContainFullObj = true}) → Future< BlockInformation> -
Asynchronously retrieves information about the specified block.
If no block number is provided, it defaults to the latest block.
If
isContainFullObj
is set totrue
, the full block object will be returned. -
getBlockNumber(
) → Future< int> - Asynchronously retrieves the current block number from the Ethereum node.
-
getEip1559GasPrice(
) → Future< Map< String, EtherAmount> > -
Asynchronously retrieves the EIP-1559 gas prices, including
maxFeePerGas
andmaxPriorityFeePerGas
. -
getGasPrice(
) → Future< Map< String, EtherAmount> > - Asynchronously retrieves the gas prices, supporting both EIP-1559 and legacy gas models.
-
getLegacyGasPrice(
) → Future< EtherAmount> - Asynchronously retrieves the legacy gas price from the Ethereum node.
-
getTransactionReceipt(
String txHash) → Future< TransactionReceipt> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendTransaction(
{required EthereumAddress from, required String to, required String data, String? gas, String? gasPrice, String? value, String? nonce}) → Future< String> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited